From cf9982638632a84057f54b9a1a0044f4a08a8d52 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Sat, 5 Oct 2019 16:34:10 +0200 Subject: [PATCH] Fix hostnames --- lxc-apps/crisiscleanup/install.sh | 16 ++++++++-------- .../{crisiscleanup_conf => cc_conf}/conf/boot.rb | 0 .../conf/database.yml | 2 +- .../conf/environments/production.rb | 0 .../conf/initializers/devise.rb | 0 .../{crisiscleanup_conf => cc_conf}/db/seeds.rb | 0 lxc-apps/crisiscleanup/install/update-conf.sh | 4 ++-- lxc-apps/crisiscleanup/meta | 2 +- lxc-apps/cts/install/cts_conf/spotter.py | 2 +- lxc-apps/cts/install/update-conf.sh | 2 +- lxc-apps/ecogis/install/ecogis_conf/config.php | 2 +- .../install/gnuhealth_conf/trytond.conf | 2 +- lxc-apps/gnuhealth/install/update-conf.sh | 2 +- .../kanboard/install/kanboard_conf/config.php | 2 +- lxc-apps/kanboard/install/update-conf.sh | 2 +- lxc-apps/mifosx/install/mifosx_conf/context.xml | 2 +- lxc-apps/mifosx/install/update-conf.sh | 6 +++--- .../motech_conf/config/bootstrap.properties | 4 ++-- .../config/motech-settings.properties | 2 +- lxc-apps/motech/install/update-conf.sh | 2 +- lxc-apps/odoo/install/odoo_conf/odoo.conf | 2 +- lxc-apps/odoo/install/update-conf.sh | 2 +- .../opendatakit/install/odk_conf/jdbc.properties | 2 +- .../opendatakit/install/odkbuild_conf/config.yml | 2 +- lxc-apps/opendatakit/install/update-conf.sh | 6 +++--- .../install/pandora_conf/local_settings.py | 4 ++-- lxc-apps/pandora/install/update-conf.sh | 4 ++-- .../install/sahana_conf/000_config.py | 2 +- lxc-apps/sahana-demo/install/update-conf.sh | 8 ++++---- .../sahana/install/sahana_conf/000_config.py | 2 +- lxc-apps/sahana/install/update-conf.sh | 8 ++++---- .../sambro/install/sahana_conf/000_config.py | 2 +- lxc-apps/sambro/install/update-conf.sh | 8 ++++---- .../seeddms/install/seeddms_conf/settings.xml | 2 +- lxc-apps/seeddms/install/update-conf.sh | 2 +- .../sigmah/install/sigmah_conf/persistence.xml | 2 +- lxc-apps/sigmah/install/update-conf.sh | 6 +++--- lxc-apps/ushahidi/install/update-conf.sh | 10 +++++----- lxc-apps/ushahidi/install/ushahidi_conf/env | 2 +- 39 files changed, 65 insertions(+), 65 deletions(-) rename lxc-apps/crisiscleanup/install/{crisiscleanup_conf => cc_conf}/conf/boot.rb (100%) rename lxc-apps/crisiscleanup/install/{crisiscleanup_conf => cc_conf}/conf/database.yml (82%) rename lxc-apps/crisiscleanup/install/{crisiscleanup_conf => cc_conf}/conf/environments/production.rb (100%) rename lxc-apps/crisiscleanup/install/{crisiscleanup_conf => cc_conf}/conf/initializers/devise.rb (100%) rename lxc-apps/crisiscleanup/install/{crisiscleanup_conf => cc_conf}/db/seeds.rb (100%) diff --git a/lxc-apps/crisiscleanup/install.sh b/lxc-apps/crisiscleanup/install.sh index 99c1b3d..aa6d6b4 100755 --- a/lxc-apps/crisiscleanup/install.sh +++ b/lxc-apps/crisiscleanup/install.sh @@ -19,21 +19,21 @@ service crisiscleanup-postgres start envsubst /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 /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 /var/lib/lxc/crisiscleanup/crisiscleanup/srv/crisiscleanup/db/seeds.rb # TODO bud volat User.create! zvlast nebo vyresit jinak +#envsubst /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 diff --git a/lxc-apps/crisiscleanup/install/crisiscleanup_conf/conf/boot.rb b/lxc-apps/crisiscleanup/install/cc_conf/conf/boot.rb similarity index 100% rename from lxc-apps/crisiscleanup/install/crisiscleanup_conf/conf/boot.rb rename to lxc-apps/crisiscleanup/install/cc_conf/conf/boot.rb diff --git a/lxc-apps/crisiscleanup/install/crisiscleanup_conf/conf/database.yml b/lxc-apps/crisiscleanup/install/cc_conf/conf/database.yml similarity index 82% rename from lxc-apps/crisiscleanup/install/crisiscleanup_conf/conf/database.yml rename to lxc-apps/crisiscleanup/install/cc_conf/conf/database.yml index da8b643..436acf9 100644 --- a/lxc-apps/crisiscleanup/install/crisiscleanup_conf/conf/database.yml +++ b/lxc-apps/crisiscleanup/install/cc_conf/conf/database.yml @@ -3,6 +3,6 @@ production: encoding: unicode database: crisiscleanup pool: 5 - host: postgres + host: crisiscleanup-postgres username: crisiscleanup password: ${CRISISCLEANUP_PWD} diff --git a/lxc-apps/crisiscleanup/install/crisiscleanup_conf/conf/environments/production.rb b/lxc-apps/crisiscleanup/install/cc_conf/conf/environments/production.rb similarity index 100% rename from lxc-apps/crisiscleanup/install/crisiscleanup_conf/conf/environments/production.rb rename to lxc-apps/crisiscleanup/install/cc_conf/conf/environments/production.rb diff --git a/lxc-apps/crisiscleanup/install/crisiscleanup_conf/conf/initializers/devise.rb b/lxc-apps/crisiscleanup/install/cc_conf/conf/initializers/devise.rb similarity index 100% rename from lxc-apps/crisiscleanup/install/crisiscleanup_conf/conf/initializers/devise.rb rename to lxc-apps/crisiscleanup/install/cc_conf/conf/initializers/devise.rb diff --git a/lxc-apps/crisiscleanup/install/crisiscleanup_conf/db/seeds.rb b/lxc-apps/crisiscleanup/install/cc_conf/db/seeds.rb similarity index 100% rename from lxc-apps/crisiscleanup/install/crisiscleanup_conf/db/seeds.rb rename to lxc-apps/crisiscleanup/install/cc_conf/db/seeds.rb diff --git a/lxc-apps/crisiscleanup/install/update-conf.sh b/lxc-apps/crisiscleanup/install/update-conf.sh index 744fc35..660c050 100644 --- a/lxc-apps/crisiscleanup/install/update-conf.sh +++ b/lxc-apps/crisiscleanup/install/update-conf.sh @@ -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 diff --git a/lxc-apps/crisiscleanup/meta b/lxc-apps/crisiscleanup/meta index 97f4d11..ef5618f 100644 --- a/lxc-apps/crisiscleanup/meta +++ b/lxc-apps/crisiscleanup/meta @@ -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": { diff --git a/lxc-apps/cts/install/cts_conf/spotter.py b/lxc-apps/cts/install/cts_conf/spotter.py index b0ff6ca..b255909 100644 --- a/lxc-apps/cts/install/cts_conf/spotter.py +++ b/lxc-apps/cts/install/cts_conf/spotter.py @@ -18,7 +18,7 @@ DATABASES = { 'NAME': 'cts', 'USER': 'cts', 'PASSWORD': '${CTS_PWD}', - 'HOST': 'postgres', + 'HOST': 'cts-postgres', 'PORT': '5432', } } diff --git a/lxc-apps/cts/install/update-conf.sh b/lxc-apps/cts/install/update-conf.sh index 9cea8da..cfb76d0 100644 --- a/lxc-apps/cts/install/update-conf.sh +++ b/lxc-apps/cts/install/update-conf.sh @@ -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 diff --git a/lxc-apps/ecogis/install/ecogis_conf/config.php b/lxc-apps/ecogis/install/ecogis_conf/config.php index 687ed7d..1b4ce19 100644 --- a/lxc-apps/ecogis/install/ecogis_conf/config.php +++ b/lxc-apps/ecogis/install/ecogis_conf/config.php @@ -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 diff --git a/lxc-apps/gnuhealth/install/gnuhealth_conf/trytond.conf b/lxc-apps/gnuhealth/install/gnuhealth_conf/trytond.conf index 83353b0..1ea995a 100644 --- a/lxc-apps/gnuhealth/install/gnuhealth_conf/trytond.conf +++ b/lxc-apps/gnuhealth/install/gnuhealth_conf/trytond.conf @@ -1,5 +1,5 @@ [database] -uri = postgresql://gnuhealth:${GNUHEALTH_PWD}@postgres +uri = postgresql://gnuhealth:${GNUHEALTH_PWD}@gnuhealth-postgres path = /srv/gnuhealth/attach [web] diff --git a/lxc-apps/gnuhealth/install/update-conf.sh b/lxc-apps/gnuhealth/install/update-conf.sh index 57e4043..8fedb18 100644 --- a/lxc-apps/gnuhealth/install/update-conf.sh +++ b/lxc-apps/gnuhealth/install/update-conf.sh @@ -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 diff --git a/lxc-apps/kanboard/install/kanboard_conf/config.php b/lxc-apps/kanboard/install/kanboard_conf/config.php index 290c835..214b901 100644 --- a/lxc-apps/kanboard/install/kanboard_conf/config.php +++ b/lxc-apps/kanboard/install/kanboard_conf/config.php @@ -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'); diff --git a/lxc-apps/kanboard/install/update-conf.sh b/lxc-apps/kanboard/install/update-conf.sh index 4b8d77b..aedf93a 100644 --- a/lxc-apps/kanboard/install/update-conf.sh +++ b/lxc-apps/kanboard/install/update-conf.sh @@ -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 diff --git a/lxc-apps/mifosx/install/mifosx_conf/context.xml b/lxc-apps/mifosx/install/mifosx_conf/context.xml index f1eb457..01e7b94 100644 --- a/lxc-apps/mifosx/install/mifosx_conf/context.xml +++ b/lxc-apps/mifosx/install/mifosx_conf/context.xml @@ -4,7 +4,7 @@ - + diff --git a/lxc-apps/seeddms/install/update-conf.sh b/lxc-apps/seeddms/install/update-conf.sh index f5f590f..c0651f1 100644 --- a/lxc-apps/seeddms/install/update-conf.sh +++ b/lxc-apps/seeddms/install/update-conf.sh @@ -1,3 +1,3 @@ #!/bin/sh -sed -i "s|\(^\s\+|" /srv/seeddms/conf/settings.xml +sed -i "s|\(^\s\+|" /srv/seeddms/seeddms_conf/settings.xml diff --git a/lxc-apps/sigmah/install/sigmah_conf/persistence.xml b/lxc-apps/sigmah/install/sigmah_conf/persistence.xml index 8144a8a..575ff0f 100644 --- a/lxc-apps/sigmah/install/sigmah_conf/persistence.xml +++ b/lxc-apps/sigmah/install/sigmah_conf/persistence.xml @@ -13,7 +13,7 @@ - + diff --git a/lxc-apps/sigmah/install/update-conf.sh b/lxc-apps/sigmah/install/update-conf.sh index 44561f2..ac29218 100644 --- a/lxc-apps/sigmah/install/update-conf.sh +++ b/lxc-apps/sigmah/install/update-conf.sh @@ -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 diff --git a/lxc-apps/ushahidi/install/update-conf.sh b/lxc-apps/ushahidi/install/update-conf.sh index 335c7ba..17eecf6 100644 --- a/lxc-apps/ushahidi/install/update-conf.sh +++ b/lxc-apps/ushahidi/install/update-conf.sh @@ -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 diff --git a/lxc-apps/ushahidi/install/ushahidi_conf/env b/lxc-apps/ushahidi/install/ushahidi_conf/env index 42aa855..8b09956 100644 --- a/lxc-apps/ushahidi/install/ushahidi_conf/env +++ b/lxc-apps/ushahidi/install/ushahidi_conf/env @@ -1,4 +1,4 @@ -DB_HOST=mariadb +DB_HOST=ushahidi-mariadb DB_NAME=ushahidi DB_USER=ushahidi DB_PASS=${USHAHIDI_PWD}