From 2c33b9a9c6b62e742b6ed2f488fef4c30b5c544c Mon Sep 17 00:00:00 2001 From: Disassembler Date: Sun, 25 Mar 2018 23:17:58 +0200 Subject: [PATCH] Unify OMK naming and nginx configuration for spotter-appmgr --- openmapkit.sh | 12 ++++-------- openmapkit/Dockerfile | 2 +- openmapkit/etc/init.d/openmapkit | 5 ++++- openmapkit/etc/nginx/conf.d/openmapkit.conf | 11 ----------- openmapkit/srv/openmapkit/conf/settings.js | 2 +- 5 files changed, 10 insertions(+), 22 deletions(-) delete mode 100644 openmapkit/etc/nginx/conf.d/openmapkit.conf diff --git a/openmapkit.sh b/openmapkit.sh index ebda35f..52b98de 100755 --- a/openmapkit.sh +++ b/openmapkit.sh @@ -17,11 +17,7 @@ cp ${SOURCE_DIR}/etc/init.d/openmapkit /etc/init.d/openmapkit rc-update add openmapkit service openmapkit start -# Create nginx app definition -cp ${SOURCE_DIR}/etc/nginx/conf.d/openmapkit.conf /etc/nginx/conf.d/openmapkit.conf -service nginx reload - -# Add portal application definition -portal-app-manager openmapkit "https://{host}:8407/" admin "${OMK_ADMIN_PWD}" -portal-app-manager openmapkit-clients -p clienturl "http://{host}:8807" -portal-app-manager geoodk-clients -p clienturl "http://{host}:8807" +# Add application definition +spotter-appmgr add-app openmapkit "https://openmapkit.{host}/" admin "${OMK_ADMIN_PWD}" +spotter-appmgr add-app openmapkit-clients -p clienturl "https://openmapkit.{host}" +spotter-appmgr add-app geoodk-clients -p clienturl "https://openmapkit.{host}" diff --git a/openmapkit/Dockerfile b/openmapkit/Dockerfile index 14d8ec7..a7ed6b5 100644 --- a/openmapkit/Dockerfile +++ b/openmapkit/Dockerfile @@ -44,7 +44,7 @@ RUN \ && rm -rf /root/.cache /root/.config /root/.node-gyp /root/.npm VOLUME ["/srv/openmapkit/data"] -EXPOSE 8007 +EXPOSE 8080 USER omk ENV NODE_ENV production diff --git a/openmapkit/etc/init.d/openmapkit b/openmapkit/etc/init.d/openmapkit index 6ad6102..f02fd0e 100755 --- a/openmapkit/etc/init.d/openmapkit +++ b/openmapkit/etc/init.d/openmapkit @@ -11,12 +11,15 @@ start() { /usr/bin/docker run -d --rm \ --name openmapkit \ -h openmapkit \ - -p 127.0.0.1:8007:8007 \ -v /srv/openmapkit/conf/settings.js:/srv/openmapkit/settings.js \ -v /srv/openmapkit/data:/srv/openmapkit/data \ openmapkit } +start_post() { + /usr/local/bin/spotter-appmgr update-hosts openmapkit +} + stop() { /usr/bin/docker stop openmapkit } diff --git a/openmapkit/etc/nginx/conf.d/openmapkit.conf b/openmapkit/etc/nginx/conf.d/openmapkit.conf deleted file mode 100644 index e3b1f26..0000000 --- a/openmapkit/etc/nginx/conf.d/openmapkit.conf +++ /dev/null @@ -1,11 +0,0 @@ -server { - listen [::]:8807 ipv6only=off; - listen [::]:8407 ssl http2 ipv6only=off; - - access_log /var/log/nginx/openmapkit.access.log; - error_log /var/log/nginx/openmapkit.error.log; - - location / { - proxy_pass http://127.0.0.1:8007; - } -} diff --git a/openmapkit/srv/openmapkit/conf/settings.js b/openmapkit/srv/openmapkit/conf/settings.js index 6346040..6320c77 100644 --- a/openmapkit/srv/openmapkit/conf/settings.js +++ b/openmapkit/srv/openmapkit/conf/settings.js @@ -1,7 +1,7 @@ module.exports = { name: 'OpenMapKit Server', description: 'OpenMapKit Server is the lightweight server component of OpenMapKit that handles the collection and aggregation of OpenStreetMap and OpenDataKit data.', - port: 8007, + port: 8080, dataDir: __dirname + '/data', pagesDir: __dirname + '/pages', hostUrl: 'http://posm.io',