Make self-signed certificates work in OpenMapKit + fix build
This commit is contained in:
parent
d532d087fe
commit
ebe3828b5e
@ -10,6 +10,7 @@
|
|||||||
"openmapkit": {
|
"openmapkit": {
|
||||||
"image": "openmapkit_0.12.0-200621",
|
"image": "openmapkit_0.12.0-200621",
|
||||||
"mounts": {
|
"mounts": {
|
||||||
|
"openmapkit/omk_conf/add-ca-cert.env": "srv/openmapkit/add-ca-cert.env:file",
|
||||||
"openmapkit/omk_conf/settings.js": "srv/openmapkit/settings.js:file",
|
"openmapkit/omk_conf/settings.js": "srv/openmapkit/settings.js:file",
|
||||||
"openmapkit/omk_data": "srv/openmapkit/data"
|
"openmapkit/omk_data": "srv/openmapkit/data"
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ RUN EOF
|
|||||||
apk --no-cache add python2 openjdk8-jre-base
|
apk --no-cache add python2 openjdk8-jre-base
|
||||||
|
|
||||||
# Install build dependencies
|
# Install build dependencies
|
||||||
apk --no-cache add --virtual .deps build-base git py2-pip yarn
|
apk --no-cache add --virtual .deps build-base git npm py2-pip yarn
|
||||||
|
|
||||||
# Clone OpenMapKit
|
# Clone OpenMapKit
|
||||||
git clone --recursive --depth 1 https://github.com/posm/OpenMapKitServer /srv/openmapkit
|
git clone --recursive --depth 1 https://github.com/posm/OpenMapKitServer /srv/openmapkit
|
||||||
@ -15,8 +15,7 @@ RUN EOF
|
|||||||
# Install OpenMapKit dependencies
|
# Install OpenMapKit dependencies
|
||||||
cd /srv/openmapkit
|
cd /srv/openmapkit
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
yarn add libxmljs
|
npm install
|
||||||
yarn
|
|
||||||
cd frontend
|
cd frontend
|
||||||
yarn
|
yarn
|
||||||
yarn build
|
yarn build
|
||||||
|
5
lxc-apps/openmapkit/image.d/bin/add-ca-cert
Executable file
5
lxc-apps/openmapkit/image.d/bin/add-ca-cert
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. /srv/openmapkit/add-ca-cert.env
|
||||||
|
|
||||||
|
true | openssl s_client -connect ${HOST}:${PORT} | openssl x509 -out /etc/ssl/certs/openmapkit.crt
|
@ -1,6 +1,8 @@
|
|||||||
#!/bin/execlineb -P
|
#!/bin/execlineb -P
|
||||||
|
|
||||||
fdmove -c 2 1
|
fdmove -c 2 1
|
||||||
|
foreground { /bin/add-ca-cert }
|
||||||
|
export NODE_EXTRA_CA_CERTS /etc/ssl/certs/openmapkit.crt
|
||||||
export NODE_ENV production
|
export NODE_ENV production
|
||||||
s6-setuidgid omk
|
s6-setuidgid omk
|
||||||
node /srv/openmapkit/server.js
|
node /srv/openmapkit/server.js
|
||||||
|
@ -10,6 +10,7 @@ OMK_LAYER="${LAYERS_DIR}/openmapkit_0.12.0-200621"
|
|||||||
export OPENMAPKIT_ADMIN_USER="admin"
|
export OPENMAPKIT_ADMIN_USER="admin"
|
||||||
export OPENMAPKIT_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
|
export OPENMAPKIT_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
|
||||||
install -o 108080 -g 108080 -m 750 -d ${OMK_CONF}
|
install -o 108080 -g 108080 -m 750 -d ${OMK_CONF}
|
||||||
|
install -o 108080 -g 108080 -m 640 omk_conf/add-ca-cert.env ${OMK_CONF}/add-ca-cert.env
|
||||||
envsubst <omk_conf/settings.js | install -o 108080 -g 108080 -m 640 /dev/stdin ${OMK_CONF}/settings.js
|
envsubst <omk_conf/settings.js | install -o 108080 -g 108080 -m 640 /dev/stdin ${OMK_CONF}/settings.js
|
||||||
|
|
||||||
# Copy existing files into persistent storage
|
# Copy existing files into persistent storage
|
||||||
|
2
lxc-apps/openmapkit/install/omk_conf/add-ca-cert.env
Normal file
2
lxc-apps/openmapkit/install/omk_conf/add-ca-cert.env
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
HOST=omk.spotter.vm
|
||||||
|
PORT=443
|
10
lxc-apps/openmapkit/install/update-conf.sh
Executable file
10
lxc-apps/openmapkit/install/update-conf.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Volumes
|
||||||
|
OMK_CONF="${VOLUMES_DIR}/opendatakit/omk_conf"
|
||||||
|
|
||||||
|
# Replacements
|
||||||
|
cat <<EOF >${OMK_CONF}/add-ca-cert.env
|
||||||
|
HOST=${HOST}
|
||||||
|
PORT=${PORT}
|
||||||
|
EOF
|
Loading…
Reference in New Issue
Block a user