Make Harbor database configurable

This commit is contained in:
yixingj 2017-09-22 10:46:02 +08:00
parent be0b31e5ba
commit fb690a972f
3 changed files with 18 additions and 3 deletions

View File

@ -11,9 +11,9 @@ LDAP_UID=$ldap_uid
LDAP_SCOPE=$ldap_scope
LDAP_TIMEOUT=$ldap_timeout
DATABASE_TYPE=mysql
MYSQL_HOST=mysql
MYSQL_PORT=3306
MYSQL_USR=root
MYSQL_HOST=$db_host
MYSQL_PORT=$db_port
MYSQL_USR=$db_user
MYSQL_PWD=$db_password
MYSQL_DATABASE=registry
REGISTRY_URL=http://registry:5000

View File

@ -11,6 +11,15 @@ ui_url_protocol = http
#The password for the root user of mysql db, change this before any production use.
db_password = root123
#the address of the mysql database. Don't change in standalone model
db_host = mysql
#The port of mysql database host
db_port = 3306
#The user name of mysql database
db_user = root
#Maximum number of job workers in job service
max_job_workers = 3

View File

@ -139,6 +139,9 @@ ldap_uid = rcp.get("configuration", "ldap_uid")
ldap_scope = rcp.get("configuration", "ldap_scope")
ldap_timeout = rcp.get("configuration", "ldap_timeout")
db_password = rcp.get("configuration", "db_password")
db_host = rcp.get("configuration", "db_host")
db_port = rcp.get("configuration", "db_port")
db_user = rcp.get("configuration", "db_user")
self_registration = rcp.get("configuration", "self_registration")
if protocol == "https":
cert_path = rcp.get("configuration", "ssl_cert")
@ -210,6 +213,9 @@ render(os.path.join(templates_dir, "adminserver", "env"),
ldap_scope=ldap_scope,
ldap_timeout=ldap_timeout,
db_password=db_password,
db_host=db_host,
db_port=db_port,
db_user=db_user,
email_host=email_host,
email_port=email_port,
email_usr=email_usr,