Skip to content

Commit 982fedb

Browse files
committed
fix for missing hostnames setting (fix #41)
1 parent a60834a commit 982fedb

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/ansibleguy-webui/aw/config/environment.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
from aw.config.hardcoded import ENV_KEY_CONFIG, ENV_KEY_SAML
66

77
AW_ENV_VARS = {
8+
'hostnames': ['AW_HOSTNAMES'],
89
'port': ['AW_PORT'],
10+
'proxy': ['AW_PROXY'],
911
'address': ['AW_LISTEN', 'AW_LISTEN_ADDRESS'],
1012
'timezone': ['AW_TIMEZONE'],
1113
'secret': ['AW_SECRET'],

src/ansibleguy-webui/aw/config/form_metadata.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@
8282
# env-vars
8383
'timezone': 'Timezone',
8484
'db': 'Database',
85+
'hostnames': 'Hostnames',
86+
'proxy': 'Using Proxy',
8587
'db_migrate': 'Database auto-upgrade',
8688
'serve_static': 'Serving static files',
8789
'deployment': 'Deployment',
@@ -224,7 +226,7 @@
224226
'mail_ssl_verify': 'En- or disable SSL certificate verification. '
225227
'If enabled - the certificate SAN has to contain the mail-server FQDN '
226228
'and must be issued from a trusted CA',
227-
'mail_sender': 'Mail Sender Address to use for Alert Mails',
229+
'mail_sender': 'Mail Sender Address to use for Alert Mails. Fallback is mail-user',
228230
'mail_transport': 'The default port mapping is: 25 = Unencrypted, 465 = SSL, 587 = StartTLS',
229231
}
230232
}

src/ansibleguy-webui/aw/settings.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
from aw.config.hardcoded import LOGIN_PATH, ENV_KEY_CONFIG, ENV_KEY_SAML
20-
from aw.config.defaults import CONFIG_DEFAULTS
20+
from aw.config.defaults import CONFIG_DEFAULTS, inside_docker
2121
from aw.utils.deployment import deployment_dev, deployment_prod
2222
from aw.config.environment import get_aw_env_var_or_default, auth_mode_saml
2323
from aw.utils.debug import log
@@ -157,7 +157,8 @@ def get_main_web_address() -> str:
157157
return f'http://localhost:{PORT_WEB}'
158158

159159
_hostname = environ['AW_HOSTNAMES'].split(',', 1)[0]
160-
if 'AW_PROXY' in environ: # we will not know what port the proxy is serving this service.. assume its 443
160+
if 'AW_PROXY' in environ or inside_docker():
161+
# we will not know what port the proxy is serving this service - assume its 443
161162
return f'https://{_hostname}'
162163

163164
return f'https://{_hostname}:{PORT_WEB}'

0 commit comments

Comments
 (0)