Setup fixes

This commit is contained in:
Disassembler 2018-09-21 15:05:48 +02:00
parent ed2e1193cb
commit 48492bf405
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
8 changed files with 11 additions and 11 deletions

View File

@ -78,5 +78,5 @@ if [ ${DEBUG:-0} -eq 1 ]; then
service sshd start service sshd start
fi fi
# Set dummy host and generate related files # Generate nginx default.conf
vmmgr update-host spotter.vm 443 vmmgr update-host spotter.vm 443

View File

@ -2,7 +2,7 @@
HOST="${DOMAIN}" HOST="${DOMAIN}"
[ "${PORT}" != "443" ] && HOST="${DOMAIN}:${PORT}" [ "${PORT}" != "443" ] && HOST="${DOMAIN}:${PORT}"
sed -i "s|\(^ckan\.site_url = \).*|\1https://${HOST}|" /srv/ckan/conf/ckan.ini sed -i "s|\(^ckan\.site_url = \).*|\1https://ckan.${HOST}|" /srv/ckan/conf/ckan.ini
sed -i "s|\(^smtp\.mail_from = \).*|\1${EMAIL}|" /srv/ckan/conf/ckan.ini sed -i "s|\(^smtp\.mail_from = \).*|\1${EMAIL}|" /srv/ckan/conf/ckan.ini
sed -i "s|\(^ckanext\.geoview\.gapi_key = \).*|\1${GMAPS_API_KEY}|" /srv/ckan/conf/ckan.ini sed -i "s|\(^ckanext\.geoview\.gapi_key = \).*|\1${GMAPS_API_KEY}|" /srv/ckan/conf/ckan.ini

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
sed -i "s|\(^\s\+proxyName=\).*|\1\"${DOMAIN}\"|" /srv/mifosx/conf/server.xml sed -i "s|\(^\s\+proxyName=\).*|\1\"mifosx.${DOMAIN}\"|" /srv/mifosx/conf/server.xml
sed -i "s|\(^\s\+proxyPort=\).*|\1\"${PORT}\"|" /srv/mifosx/conf/server.xml sed -i "s|\(^\s\+proxyPort=\).*|\1\"${PORT}\"|" /srv/mifosx/conf/server.xml
QUERY="UPDATE \`c_external_service_properties\` SET \`value\` = '${EMAIL}' WHERE \`external_service_id\` = 2 and \`name\` LIKE 'username'" QUERY="UPDATE \`c_external_service_properties\` SET \`value\` = '${EMAIL}' WHERE \`external_service_id\` = 2 and \`name\` LIKE 'username'"

View File

@ -12,6 +12,8 @@ envsubst <${SOURCE_DIR}/createdb.sql | lxc-attach -u 5432 -g 5432 postgres -- ps
# Configure OpenDataKit # Configure OpenDataKit
mkdir -p /srv/opendatakit/conf mkdir -p /srv/opendatakit/conf
export OPENDATAKIT_ADMIN_USER=admin
export OPENDATAKIT_ADMIN_REALM=spotter
envsubst <${SOURCE_DIR}/srv/opendatakit/conf/jdbc.properties >/srv/opendatakit/conf/jdbc.properties 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 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/conf/server.xml /srv/opendatakit/conf/server.xml
@ -29,8 +31,6 @@ done
service opendatakit stop service opendatakit stop
# Update admin account # Update admin account
export OPENDATAKIT_ADMIN_USER=admin
export OPENDATAKIT_ADMIN_REALM=spotter
export OPENDATAKIT_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) export OPENDATAKIT_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
export OPENDATAKIT_ADMIN_SALT=$(head -c 4 /dev/urandom | hexdump -e '"%x"') # Must be 8 characters export OPENDATAKIT_ADMIN_SALT=$(head -c 4 /dev/urandom | hexdump -e '"%x"') # Must be 8 characters
export OPENDATAKIT_ADMIN_BASIC_HASH=$(echo -n "${OPENDATAKIT_ADMIN_PWD}{${OPENDATAKIT_ADMIN_SALT}}" | sha1sum | tr -d " -") export OPENDATAKIT_ADMIN_BASIC_HASH=$(echo -n "${OPENDATAKIT_ADMIN_PWD}{${OPENDATAKIT_ADMIN_SALT}}" | sha1sum | tr -d " -")

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
sed -i "s|\(^\s\+proxyName=\).*|\1\"${DOMAIN}\"|" /srv/mifosx/conf/server.xml sed -i "s|\(^\s\+proxyName=\).*|\1\"odk.${DOMAIN}\"|" /srv/opendatakit/conf/server.xml
sed -i "s|\(^\s\+proxyPort=\).*|\1\"${PORT}\"|" /srv/mifosx/conf/server.xml sed -i "s|\(^\s\+proxyPort=\).*|\1\"${PORT}\"|" /srv/opendatakit/conf/server.xml
sed -i "s|\(^security\.server\.securePort=\).*|\1${PORT}|" /srv/opendatakit/conf/security.properties sed -i "s|\(^security\.server\.securePort=\).*|\1${PORT}|" /srv/opendatakit/conf/security.properties

View File

@ -2,7 +2,7 @@
HOST="${DOMAIN}" HOST="${DOMAIN}"
[ "${PORT}" != "443" ] && HOST="${PORT}:${DOMAIN}" [ "${PORT}" != "443" ] && HOST="${PORT}:${DOMAIN}"
sed -i "s|\(^settings\.base\.public_url = \).*|\1\"https://sahana.${HOST}\"|" /srv/sahana-demo/conf/000_config.py sed -i "s|\(^settings\.base\.public_url = \).*|\1\"https://sahana-demo.${HOST}\"|" /srv/sahana-demo/conf/000_config.py
sed -i "s|\(^settings\.mail\.sender = \).*|\1\"${EMAIL}\"|" /srv/sahana-demo/conf/000_config.py sed -i "s|\(^settings\.mail\.sender = \).*|\1\"${EMAIL}\"|" /srv/sahana-demo/conf/000_config.py
sed -i "s|\(^settings\.mail\.approver = \).*|\1\"${EMAIL}\"|" /srv/sahana-demo/conf/000_config.py sed -i "s|\(^settings\.mail\.approver = \).*|\1\"${EMAIL}\"|" /srv/sahana-demo/conf/000_config.py

View File

@ -13,8 +13,8 @@ envsubst <${SOURCE_DIR}/createdb.sql | lxc-attach -u 5432 -g 5432 postgres -- ps
# Prepare persistent directory structure # Prepare persistent directory structure
mkdir -p /srv/sambro/conf /srv/sambro/data/databases /srv/sambro/data/uploads /srv/sambro/data/SAMBRO mkdir -p /srv/sambro/conf /srv/sambro/data/databases /srv/sambro/data/uploads /srv/sambro/data/SAMBRO
chown -R 8001:8001 /srv/sambro/conf /srv/sambro/data chown -R 8001:8001 /srv/sambro/conf /srv/sambro/data
cp -rp /var/lib/lxc/sahana/sahana/srv/web2py/applications/eden/models/. /srv/sahana-demo/conf cp -rp /var/lib/lxc/sahana/sahana/srv/web2py/applications/eden/models/. /srv/sambro/conf
cp -rp /var/lib/lxc/sahana/sahana/srv/web2py/applications/eden/modules/templates/SAMBRO/. /srv/sahana-demo/data/SAMBRO cp -rp /var/lib/lxc/sahana/sahana/srv/web2py/applications/eden/modules/templates/SAMBRO/. /srv/sambro/data/SAMBRO
# Configure SAMBRO # Configure SAMBRO
export SAMBRO_HMAC=$(head -c 18 /dev/urandom | base64) export SAMBRO_HMAC=$(head -c 18 /dev/urandom | base64)

View File

@ -2,7 +2,7 @@
HOST="${DOMAIN}" HOST="${DOMAIN}"
[ "${PORT}" != "443" ] && HOST="${PORT}:${DOMAIN}" [ "${PORT}" != "443" ] && HOST="${PORT}:${DOMAIN}"
sed -i "s|\(^settings\.base\.public_url = \).*|\1\"https://sahana.${HOST}\"|" /srv/sambro/conf/000_config.py sed -i "s|\(^settings\.base\.public_url = \).*|\1\"https://sambro.${HOST}\"|" /srv/sambro/conf/000_config.py
sed -i "s|\(^settings\.mail\.sender = \).*|\1\"${EMAIL}\"|" /srv/sambro/conf/000_config.py sed -i "s|\(^settings\.mail\.sender = \).*|\1\"${EMAIL}\"|" /srv/sambro/conf/000_config.py
sed -i "s|\(^settings\.mail\.approver = \).*|\1\"${EMAIL}\"|" /srv/sambro/conf/000_config.py sed -i "s|\(^settings\.mail\.approver = \).*|\1\"${EMAIL}\"|" /srv/sambro/conf/000_config.py