mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-22 06:41:36 +01:00
Fix public url shoud not display port is it's default value (#7760)
if https port is 443 or http port is 80, then only showing url Signed-off-by: Qian Deng <dengq@vmware.com>
This commit is contained in:
parent
7ee9063c2b
commit
439b44c61f
@ -83,9 +83,15 @@ def parse_yaml_config(config_file_path):
|
||||
config_dict['public_url'] = configs.get('external_url')
|
||||
else:
|
||||
if config_dict['protocol'] == 'https':
|
||||
config_dict['public_url'] = '{protocol}://{hostname}:{https_port}'.format(**config_dict)
|
||||
if config_dict['https_port'] == 443:
|
||||
config_dict['public_url'] = '{protocol}://{hostname}'.format(**config_dict)
|
||||
else:
|
||||
config_dict['public_url'] = '{protocol}://{hostname}:{https_port}'.format(**config_dict)
|
||||
else:
|
||||
config_dict['public_url'] = '{protocol}://{hostname}:{http_port}'.format(**config_dict)
|
||||
if config_dict['http_port'] == 80:
|
||||
config_dict['public_url'] = '{protocol}://{hostname}'.format(**config_dict)
|
||||
else:
|
||||
config_dict['public_url'] = '{protocol}://{hostname}:{http_port}'.format(**config_dict)
|
||||
|
||||
# DB configs
|
||||
db_configs = configs.get('database')
|
||||
|
Loading…
Reference in New Issue
Block a user