Fix: beego app config port hardcode

the port should be flexible depend on the internal tls

Signed-off-by: DQ <dengq@vmware.com>
This commit is contained in:
DQ 2020-07-21 10:00:03 +08:00
parent a11c2f32da
commit d7618a6274
3 changed files with 12 additions and 5 deletions

View File

@ -1,6 +1,10 @@
appname = Harbor
runmode = dev
runmode = prod
enablegzip = true
[dev]
httpport = 8080
[prod]
{% if internal_tls.enabled %}
httpport = {{8443}}
{% else %}
httpport = {{8080}}
{% endif %}

View File

@ -5,7 +5,6 @@ SYNC_QUOTA=true
CHART_CACHE_DRIVER={{chart_cache_driver}}
_REDIS_URL_REG={{redis_url_reg}}
PORT=8080
LOG_LEVEL={{log_level}}
EXT_ENDPOINT={{public_url}}
DATABASE_TYPE=postgresql
@ -48,8 +47,11 @@ HTTPS_PROXY={{core_https_proxy}}
NO_PROXY={{core_no_proxy}}
{%if internal_tls.enabled %}
PORT=8443
INTERNAL_TLS_ENABLED=true
INTERNAL_TLS_KEY_PATH=/etc/harbor/ssl/core.key
INTERNAL_TLS_CERT_PATH=/etc/harbor/ssl/core.crt
INTERNAL_TLS_TRUST_CA_PATH=/harbor_cust_cert/harbor_internal_ca.crt
{% else %}
PORT=8080
{% endif %}

View File

@ -39,7 +39,8 @@ def prepare_core(config_dict, with_notary, with_clair, with_trivy, with_chartmus
core_conf_template_path,
core_conf,
uid=DEFAULT_UID,
gid=DEFAULT_GID)
gid=DEFAULT_GID,
**config_dict)
def copy_core_config(core_templates_path, core_config_path):