Fix URL compilation for AppMgr confupdate which expects only host

This commit is contained in:
Disassembler 2018-09-02 22:09:54 +02:00
parent 765f34f3f4
commit ae70b53074
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
2 changed files with 3 additions and 2 deletions

View File

@ -256,7 +256,7 @@ class AppMgr:
def update_apps_urls(self):
# Update configuration for respective applications
confupdater.update_url(tools.compile_url(self.domain, self.port))
confupdater.update_url(tools.compile_url(self.domain, self.port, None))
# 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):

View File

@ -13,7 +13,8 @@ NULL_IP = '[100::1]'
def compile_url(domain, port, proto='https'):
port = ':{}'.format(port) if (proto == 'https' and port != '443') or (proto == 'http' and port != '80') else ''
return '{}://{}{}'.format(proto, domain, port)
host = '{}{}'.format(domain, port)
return '{}://{}'.format(proto, host) if proto is not None else host
def get_container_ip(app):
# Return an IP address of a container. If the container is not running, return address from IPv6 discard prefix instead