Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upgrade to pe version #580

Open
wants to merge 2 commits into
base: v1-orbeon-2022
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 14 additions & 18 deletions .github/workflows/ci-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,28 @@ name: Stromae V1 - build docker
on:
push:
branches:
- 'v1-orbeon-2022'
- "v1-orbeon-2022"
- "v1/**"

jobs:

build:
runs-on: ubuntu-latest
outputs:
stromae-version: ${{ steps.version-step.outputs.version }}
steps:
- uses: actions/checkout@v2


- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 17

distribution: "temurin"
java-version: "17"
- name: script download and clean Orbeon
run: |
chmod +x ./script/getCleanedOrbeon.sh
./script/getCleanedOrbeon.sh $ORBEON_URL_CE
chmod +x ./scripts/get-cleaned-orbeon.sh
./scripts/get-cleaned-orbeon.sh $ORBEON_URL
shell: bash
env:
ORBEON_URL_CE: https://github.com/orbeon/orbeon-forms/releases/download/tag-release-2022.1-ce/orbeon-2022.1.202212310353-CE.zip
ORBEON_URL: https://github.com/orbeon/orbeon-forms/releases/download/tag-release-2022.1.6-pe-pseudo/orbeon-2022.1.6.202401300738-PE.zip

- name: Get Version
id: version-step
Expand All @@ -36,10 +34,10 @@ jobs:
run: echo ${{ steps.version-step.outputs.version }}

- name: Build with Maven
run: mvn clean install
run: mvn clean package

- name: Upload war
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: war
path: target/*.war
Expand All @@ -49,10 +47,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download build
id: download
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: war
path: target/
Expand All @@ -65,5 +63,3 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
default_branch: ${{ github.ref }}
tags: ${{ needs.build.outputs.stromae-version }}


47 changes: 33 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,48 @@
FROM tomcat:9-jre17

RUN rm -rf $CATALINA_HOME/webapps/*
ADD config/ $CATALINA_HOME/webapps/
ADD ./target/*.war $CATALINA_HOME/webapps/rmesstromae.war

COPY ./script/env.sh $CATALINA_HOME
RUN chmod 755 $CATALINA_HOME/env.sh
ARG TOMCAT_VERSION=9.0.91-jre17-temurin-jammy
FROM tomcat:${TOMCAT_VERSION}

# Ajout securité tomcat
RUN sed -i 's/<\/Host>/<Valve className="org.apache.catalina.valves.RemoteIpValve" remoteIpHeader="X-Forwarded-For" protocolHeader="X-Scheme"\/><\/Host>/' /usr/local/tomcat/conf/server.xml
RUN sed -i 's/<Connector port="8080" protocol="HTTP\/1.1"/<Connector port="8080" protocol="HTTP\/1.1"\n server="unknown"/' /usr/local/tomcat/conf/server.xml
RUN sed -i 's/pattern="%h %l %u %t &quot;%r&quot; %s %b"/pattern="%h %l %u %t %r %s %b %D %{Referer}i %{User-Agent}i"/' /usr/local/tomcat/conf/server.xml
RUN sed -i 's/autoDeploy="true"/autoDeploy="false"/' /usr/local/tomcat/conf/server.xml
RUN sed -i 's/<Server port="8005" shutdown="SHUTDOWN">/<Server port="-1" shutdown="Super1mpr3viSible">/' /usr/local/tomcat/conf/server.xml

# Add WAR (application)
COPY ./target/*.war /usr/local/tomcat/webapps/rmesstromae.war

# Add configuration files (log4j, props & empty license.xml)
COPY ./conf/log4j2.xml /usr/local/tomcat/webapps/properties/config/log4j2.xml
COPY ./conf/properties-local-prod.xml /usr/local/tomcat/webapps/properties/config/properties-local-prod.xml
COPY ./conf/license.xml /home/tomcat/.orbeon/license.xml
# Add entrypoint.sh
COPY ./scripts/entrypoint.sh /usr/local/tomcat/entrypoint.sh

# Ajout user tomcat pour non root
RUN groupadd -g 10001 tomcat
RUN useradd tomcat -u 10001 -g 10001 -ms /bin/bash
ENV TOMCAT_USER_ID=10001
ENV TOMCAT_USER=tomcat

RUN chown tomcat: /usr/local/tomcat -R
ENV JAVA_TOOL_OPTIONS_DEFAULT \
-XX:MaxRAMPercentage=75 \
-XX:+UseZGC

RUN groupadd -g $TOMCAT_USER_ID $TOMCAT_USER
RUN useradd $TOMCAT_USER -u $TOMCAT_USER_ID -g $TOMCAT_USER_ID -ms /bin/bash

RUN chown $TOMCAT_USER: /usr/local/tomcat -R
RUN chmod 750 /usr/local/tomcat -R
RUN chown $TOMCAT_USER: /home/tomcat/.orbeon -R

USER tomcat
# give write permission to write in properties folder
RUN chmod 755 /usr/local/tomcat/entrypoint.sh
RUN chmod 755 /usr/local/tomcat/webapps/properties -R
RUN chmod 755 /home/tomcat/.orbeon -R

USER $TOMCAT_USER_ID

EXPOSE 8080
EXPOSE 8443

CMD ["/bin/bash", "-c", "$CATALINA_HOME/env.sh && catalina.sh run"]

CMD ["/bin/bash", "-c", \
"export JAVA_TOOL_OPTIONS=\"$JAVA_TOOL_OPTIONS_DEFAULT $JAVA_TOOL_OPTIONS\"; \
$CATALINA_HOME/entrypoint.sh && catalina.sh run" ]
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Stromae

Data collection services for XForms questionnaires powered by Orbeon.
Data collection services for XForms questionnaires powered by Orbeon.

This project takes the PE version (under license) of orbeon from GitHub and adds the developments made by the Insee team to make the xforms questionnaires produced by Eno functional.

This project uses orbeon version 2022.1.6.

Unfortunately, there isn't (yet?) a version of orbeon that works properly with our xforms questionnaires.
A license is therefore required.

The license is in the [~/.orbeon/license.xml] folder. It is set at deployment by the `ORBEON_LICENSE` environment variable.

So yo need a license to run this app.
19 changes: 1 addition & 18 deletions assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
<format>war</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<files>
<file>
<source>${project.basedir}/insee-overload/common/WEB-INF/orbeon-insee/config/properties-local.xml</source>
<outputDirectory>WEB-INF/orbeon-insee/config</outputDirectory>
<filtered>true</filtered>
</file>
</files>
<fileSets>
<fileSet>
<directory>${project.basedir}/orbeon-source</directory>
Expand All @@ -21,17 +14,7 @@
<outputDirectory/>
</fileSet>
<fileSet>
<directory>${project.basedir}/insee-overload/common</directory>
<includes>
<include>**/**</include>
</includes>
<excludes>
<exclude>**/**/properties-local.xml</exclude>
</excludes>
<outputDirectory/>
</fileSet>
<fileSet>
<directory>${project.basedir}/insee-overload/default</directory>
<directory>${project.build.directory}/content</directory>
<includes>
<include>**/**</include>
</includes>
Expand Down
1 change: 1 addition & 0 deletions conf/license.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<signed-data>empty</signed-data>
16 changes: 16 additions & 0 deletions conf/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Configuration monitorInterval="60">
<Appenders>
<Console name="Console-Appender" target="SYSTEM_OUT">
<PatternLayout>
<pattern>
[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n
</pattern>
</PatternLayout>
</Console>
</Appenders>
<Loggers>
<Root level="info" additivity="false">
<AppenderRef ref="Console-Appender" />
</Root>
</Loggers>
</Configuration>
16 changes: 16 additions & 0 deletions conf/properties-local-prod.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<properties xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:oxf="http://www.orbeon.com/oxf/processors">
<!--********************************Les proprietes existantes d'orbeon********************************-->
<!-- Le chemin vers la collection qui va abriter les formulaires qui vont etre traites par orbeon (avec id et mdp de connexion)-->
<property as="xs:anyURI" name="oxf.fr.persistence.exist.exist-uri" value="$STROMAE_DB_URL/$ORBEON_EXIST_COLLECTION"/>
<!-- L'url vers coltorb pour la redirection des services orbeon (bien indiquer l'adresse du serveur et pas l'url accedee) -->
<property as="xs:anyURI" name="oxf.url-rewriting.service.base-uri" value="$STROMAE_HOST"/>
<!--********************************Les propretes creees par coltrane********************************-->
<!-- L'url de base pour la redirection vers l'url orbeon -->
<property as="xs:anyURI" name="url-orbeon" value="$STROMAE_HOST"/>
<property as="xs:anyURI" name="url-orbeon-s" value="$STROMAE_HOST"/>
<!-- L'adresse du serveur exist (avec id et mdp de connexion) -->
<property as="xs:anyURI" name="server-exist-orbeon" value="$STROMAE_DB_URL/$ORBEON_EXIST"/>
<!-- Affichage du numero de version -->
<property as="xs:boolean" name="affichage-numero" value="true"/>
<property as="xs:string" name="insee-context" value="default"/>
</properties>
62 changes: 0 additions & 62 deletions config/properties/config/log4j.xml

This file was deleted.

24 changes: 0 additions & 24 deletions config/properties/config/properties-local-dev.xml

This file was deleted.

Loading
Loading