Fix hostnames

This commit is contained in:
Disassembler 2019-10-05 16:34:10 +02:00
parent 9b18c94ddd
commit cf99826386
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
39 changed files with 65 additions and 65 deletions

View File

@ -19,21 +19,21 @@ service crisiscleanup-postgres start
envsubst <createdb.sql | lxc-attach -u 5432 -g 5432 crisiscleanup-postgres -- psql
# Copy existing config files into persistent storage
mkdir -p /srv/crisiscleanup/crisiscleanup_conf
chown 108005:108005 /srv/crisiscleanup/crisiscleanup_conf
lxc-execute crisiscleanup -- tar -cC /srv/crisiscleanup/config . | tar -xC /srv/crisiscleanup/crisiscleanup_conf
mkdir -p /srv/crisiscleanup/cc_conf
chown 108005:108005 /srv/crisiscleanup/cc_conf
lxc-execute crisiscleanup -- tar -cC /srv/crisiscleanup/config . | tar -xC /srv/crisiscleanup/cc_conf
# Configure CrisisCleanup
export CRISISCLEANUP_ADMIN_USER="Admin"
export CRISISCLEANUP_ADMIN_EMAIL="admin@example.com"
export CRISISCLEANUP_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
envsubst <crisiscleanup_conf/database.yml >/srv/crisiscleanup/crisiscleanup_conf/database.yml
cp crisiscleanup_conf/boot.rb /srv/crisiscleanup/crisiscleanup_conf/boot.rb
cp crisiscleanup_conf/initializers/devise.rb /srv/crisiscleanup/crisiscleanup_conf/initializers/devise.rb
cp crisiscleanup_conf/environments/production.rb /srv/crisiscleanup/crisiscleanup_conf/environments/production.rb
envsubst <cc_conf/database.yml >/srv/crisiscleanup/cc_conf/database.yml
cp cc_conf/boot.rb /srv/crisiscleanup/cc_conf/boot.rb
cp cc_conf/initializers/devise.rb /srv/crisiscleanup/cc_conf/initializers/devise.rb
cp cc_conf/environments/production.rb /srv/crisiscleanup/cc_conf/environments/production.rb
# Populate database
#envsubst <crisiscleanup_conf/db/seeds.rb >/var/lib/lxc/crisiscleanup/crisiscleanup/srv/crisiscleanup/db/seeds.rb # TODO bud volat User.create! zvlast nebo vyresit jinak
#envsubst <cc_conf/db/seeds.rb >/var/lib/lxc/crisiscleanup/crisiscleanup/srv/crisiscleanup/db/seeds.rb # TODO bud volat User.create! zvlast nebo vyresit jinak
lxc-execute crisiscleanup -- rake db:schema:load
lxc-execute crisiscleanup -- rake db:seed

View File

@ -3,6 +3,6 @@ production:
encoding: unicode
database: crisiscleanup
pool: 5
host: postgres
host: crisiscleanup-postgres
username: crisiscleanup
password: ${CRISISCLEANUP_PWD}

View File

@ -1,4 +1,4 @@
#!/bin/sh
sed -i "s|\(^ config\.mailer_sender = \).*|\1'${EMAIL}'|" /srv/crisiscleanup/conf/initializers/devise.rb
sed -i "s|\(^ENV['GOOGLE_MAPS_API_KEY'] = \).*|\1${GMAPS_API_KEY}|" /srv/crisiscleanup/conf/boot.rb
sed -i "s|\(^ config\.mailer_sender = \).*|\1'${EMAIL}'|" /srv/crisiscleanup/cc_conf/initializers/devise.rb
sed -i "s|\(^ENV['GOOGLE_MAPS_API_KEY'] = \).*|\1${GMAPS_API_KEY}|" /srv/crisiscleanup/cc_conf/boot.rb

View File

@ -13,7 +13,7 @@
"crisiscleanup-postgres"
],
"mounts": [
["DIR", "/srv/crisiscleanup/crisiscleanup_conf", "/srv/crisiscleanup/config"]
["DIR", "/srv/crisiscleanup/cc_conf", "/srv/crisiscleanup/config"]
]
},
"crisiscleanup-postgres": {

View File

@ -18,7 +18,7 @@ DATABASES = {
'NAME': 'cts',
'USER': 'cts',
'PASSWORD': '${CTS_PWD}',
'HOST': 'postgres',
'HOST': 'cts-postgres',
'PORT': '5432',
}
}

View File

@ -1,3 +1,3 @@
#!/bin/sh
sed -i "s|\(^SERVER_EMAIL = \).*|\1'${EMAIL}'|" /srv/cts/conf/spotter.py
sed -i "s|\(^SERVER_EMAIL = \).*|\1'${EMAIL}'|" /srv/cts/cts_conf/spotter.py

View File

@ -9,7 +9,7 @@
/* ------------------------------ DB Settings ------------------------------ */
$dsn = array('dbtype' => 'pgsql',
'dbhost' => 'postgres', // host
'dbhost' => 'ecogis-postgres', // host
'dbuser' => 'ecogis', // login
'dbpass' => '${ECOGIS_PWD}', // Password
'dbname' => 'ecogis', // database

View File

@ -1,5 +1,5 @@
[database]
uri = postgresql://gnuhealth:${GNUHEALTH_PWD}@postgres
uri = postgresql://gnuhealth:${GNUHEALTH_PWD}@gnuhealth-postgres
path = /srv/gnuhealth/attach
[web]

View File

@ -1,3 +1,3 @@
#!/bin/sh
sed -i "s|\(^from = \).*|\1${EMAIL}|" /srv/gnuhealth/conf/trytond.conf
sed -i "s|\(^from = \).*|\1${EMAIL}|" /srv/gnuhealth/gnuhealth_conf/trytond.conf

View File

@ -68,7 +68,7 @@ define('DB_USERNAME', 'kanboard');
define('DB_PASSWORD', '${KANBOARD_PWD}');
// Mysql/Postgres hostname
define('DB_HOSTNAME', 'postgres');
define('DB_HOSTNAME', 'kanboard-postgres');
// Mysql/Postgres database name
define('DB_NAME', 'kanboard');

View File

@ -1,3 +1,3 @@
#!/bin/sh
sed -i "s|\(^define('MAIL_FROM', \).*|\1'${EMAIL}');|" /srv/kanboard/conf/config.php
sed -i "s|\(^define('MAIL_FROM', \).*|\1'${EMAIL}');|" /srv/kanboard/kanboard_conf/config.php

View File

@ -4,7 +4,7 @@
<Resource type="javax.sql.DataSource" name="jdbc/mifosplatform-tenants"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
driverClassName="org.drizzle.jdbc.DrizzleDriver"
url="jdbc:mysql:thin://mariadb:3306/mifosplatform-tenants"
url="jdbc:mysql:thin://mifosx-mariadb:3306/mifosplatform-tenants"
username="mifosx" password="${MIFOSX_PWD}" initialSize="3" maxActive="10"
maxIdle="6" minIdle="3" validationQuery="SELECT 1"
testOnBorrow="true" testOnReturn="true" testWhileIdle="true"

View File

@ -1,7 +1,7 @@
#!/bin/sh
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\+proxyName=\).*|\1\"mifosx.${DOMAIN}\"|" /srv/mifosx/mifosx_conf/server.xml
sed -i "s|\(^\s\+proxyPort=\).*|\1\"${PORT}\"|" /srv/mifosx/mifosx_conf/server.xml
QUERY="UPDATE \`c_external_service_properties\` SET \`value\` = '${EMAIL}' WHERE \`external_service_id\` = 2 and \`name\` LIKE 'username'"
lxc-attach mariadb -- mysql -e "${QUERY}" mifostenant-default
lxc-attach mifosx-mariadb -- mysql -e "${QUERY}" mifostenant-default

View File

@ -1,6 +1,6 @@
config.source=FILE
jms.broker.url=tcp\://activemq\:61616
jms.broker.url=tcp\://motech-activemq\:61616
jms.cache.producers=false
jms.concurrentConsumers=1
jms.maxConcurrentConsumers=10
@ -19,5 +19,5 @@ org.osgi.framework.storage=/srv/tomcat/.motech/felix-cache
sql.driver=org.postgresql.Driver
sql.password=${MOTECH_PWD}
sql.url=jdbc\:postgresql\://postgres\:5432/
sql.url=jdbc\:postgresql\://motech-postgres\:5432/
sql.user=motech

View File

@ -1,4 +1,4 @@
jmx.host=activemq
jmx.host=motech-activemq
login.mode=repository
server.url=https://motech.spotter.vm
system.language=en

View File

@ -2,4 +2,4 @@
HOST="${DOMAIN}"
[ "${PORT}" != "443" ] && HOST="${DOMAIN}:${PORT}"
sed -i "s|\(^server\.url=\).*|\1https://motech.${HOST}|" /srv/motech/conf/config/motech-settings.properties
sed -i "s|\(^server\.url=\).*|\1https://motech.${HOST}|" /srv/motech/motech_conf/config/motech-settings.properties

View File

@ -1,7 +1,7 @@
[options]
admin_passwd = ${ODOO_ADMIN_PWD}
data_dir = /srv/odoo/data
db_host = postgres
db_host = odoo-postgres
db_name = odoo
db_password = ${ODOO_PWD}
db_user = odoo

View File

@ -1,3 +1,3 @@
#!/bin/sh
sed -i "s|\(^email_from = \).*|\1${EMAIL}|" /srv/odoo/conf/odoo.conf
sed -i "s|\(^email_from = \).*|\1${EMAIL}|" /srv/odoo/odoo_conf/odoo.conf

View File

@ -1,6 +1,6 @@
jdbc.driverClassName=org.postgresql.Driver
jdbc.resourceName=jdbc/odk_aggregate
jdbc.url=jdbc:postgresql://postgres/opendatakit?autoDeserialize=true
jdbc.url=jdbc:postgresql://opendatakit-postgres/opendatakit?autoDeserialize=true
jdbc.username=opendatakit
jdbc.password=${OPENDATAKIT_PWD}
jdbc.schema=public

View File

@ -2,7 +2,7 @@ development:
cookie_secret: ${OPENDATAKITBUILD_COOKIE_SECRET}
cookie_ssl_only: false
database:
host: postgres
host: opendatakit-postgres
database: opendatakitbuild
user: opendatakitbuild
password: ${OPENDATAKITBUILD_PWD}

View File

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

View File

@ -1,6 +1,6 @@
DATABASES = {
'default': {
'HOST': 'postgres',
'HOST': 'pandora-postgres',
'NAME': 'pandora',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'pandora',
@ -9,7 +9,7 @@ DATABASES = {
}
DB_GIN_TRGM = True
BROKER_URL = 'amqp://pandora:${PANDORA_RABBIT_PWD}@rabbitmq:5672//pandora'
BROKER_URL = 'amqp://pandora:${PANDORA_RABBIT_PWD}@pandora-rabbitmq:5672//pandora'
EMAIL_HOST = 'host'

View File

@ -2,6 +2,6 @@
HOST="${DOMAIN}"
[ "${PORT}" != "443" ] && HOST="${DOMAIN}:${PORT}"
sed -i "s|\(^\s\+\"url\": \).*|\1\"pandora.${HOST}\"|" /srv/pandora/conf/config.jsonc
sed -i "s|\(^\s\+\"url\": \).*|\1\"pandora.${HOST}\"|" /srv/pandora/pandora_conf/config.jsonc
sed -i "s|\(^GOOGLE_API_KEY = \).*|\1'${GMAPS_API_KEY}'|" /srv/pandora/conf/local_settings.py
sed -i "s|\(^GOOGLE_API_KEY = \).*|\1'${GMAPS_API_KEY}'|" /srv/pandora/pandora_conf/local_settings.py

View File

@ -30,7 +30,7 @@ settings.base.template = "default"
settings.database.db_type = "postgres"
#settings.database.db_type = "mysql"
# Uncomment to use a different host
settings.database.host = "postgres"
settings.database.host = "sahana-demo-postgres"
# Uncomment to use a different port
#settings.database.port = 3306
#settings.database.port = 5432

View File

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

View File

@ -30,7 +30,7 @@ settings.base.template = "Spotter"
settings.database.db_type = "postgres"
#settings.database.db_type = "mysql"
# Uncomment to use a different host
settings.database.host = "postgres"
settings.database.host = "sahana-postgres"
# Uncomment to use a different port
#settings.database.port = 3306
#settings.database.port = 5432

View File

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

View File

@ -30,7 +30,7 @@ settings.base.template = "SAMBRO"
settings.database.db_type = "postgres"
#settings.database.db_type = "mysql"
# Uncomment to use a different host
settings.database.host = "postgres"
settings.database.host = "sambro-postgres"
# Uncomment to use a different port
#settings.database.port = 3306
#settings.database.port = 5432

View File

@ -2,8 +2,8 @@
HOST="${DOMAIN}"
[ "${PORT}" != "443" ] && HOST="${PORT}:${DOMAIN}"
sed -i "s|\(^settings\.base\.public_url = \).*|\1\"https://sambro.${HOST}\"|" /srv/sambro/conf/000_config.py
sed -i "s|\(^settings\.base\.public_url = \).*|\1\"https://sambro.${HOST}\"|" /srv/sambro/sahana_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\.gis\.api_google = \).*|\1\"${GMAPS_API_KEY}\"|" /srv/sambro/conf/000_config.py
sed -i "s|\(^settings\.mail\.sender = \).*|\1\"${EMAIL}\"|" /srv/sambro/sahana_conf/000_config.py
sed -i "s|\(^settings\.mail\.approver = \).*|\1\"${EMAIL}\"|" /srv/sambro/sahana_conf/000_config.py
sed -i "s|\(^settings\.gis\.api_google = \).*|\1\"${GMAPS_API_KEY}\"|" /srv/sambro/sahana_conf/000_config.py

View File

@ -13,7 +13,7 @@
<connector enable="false" type="AD" host="ldap.example.com" port="389" baseDN="" accountDomainName="example.com" bindDN="" bindPw=""/>
</connectors>
</authentication>
<database dbDriver="pgsql" dbHostname="postgres" dbDatabase="seeddms" dbUser="seeddms" dbPass="${SEEDDMS_PWD}" doNotCheckVersion="false"/>
<database dbDriver="pgsql" dbHostname="seeddms-postgres" dbDatabase="seeddms" dbUser="seeddms" dbPass="${SEEDDMS_PWD}" doNotCheckVersion="false"/>
<smtp smtpServer="host" smtpPort="25" smtpSendFrom="admin@example.com" smtpUser="" smtpPassword=""/>
</system>
<advanced>

View File

@ -1,3 +1,3 @@
#!/bin/sh
sed -i "s|\(^\s\+<smtp smtpServer=\"host\" smtpPort=\"25\" smtpSendFrom=\).*|\1\"${EMAIL}\" smtpUser=\"\" smtpPassword=\"\"/>|" /srv/seeddms/conf/settings.xml
sed -i "s|\(^\s\+<smtp smtpServer=\"host\" smtpPort=\"25\" smtpSendFrom=\).*|\1\"${EMAIL}\" smtpUser=\"\" smtpPassword=\"\"/>|" /srv/seeddms/seeddms_conf/settings.xml

View File

@ -13,7 +13,7 @@
<property name="hibernate.connection.driver_class" value="org.postgresql.Driver" />
<property name="hibernate.connection.username" value="sigmah" />
<property name="hibernate.connection.password" value="${SIGMAH_PWD}" />
<property name="hibernate.connection.url" value="jdbc:postgresql://postgres:5432/sigmah" />
<property name="hibernate.connection.url" value="jdbc:postgresql://sigmah-postgres:5432/sigmah" />
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.format_sql" value="false" />

View File

@ -1,5 +1,5 @@
#!/bin/sh
sed -i "s|\(^mail\.from\.address=\).*|\1${EMAIL}|" /srv/sigmah/conf/sigmah.properties
sed -i "s|\(^mail\.support\.to=\).*|\1${EMAIL}|" /srv/sigmah/conf/sigmah.properties
sed -i "s|\(^maps\.key=\).*|\1${GMAPS_API_KEY}|" /srv/sigmah/conf/sigmah.properties
sed -i "s|\(^mail\.from\.address=\).*|\1${EMAIL}|" /srv/sigmah/sigmah_conf/sigmah.properties
sed -i "s|\(^mail\.support\.to=\).*|\1${EMAIL}|" /srv/sigmah/sigmah_conf/sigmah.properties
sed -i "s|\(^maps\.key=\).*|\1${GMAPS_API_KEY}|" /srv/sigmah/sigmah_conf/sigmah.properties

View File

@ -2,14 +2,14 @@
HOST="${DOMAIN}"
[ "${PORT}" != "443" ] && HOST="${DOMAIN}:${PORT}"
sed -i "s|\(^\s\+\"backend_url\": \).*|\1\"https://ush.${HOST}/platform\",|" /srv/ushahidi/conf/config.json
sed -i "s|\(^\s\+\"backend_url\": \).*|\1\"https://ush.${HOST}/platform\",|" /srv/ushahidi/ushahidi_conf/config.json
API_URL="\"https:\\\/\\\/ush.${HOST}\\\/platform\\\/api\\\/v3\\\/config\\\/data-provider\""
QUERY="UPDATE \`config\` SET \`config_value\` = '${API_URL}' WHERE \`group_name\` LIKE 'data-provider' AND \`config_key\` LIKE 'url'"
lxc-attach mariadb -- mysql -e "${QUERY}" ushahidi
lxc-attach ushahidi-mariadb -- mysql -e "${QUERY}" ushahidi
JSON="{\"incoming_type\":\"IMAP\",\"incoming_server\":\"localhost\",\"incoming_port\":143,\"incoming_security\":\"None\",\"incoming_username\":\"${EMAIL}\",\"incoming_password\":\"password\",\"outgoing_type\":\"SMTP\",\"outgoing_server\":\"host\",\"outgoing_port\":25,\"outgoing_security\":\"None\",\"outgoing_username\":\"${EMAIL}\",\"outgoing_password\":\"password\",\"from\":\"${EMAIL}\",\"from_name\":\"Ushahidi\"}"
QUERY="UPDATE \`config\` SET \`config_value\` = '${JSON}' WHERE \`group_name\` LIKE 'data-provider' AND \`config_key\` LIKE 'email'"
lxc-attach mariadb -- mysql -e "${QUERY}" ushahidi
lxc-attach ushahidi-mariadb -- mysql -e "${QUERY}" ushahidi
QUERY="UPDATE \`config\` SET \`config_value\` = '\"${EMAIL}\"' WHERE \`group_name\` LIKE 'site' AND \`config_key\` LIKE 'email'"
lxc-attach mariadb -- mysql -e "${QUERY}" ushahidi
sed -i "s|\(^\s\+\"google_analytics_id\": \).*|\1\"${GMAPS_API_KEY}\"|" /srv/ushahidi/conf/config.json
lxc-attach ushahidi-mariadb -- mysql -e "${QUERY}" ushahidi
sed -i "s|\(^\s\+\"google_analytics_id\": \).*|\1\"${GMAPS_API_KEY}\"|" /srv/ushahidi/ushahidi_conf/config.json

View File

@ -1,4 +1,4 @@
DB_HOST=mariadb
DB_HOST=ushahidi-mariadb
DB_NAME=ushahidi
DB_USER=ushahidi
DB_PASS=${USHAHIDI_PWD}