From 93b55c6dc1b92e022945f018d0cb09c0eb82931b Mon Sep 17 00:00:00 2001 From: CartONG staff Date: Fri, 7 Jun 2019 15:06:00 +0200 Subject: [PATCH 1/6] Update docker-compose.yaml ODK Collect need to access by 8080 for form management --- docker-compose.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index dfd70da..72c6e07 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -6,6 +6,7 @@ services: context: . ports: - 80:8080 + - 8080:8080 # For debugging # - 7081:8080 volumes: From e8a1846e8da4a4ce717705d7bf8ef658f737cdfd Mon Sep 17 00:00:00 2001 From: CartONG staff Date: Thu, 20 Jun 2019 16:19:27 +0200 Subject: [PATCH 2/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7da63b8..41e5a85 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Run: apt-get install -y git - git clone https://github.com/roissard/odk.git + git clone https://github.com/CartONG/odk.git cd odk bash ./install.sh bash ./prepare.sh From 2712e86bac3dc3a0bd381afea69d4e5dae555c29 Mon Sep 17 00:00:00 2001 From: CartONG staff Date: Fri, 21 Jun 2019 09:32:40 +0200 Subject: [PATCH 3/6] Update install.sh missing library --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 28ae3c5..3c57283 100644 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ curl -sSL https://get.docker.com | sh -apt-get install -y python python-pip libffi-dev +apt-get install -y python python-pip libffi-dev libssl-dev pip install docker-compose cp odk.service /etc/systemd/system/ From b52fbfc3dfd1dfca783a5cb36ea9224541216800 Mon Sep 17 00:00:00 2001 From: Johan Roussay Date: Wed, 7 Aug 2019 13:39:48 +0100 Subject: [PATCH 4/6] - Change container to Alpine Linux - For compatibility reason, change the way to install docker compose (apt instead of pip) --- Dockerfile | 7 ++++--- install.sh | 3 +-- odk.service | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3847b06..f514439 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,9 @@ -FROM tomcat:8.5 +FROM tomcat:8.5-jre8-alpine WORKDIR /app - -RUN apt-get update && apt-get install -y mc default-jdk +RUN apk update && apk upgrade && \ + apk add openjdk8 +#RUN apk update && apk install -y openjdk8 #RUN apt-get update && apt-get install -y default-jdk #COPY tomcat-users.xml ${CATALINA_HOME}/conf/tomcat-users.xml diff --git a/install.sh b/install.sh index 3c57283..70e38b8 100644 --- a/install.sh +++ b/install.sh @@ -2,8 +2,7 @@ curl -sSL https://get.docker.com | sh -apt-get install -y python python-pip libffi-dev libssl-dev -pip install docker-compose +apt-get install -y python libffi-dev libssl-dev docker-compose cp odk.service /etc/systemd/system/ systemctl enable odk diff --git a/odk.service b/odk.service index e6f8428..194e19f 100644 --- a/odk.service +++ b/odk.service @@ -7,8 +7,8 @@ After=docker.service Type=oneshot RemainAfterExit=yes WorkingDirectory=/home/pi/odk -ExecStart=/usr/local/bin/docker-compose up -d -ExecStop=/usr/local/bin/docker-compose down +ExecStart=/usr/bin/docker-compose up -d +ExecStop=/usr/bin/docker-compose down TimeoutStartSec=0 [Install] From 011f687883a7bc48b2f970f7d9724937dfdb94be Mon Sep 17 00:00:00 2001 From: CarONG Date: Thu, 28 Oct 2021 11:28:42 +0000 Subject: [PATCH 5/6] [EDIT] Stabilize confs + make export work on external domain --- Dockerfile | 3 ++- docker-compose.yaml | 7 ++----- odk.service | 2 +- security.properties | 11 +++++++++++ 4 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 security.properties diff --git a/Dockerfile b/Dockerfile index f514439..5473e99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,13 +16,14 @@ RUN wget https://jdbc.postgresql.org/download/postgresql-9.4.1209.jre7.jar && \ # mv ODK-Aggregate-v2.0.3.war ${CATALINA_HOME}/webapps/ODK-Aggregate-v2.0.3.war #COPY ODK-Aggregate-v2.0.3.war ${CATALINA_HOME}/webapps/ODK-Aggregate-v2.0.3.war -COPY ODK-Aggregate-v2.0.3.war jdbc.properties ./ +COPY ODK-Aggregate-v2.0.3.war jdbc.properties security.properties ./ RUN pwd && mkdir odktemp && \ cd odktemp && \ ls -la /app && \ jar -xvf /app/ODK-Aggregate-v2.0.3.war && \ cp /app/jdbc.properties ./WEB-INF/classes/ && \ + cp /app/security.properties ./WEB-INF/classes/ && \ cd /app && \ mkdir ${CATALINA_HOME}/webapps/odk-aggregate && \ rm -fr ${CATALINA_HOME}/webapps/ROOT/* && \ diff --git a/docker-compose.yaml b/docker-compose.yaml index 72c6e07..f7f0f9a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,16 +5,13 @@ services: dockerfile: Dockerfile context: . ports: - - 80:8080 - - 8080:8080 -# For debugging -# - 7081:8080 + - 8000:8080 volumes: - .:/app depends_on: - postgres postgres: - image: postgres:latest + image: postgres:10 volumes: - db_data:/var/lib/postgresql/data environment: diff --git a/odk.service b/odk.service index 194e19f..f0dabde 100644 --- a/odk.service +++ b/odk.service @@ -6,7 +6,7 @@ After=docker.service [Service] Type=oneshot RemainAfterExit=yes -WorkingDirectory=/home/pi/odk +WorkingDirectory=/home/debian/odk ExecStart=/usr/bin/docker-compose up -d ExecStop=/usr/bin/docker-compose down TimeoutStartSec=0 diff --git a/security.properties b/security.properties new file mode 100644 index 0000000..ed5c039 --- /dev/null +++ b/security.properties @@ -0,0 +1,11 @@ +security.server.deviceAuthentication=digest +security.server.secureChannelType=REQUIRES_INSECURE_CHANNEL +security.server.channelType=REQUIRES_INSECURE_CHANNEL +security.server.forceHttpsLinks=false +security.server.hostname=aggregate.cartong.org +security.server.port=8000 +security.server.securePort=443 +security.server.superUserUsername=administrator +security.server.realm.realmString=ODK Aggregate +security.server.checkHostnames=true + From 1e8850acf9c883079ce1ddc95582ade48d097588 Mon Sep 17 00:00:00 2001 From: CartONG staff Date: Thu, 28 Oct 2021 13:42:46 +0200 Subject: [PATCH 6/6] [EDIT] Update README for production setups --- README.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 41e5a85..15fe7df 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,23 @@ Run: - apt-get install -y git - git clone https://github.com/CartONG/odk.git - cd odk - bash ./install.sh - bash ./prepare.sh - systemctl start odk +``` bash +apt-get install -y git +git clone https://github.com/CartONG/odk.git +cd odk +bash ./install.sh +bash ./prepare.sh +systemctl start odk +``` + +If setup is to be done on a production domain, update the conf, in the `security.properties` file to follow your need: +``` yml +... +security.server.hostname=aggregate.domain.org +security.server.port=80 +security.server.securePort=443 +... +``` Open: