Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support registry http.relativeurls in harbor.yml #20339

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions make/harbor.yml.tmpl
Expand Up @@ -41,6 +41,10 @@ https:
# And when it enabled the hostname will no longer used
# external_url: https://reg.mydomain.com:8433

# Uncomment relativeurls if you want to return relative URLs in Location headers
# And when it enabled the client is responsible for resolving the correct URL
# relativeurls: true

# The initial password of Harbor admin
# It only works in first time to install harbor
# Remember Change the admin password from UI after launching Harbor.
Expand Down
3 changes: 3 additions & 0 deletions make/photon/prepare/templates/registry/config.yml.jinja
Expand Up @@ -45,6 +45,9 @@ redis:
maxactive: 500
idletimeout: 60s
http:
{% if relativeurls %}
relativeurls: true
{% endif %}
{% if internal_tls.enabled %}
addr: :5443
tls:
Expand Down
6 changes: 6 additions & 0 deletions make/photon/prepare/utils/configs.py
Expand Up @@ -144,6 +144,12 @@ def parse_yaml_config(config_file_path, with_trivy):
else:
config_dict['public_url'] = '{protocol}://{hostname}:{http_port}'.format(**config_dict)

# relativeurls config
if configs.get('relativeurls'):
config_dict['relativeurls'] = configs.get('relativeurls')
else:
config_dict['relativeurls'] = False

# DB configs
db_configs = configs.get('database')
if db_configs:
Expand Down