diff --git a/basic/srv/vm/mgr/tools.py b/basic/srv/vm/mgr/tools.py index d697fb2..1c0e4fd 100644 --- a/basic/srv/vm/mgr/tools.py +++ b/basic/srv/vm/mgr/tools.py @@ -15,8 +15,7 @@ from cryptography.x509.oid import NameOID def compile_url(domain, port, proto='https'): port = '' if (proto == 'https' and port == '443') or (proto == 'http' and port == '80') else ':{}'.format(port) - host = '{}{}'.format(domain, port) - return '{}://{}'.format(proto, host) if proto is not None else host + return '{}://{}{}'.format(proto, domain, port) def get_local_ipv4(): # Return first routable IPv4 address of the VM (container host) diff --git a/basic/srv/vm/mgr/wsgiapp.py b/basic/srv/vm/mgr/wsgiapp.py index 6480868..f39fca1 100644 --- a/basic/srv/vm/mgr/wsgiapp.py +++ b/basic/srv/vm/mgr/wsgiapp.py @@ -131,7 +131,7 @@ class WSGIApp(object): self.conf.save() # Redirect to host setup view return redirect('/setup-host') - host = tools.compile_url(self.conf['host']['domain'], self.conf['host']['port'], None) + host = tools.compile_url(self.conf['host']['domain'], self.conf['host']['port'])[8:] if request.session['admin']: return self.render_template('portal-admin.html', request, host=host) return self.render_template('portal-user.html', request, host=host)