diff --git a/00-install.sh b/00-install.sh index 1ea5d1c..fa296b2 100755 --- a/00-install.sh +++ b/00-install.sh @@ -16,6 +16,7 @@ ${SOURCE_DIR}/gnuhealth.sh ${SOURCE_DIR}/kanboard.sh ${SOURCE_DIR}/mifosx.sh ${SOURCE_DIR}/motech.sh +${SOURCE_DIR}/openmapkit.sh ${SOURCE_DIR}/pandora.sh ${SOURCE_DIR}/sahana.sh ${SOURCE_DIR}/sambro.sh diff --git a/basic/srv/portal/img/OMK.png b/basic/srv/portal/img/OMK.png new file mode 100644 index 0000000..fdaa652 Binary files /dev/null and b/basic/srv/portal/img/OMK.png differ diff --git a/basic/srv/portal/index.html b/basic/srv/portal/index.html index b63ee8e..a2e5a50 100644 --- a/basic/srv/portal/index.html +++ b/basic/srv/portal/index.html @@ -49,7 +49,7 @@

SAMBRO MobileSAMBRO Mobile

Mobilní klient k aplikaci Sahana EDEN. Po stažení se zaregistrujte a pro přístup k serveru zadejte IP vaší instalace Sahana EDEN.
IOSIOS 6.0 a vyšší
- AndroidAndroid 4.0 a vyšší + AndroidAndroid 4.0 a vyšší

@@ -71,7 +71,7 @@ -
+

Open Data KitOpen Data Kit

Sběr dat s pomocí smartphone.
XLSForm - online konverter XLS.
@@ -83,6 +83,26 @@

+
+

Open Map KitOpen Data Kit

+

Sběr dat s pomocí smartphone.
+

+
+ +
+

Open Map KitOpen Map Kit

+

Mobilní aplikace
+ ODK CollectODK Collect pro Android
+ AndroidOpenMapKit pro Android 4.1 a vyšší +

+ +
+

FrontlineSMSFrontlineSMS

SMS messaging přes veřejné datové brány

@@ -132,14 +152,14 @@

UshahidiUshahidi Mobile

Mobilní aplikace Ushahidi pro
IOSIOS 9.0 a vyšší
- AndroidAndroid 4.4 a vyšší + AndroidAndroid 4.4 a vyšší

SMS Sync GatewaySMS Sync Gateway

Mobilní aplikace pro
- AndroidAndroid 2.3 a vyšší + AndroidAndroid 2.3 a vyšší

@@ -155,7 +175,7 @@

KanboardKanboard Mobile

Mobilní aplikace
- KanBoardKanBoard client pro Android 4.1 a vyšší
+ KanBoardKanBoard client pro Android 4.1 a vyšší
AndroidKandroid pro Android 4.2 a vyšší

diff --git a/openmapkit.sh b/openmapkit.sh new file mode 100755 index 0000000..48616eb --- /dev/null +++ b/openmapkit.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +SOURCE_DIR=$(realpath $(dirname "${0}"))/openmapkit + +# Add NodeJS repository +wget https://deb.nodesource.com/gpgkey/nodesource.gpg.key -O - | apt-key add - +echo 'deb https://deb.nodesource.com/node_8.x stretch main' > /etc/apt/sources.list.d/nodejs.list +apt-get -y update + +# Install OpenMapKit dependencies +apt-get install --no-install-recommends -y build-essential nodejs python-dev python-virtualenv virtualenv + +# Clone repositories +git clone --depth 1 https://github.com/AmericanRedCross/OpenMapKitServer /srv/omk +git -C /srv/omk submodule update --init + +# Install OpenMapKit python virtual environment +virtualenv --no-site-packages --python=/usr/bin/python2.7 /srv/omk +/srv/omk/bin/pip install -r /srv/omk/requirements.txt + +# Create OpenMapKit OS user +adduser --system --group --home /srv/omk --shell /bin/bash omk +chown -R omk:omk /srv/omk + +# Install NodeJS dependencies +sudo -u omk -i npm install yarn +sudo -u omk -i npm install libxmljs +sudo -u omk -i /srv/omk/node_modules/yarn/bin/yarn + +# Configure OpenMapKit +export OMK_ADMIN_USER="admin" +export OMK_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) +envsubst <${SOURCE_DIR}/srv/omk/settings.js >/srv/omk/settings.js + +# Configure OpenMapKit service +cp ${SOURCE_DIR}/lib/systemd/system/openmapkit.service /lib/systemd/system/openmapkit.service +systemctl daemon-reload +systemctl enable openmapkit +systemctl start openmapkit + +# Create nginx site definition +cp ${SOURCE_DIR}/etc/nginx/sites-available/openmapkit /etc/nginx/sites-available/openmapkit +ln -s /etc/nginx/sites-available/openmapkit /etc/nginx/sites-enabled/openmapkit + +# Restart services +systemctl restart nginx + +# Add portal application definition +portal-app-manager openmapkit "https://{host}:8007/" admin "${OMK_ADMIN_PWD}" +portal-app-manager openmapkit-clients -p clienturl "http://{host}:8096" diff --git a/openmapkit/etc/nginx/sites-available/openmapkit b/openmapkit/etc/nginx/sites-available/openmapkit new file mode 100644 index 0000000..35e293a --- /dev/null +++ b/openmapkit/etc/nginx/sites-available/openmapkit @@ -0,0 +1,14 @@ +server { + listen 8007 ssl http2; + listen [::]:8007 ssl http2; + + access_log /var/log/nginx/openmapkit.access.log; + error_log /var/log/nginx/openmapkit.error.log; + + location / { + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Host $host:$server_port; + proxy_set_header X-Forwarded-Proto https; + proxy_pass http://127.0.0.1:8096; + } +} diff --git a/openmapkit/lib/systemd/system/openmapkit.service b/openmapkit/lib/systemd/system/openmapkit.service new file mode 100644 index 0000000..8bad599 --- /dev/null +++ b/openmapkit/lib/systemd/system/openmapkit.service @@ -0,0 +1,15 @@ +[Unit] +Description=OpenMapKit Server +After=network.target + +[Service] +Type=simple +User=omk +Environment=NODE_ENV=production +Environment=VIRTUAL_ENV=/srv/omk +Environment=PATH=/srv/omk/bin:/usr/local/bin:/usr/bin:/bin +WorkingDirectory=/srv/omk +ExecStart=/usr/bin/node server.js + +[Install] +WantedBy=multi-user.target diff --git a/openmapkit/srv/omk/settings.js b/openmapkit/srv/omk/settings.js new file mode 100644 index 0000000..5f5fcb8 --- /dev/null +++ b/openmapkit/srv/omk/settings.js @@ -0,0 +1,20 @@ +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: 8096, + dataDir: __dirname + '/data', + pagesDir: __dirname + '/pages', + hostUrl: 'http://posm.io', + osmApi: { + server: 'http://osm.posm.io', + user: 'POSM', + pass: '' + }, + + // To do simple authentication, you can have an object like so: + auth: { + user: '${OMK_ADMIN_USER}', + pass: '${OMK_ADMIN_PWD}' + } + +};