Integrate forgotten update-url.sh
This commit is contained in:
parent
b0fe54d034
commit
fc99f7f6ab
@ -288,7 +288,7 @@ class VMMgr:
|
|||||||
|
|
||||||
def update_apps_urls(self):
|
def update_apps_urls(self):
|
||||||
# Update configuration for respective applications
|
# Update configuration for respective applications
|
||||||
confupdater.update_url(tools.compile_url(self.domain, self.port, None))
|
confupdater.update_url(self.domain, self.port)
|
||||||
# Restart currently running apps in order to update config and re-register nginx proxy
|
# Restart currently running apps in order to update config and re-register nginx proxy
|
||||||
for app in self.conf['apps']:
|
for app in self.conf['apps']:
|
||||||
if tools.is_service_started(app):
|
if tools.is_service_started(app):
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# TODO: Rewrite back to individual files
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
@ -111,13 +113,23 @@ def update_email(email):
|
|||||||
query = 'UPDATE `config` SET `config_value` = "\\"{}\\"" WHERE `group_name` LIKE "site" AND `config_key` LIKE "email";'.format(email)
|
query = 'UPDATE `config` SET `config_value` = "\\"{}\\"" WHERE `group_name` LIKE "site" AND `config_key` LIKE "email";'.format(email)
|
||||||
run_mysql_query(query, 'ushahidi')
|
run_mysql_query(query, 'ushahidi')
|
||||||
|
|
||||||
def update_url(host):
|
def update_url(domain, port):
|
||||||
|
host = tools.compile_url(domain, port, None)
|
||||||
# CKAN
|
# CKAN
|
||||||
if app_exists('ckan'):
|
if app_exists('ckan'):
|
||||||
replace_file_line('/srv/ckan/conf/ckan.ini', 'ckan.site_url = ', 'https://ckan.{}'.format(host))
|
replace_file_line('/srv/ckan/conf/ckan.ini', 'ckan.site_url = ', 'https://ckan.{}'.format(host))
|
||||||
|
# Mifos X
|
||||||
|
if app_exists('mifosx'):
|
||||||
|
replace_file_line('/srv/mifosx/conf/server.xml', ' proxyName=', '"{}"'.format(domain))
|
||||||
|
replace_file_line('/srv/mifosx/conf/server.xml', ' proxyPort=', '"{}"'.format(port))
|
||||||
# Motech
|
# Motech
|
||||||
if app_exists('motech'):
|
if app_exists('motech'):
|
||||||
replace_file_line('/srv/motech/conf/config/motech-settings.properties', 'server.url=', 'https://motech.{}'.format(host))
|
replace_file_line('/srv/motech/conf/config/motech-settings.properties', 'server.url=', 'https://motech.{}'.format(host))
|
||||||
|
# OpenDataKit
|
||||||
|
if app_exists('opendatakit'):
|
||||||
|
replace_file_line('/srv/opendatakit/conf/server.xml', ' proxyName=', '"{}"'.format(domain))
|
||||||
|
replace_file_line('/srv/opendatakit/conf/server.xml', ' proxyPort=', '"{}"'.format(port))
|
||||||
|
replace_file_line('/srv/opendatakit/conf/security.properties', 'security.server.securePort=', port)
|
||||||
# Pan.do/ra
|
# Pan.do/ra
|
||||||
if app_exists('pandora'):
|
if app_exists('pandora'):
|
||||||
replace_file_line('/srv/pandora/conf/config.jsonc', ' "url": ', '"pandora.{}"'.format(host))
|
replace_file_line('/srv/pandora/conf/config.jsonc', ' "url": ', '"pandora.{}"'.format(host))
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
sed -i "s|\(^\s\+proxyName\).*|\1=\"${1}\"|g" /srv/mifosx/conf/server.xml
|
|
||||||
sed -i "s|\(^\s\+proxyPort\).*|\1=\"${2}\"|g" /srv/mifosx/conf/server.xml
|
|
@ -1,5 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
sed -i "s|\(^\s\+proxyName\).*|\1=\"${1}\"|g" /srv/opendatakit/conf/server.xml
|
|
||||||
sed -i "s|\(^\s\+proxyPort\).*|\1=\"${2}\"|g" /srv/opendatakit/conf/server.xml
|
|
||||||
sed -i "s|^security\.server\.securePort.*|security.server.securePort=${2}|" /srv/opendatakit/conf/security.properties
|
|
Loading…
Reference in New Issue
Block a user