From 50e4ef033018e47e4f933efc1f2d1b59669b14fb Mon Sep 17 00:00:00 2001 From: Disassembler Date: Thu, 2 Aug 2018 11:15:15 +0200 Subject: [PATCH] Typo and logical fixes in basic installation --- basic.sh | 4 +++- basic/srv/spotter/appmgr/__init__.py | 3 ++- basic/srv/spotter/appmgr/confupdater.py | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/basic.sh b/basic.sh index 91504c5..18ca660 100755 --- a/basic.sh +++ b/basic.sh @@ -40,6 +40,7 @@ wget https://raw.githubusercontent.com/Neilpang/acme.sh/master/acme.sh -O /usr/b sed -i 's|$HOME/.$PROJECT_NAME|/etc/acme.sh.d|' /usr/bin/acme.sh # Copy Spotter resources +cp ${SOURCE_DIR}/etc/init.d/spotter-appmgr /etc/init.d/spotter-appmgr cp -r ${SOURCE_DIR}/srv/spotter /srv/spotter ln -s /srv/spotter/cli.py /usr/bin/spotter-appmgr @@ -58,4 +59,5 @@ service docker start docker build -t alpine ${SOURCE_DIR} # Set dummy host and generate related files -spotter-appmgr update-host spotter.vm 443 +# Note: This will fail with an exception due to nonexistant application files. The exception can be ignored +spotter-appmgr update-host spotter.vm 443 || true diff --git a/basic/srv/spotter/appmgr/__init__.py b/basic/srv/spotter/appmgr/__init__.py index 7170f76..d8956a4 100644 --- a/basic/srv/spotter/appmgr/__init__.py +++ b/basic/srv/spotter/appmgr/__init__.py @@ -271,7 +271,8 @@ class AppMgr: def update_apps_urls(self): # Update configuration for respective applications - confupdater.update_url() + host = self.domain if self.port != '443' else '{}:{}'.format(self.domain, self.port) + confupdater.update_url(host) # Restart currently running apps in order to update config and re-register nginx proxy for app in self.conf['apps']: if tools.is_service_started(app): diff --git a/basic/srv/spotter/appmgr/confupdater.py b/basic/srv/spotter/appmgr/confupdater.py index 5683eda..6a7eef3 100644 --- a/basic/srv/spotter/appmgr/confupdater.py +++ b/basic/srv/spotter/appmgr/confupdater.py @@ -54,11 +54,11 @@ def update_gmaps_api_key(api_key): def update_email(email): # CKAN replace_file_line('/srv/ckan/conf/ckan.ini', 'smtp.mail_from = ', email) - replace_file_line('/srv/ckan-datapusher/conf/datapusher_settings.py', 'FROM_EMAIL = ', '\'{}\''.format(email) + replace_file_line('/srv/ckan-datapusher/conf/datapusher_settings.py', 'FROM_EMAIL = ', '\'{}\''.format(email)) # Crisis Cleanup - replace_file_line('/srv/crisiscleanup/conf/initializers/devise.rb', ' config.mailer_sender = ', '\'{}\''.format(email) + replace_file_line('/srv/crisiscleanup/conf/initializers/devise.rb', ' config.mailer_sender = ', '\'{}\''.format(email)) # CTS - replace_file_line('/srv/cts/conf/spotter.py', 'SERVER_EMAIL = ', '\'{}\''.format(email) + replace_file_line('/srv/cts/conf/spotter.py', 'SERVER_EMAIL = ', '\'{}\''.format(email)) # GNU Health replace_file_line('/srv/gnuhealth/conf/trytond.conf', 'from = ', email) # KanBoard