From 1e260b59fe023a57850f3ee394691b7efc5507d2 Mon Sep 17 00:00:00 2001 From: Tan Jiang Date: Fri, 30 Mar 2018 14:41:12 +0800 Subject: [PATCH 1/2] Refine the python file to make it run on python3 --- tools/migration/cfg/migrator_1_5_0/__init__.py | 4 ++-- tools/migration/cfg/utils.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/migration/cfg/migrator_1_5_0/__init__.py b/tools/migration/cfg/migrator_1_5_0/__init__.py index a239df0a1..bead0a172 100644 --- a/tools/migration/cfg/migrator_1_5_0/__init__.py +++ b/tools/migration/cfg/migrator_1_5_0/__init__.py @@ -26,12 +26,12 @@ default = { def migrate(input_cfg, output_cfg): d = utils.read_conf(input_cfg) - keys = default.keys() + keys = list(default.keys()) keys.extend(['hostname', 'ui_url_protocol', 'max_job_workers', 'customize_crt', 'ssl_cert', 'ssl_cert_key', 'secretkey_path', 'admiral_url', 'db_password', 'clair_db_password']) val = {} for k in keys: - if d.has_key(k): + if k in d: val[k] = d[k] else: val[k] = default[k] diff --git a/tools/migration/cfg/utils.py b/tools/migration/cfg/utils.py index 5996012c5..34ed654d3 100644 --- a/tools/migration/cfg/utils.py +++ b/tools/migration/cfg/utils.py @@ -29,13 +29,13 @@ def read_conf(path): def get_conf_version(path): d = read_conf(path) # print json.dumps(d,indent=4) - if d.has_key("_version"): # >=1.5.0 + if "_version" in d: # >=1.5.0 return d["_version"] - if not d.has_key("clair_db_password"): + if not "clair_db_password" in d: return "unsupported" - if d.has_key("registry_storage_provider_name"): + if "registry_storage_provider_name" in d: return "1.4.0" - if d.has_key("uaa_endpoint"): + if "uaa_endpoint" in d: return "1.3.0" return "1.2.0" From 8b9a67fe1ed7a0e02e3271c9b765b3c5caed2bda Mon Sep 17 00:00:00 2001 From: Tan Jiang Date: Mon, 2 Apr 2018 12:56:21 +0800 Subject: [PATCH 2/2] Update harbor.cfg template to contain latest change --- .../cfg/migrator_1_5_0/harbor.cfg.tpl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/migration/cfg/migrator_1_5_0/harbor.cfg.tpl b/tools/migration/cfg/migrator_1_5_0/harbor.cfg.tpl index 1a0be1b53..ed98655bd 100644 --- a/tools/migration/cfg/migrator_1_5_0/harbor.cfg.tpl +++ b/tools/migration/cfg/migrator_1_5_0/harbor.cfg.tpl @@ -36,6 +36,12 @@ log_rotate_count = $log_rotate_count #are all valid. log_rotate_size = $log_rotate_size +#Config http proxy for Clair, e.g. http://my.proxy.com:3128 +#Clair doesn't need to connect to harbor ui container via http proxy. +http_proxy = +https_proxy = +no_proxy = 127.0.0.1,localhost,ui + #NOTES: The properties between BEGIN INITIAL PROPERTIES and END INITIAL PROPERTIES #only take effect in the first boot, the subsequent changes of these properties #should be performed on web ui @@ -93,6 +99,18 @@ ldap_timeout = 5 #Verify certificate from LDAP server ldap_verify_cert = true +#The base dn from which to lookup a group in LDAP/AD +ldap_group_basedn = ou=group,dc=mydomain,dc=com + +#filter to search LDAP/AD group +ldap_group_filter = objectclass=group + +#The attribute used to name a LDAP/AD group, it could be cn, name +ldap_group_gid = cn + +#The scope to search for ldap groups. 0-LDAP_SCOPE_BASE, 1-LDAP_SCOPE_ONELEVEL, 2-LDAP_SCOPE_SUBTREE +ldap_group_scope = 2 + #Turn on or off the self-registration feature self_registration = on