From 955a178767639aea8680f9bd417bc63f238be75c Mon Sep 17 00:00:00 2001 From: Disassembler Date: Fri, 16 Mar 2018 21:35:35 +0100 Subject: [PATCH] Fix OpenDataKit URL confusion, closes #224 --- opendatakit.sh | 2 - opendatakit/Dockerfile | 2 + opendatakit/etc/init.d/opendatakit | 5 - .../srv/opendatakit/conf/security.properties | 5 +- opendatakit/srv/opendatakit/conf/server.xml | 143 ------------------ opendatakit/srv/opendatakit/update-ip.sh | 4 - 6 files changed, 3 insertions(+), 158 deletions(-) delete mode 100644 opendatakit/srv/opendatakit/conf/server.xml delete mode 100755 opendatakit/srv/opendatakit/update-ip.sh diff --git a/opendatakit.sh b/opendatakit.sh index d9ce270..c49bb3d 100755 --- a/opendatakit.sh +++ b/opendatakit.sh @@ -20,8 +20,6 @@ export OPENDATAKIT_ADMIN_REALM=spotter mkdir -p /srv/opendatakit/conf envsubst <${SOURCE_DIR}/srv/opendatakit/conf/jdbc.properties >/srv/opendatakit/conf/jdbc.properties envsubst <${SOURCE_DIR}/srv/opendatakit/conf/security.properties >/srv/opendatakit/conf/security.properties -cp ${SOURCE_DIR}/srv/opendatakit/conf/server.xml /srv/opendatakit/conf/server.xml -cp ${SOURCE_DIR}/srv/opendatakit/update-ip.sh /srv/opendatakit/update-ip.sh chown -R 8015:8015 /srv/opendatakit/conf # Create OpenDataKit service diff --git a/opendatakit/Dockerfile b/opendatakit/Dockerfile index 29a9279..a9d7b72 100644 --- a/opendatakit/Dockerfile +++ b/opendatakit/Dockerfile @@ -13,6 +13,8 @@ RUN \ # Deploy web archive && mkdir /srv/tomcat/webapps/aggregate \ && unzip build/libs/aggregate-*.war -d /srv/tomcat/webapps/aggregate \ + # Configure Tomcat port + && sed -i 's/port="8080"/port="8015"/g' /srv/tomcat/conf/server.xml \ # Create OS user && addgroup -S -g 8015 odk \ && adduser -S -u 8015 -h /srv/tomcat -s /bin/false -g odk -G odk odk \ diff --git a/opendatakit/etc/init.d/opendatakit b/opendatakit/etc/init.d/opendatakit index a7371d7..1053be2 100755 --- a/opendatakit/etc/init.d/opendatakit +++ b/opendatakit/etc/init.d/opendatakit @@ -7,10 +7,6 @@ depend() { use dns logger netmount postfix } -start_pre() { - /srv/opendatakit/update-ip.sh -} - start() { /usr/bin/docker run -d --rm \ --name opendatakit \ @@ -18,7 +14,6 @@ start() { --link postfix \ --link postgres \ -p 127.0.0.1:8015:8015 \ - -v /srv/opendatakit/conf/server.xml:/srv/tomcat/conf/server.xml \ -v /srv/opendatakit/conf/jdbc.properties:/srv/tomcat/webapps/aggregate/WEB-INF/classes/jdbc.properties \ -v /srv/opendatakit/conf/security.properties:/srv/tomcat/webapps/aggregate/WEB-INF/classes/security.properties \ opendatakit diff --git a/opendatakit/srv/opendatakit/conf/security.properties b/opendatakit/srv/opendatakit/conf/security.properties index 344d973..f997857 100644 --- a/opendatakit/srv/opendatakit/conf/security.properties +++ b/opendatakit/srv/opendatakit/conf/security.properties @@ -12,15 +12,12 @@ security.server.deviceAuthentication=basic # do get set for a specific http: or https: scheme and are not transferrable. # # should be REQUIRES_SECURE_CHANNEL but can't unless SSL is available. -security.server.secureChannelType=REQUIRES_INSECURE_CHANNEL +security.server.secureChannelType=REQUIRES_SECURE_CHANNEL -#security.server.secureChannelType=REQUIRES_SECURE_CHANNEL # either REQUIRES_INSECURE_CHANNEL to secure nothing # or REQUIRES_SECURE_CHANNEL to secure everything # or perhaps ANY_CHANNEL when running through a proxy server security.server.channelType=REQUIRES_INSECURE_CHANNEL -#security.server.channelType=REQUIRES_SECURE_CHANNEL - # When running under Tomcat, you need to set the hostname and port for # the server so that the background tasks can generate properly-constructed diff --git a/opendatakit/srv/opendatakit/conf/server.xml b/opendatakit/srv/opendatakit/conf/server.xml deleted file mode 100644 index ebd8590..0000000 --- a/opendatakit/srv/opendatakit/conf/server.xml +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/opendatakit/srv/opendatakit/update-ip.sh b/opendatakit/srv/opendatakit/update-ip.sh deleted file mode 100755 index a268d6b..0000000 --- a/opendatakit/srv/opendatakit/update-ip.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -URL=$(ip route get 1 | awk '{print $NF;exit}') -sed -i "s|\(^\s\+proxyName\).*|\1=\"${URL}\"|" /srv/opendatakit/conf/server.xml