From 8eb7016c5dfe7470400c86eb3cb41e16d777deab Mon Sep 17 00:00:00 2001 From: Steve Fan <29133953+stevefan1999-personal@users.noreply.github.com> Date: Fri, 5 Jul 2019 23:05:54 +0800 Subject: [PATCH 1/4] Update bootstrap.py --- scripts/bootstrap.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/bootstrap.py b/scripts/bootstrap.py index 5e73d6fb..08181b58 100755 --- a/scripts/bootstrap.py +++ b/scripts/bootstrap.py @@ -121,6 +121,7 @@ def init_seafile_server(): 'MYSQL_USER_PASSWD': str(uuid.uuid4()), 'MYSQL_USER_HOST': '%.%.%.%', 'MYSQL_HOST': get_conf('DB_HOST','127.0.0.1'), + 'MYSQL_PORT': get_conf('DB_PORT','3306'), # Default MariaDB root user has empty password and can only connect from localhost. 'MYSQL_ROOT_PASSWD': get_conf('DB_ROOT_PASSWD', ''), } From 4343dfc946f70f0c37a4e478d4330852ad13a875 Mon Sep 17 00:00:00 2001 From: Steve Fan <29133953+stevefan1999-personal@users.noreply.github.com> Date: Fri, 5 Jul 2019 23:17:44 +0800 Subject: [PATCH 2/4] Update __init__.py --- scripts/utils/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/utils/__init__.py b/scripts/utils/__init__.py index 819d7388..235329c0 100644 --- a/scripts/utils/__init__.py +++ b/scripts/utils/__init__.py @@ -267,12 +267,13 @@ def update_version_stamp(version, fn=get_version_stamp_file()): def wait_for_mysql(): db_host = get_conf('DB_HOST', '127.0.0.1') + db_port = get_conf('DB_PORT', '3306') db_user = 'root' db_passwd = get_conf('DB_ROOT_PASSWD', '') while True: try: - MySQLdb.connect(host=db_host, port=3306, user=db_user, passwd=db_passwd) + MySQLdb.connect(host=db_host, port=db_port, user=db_user, passwd=db_passwd) except Exception as e: print ('waiting for mysql server to be ready: %s', e) time.sleep(2) From 39c3681c393c9b83e8a7bd437e500efa85f58407 Mon Sep 17 00:00:00 2001 From: Steve Fan <29133953+stevefan1999-personal@users.noreply.github.com> Date: Fri, 5 Jul 2019 23:20:05 +0800 Subject: [PATCH 3/4] Update bootstrap.py --- scripts/bootstrap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/bootstrap.py b/scripts/bootstrap.py index 08181b58..db5f3782 100755 --- a/scripts/bootstrap.py +++ b/scripts/bootstrap.py @@ -120,8 +120,8 @@ def init_seafile_server(): 'MYSQL_USER': 'seafile', 'MYSQL_USER_PASSWD': str(uuid.uuid4()), 'MYSQL_USER_HOST': '%.%.%.%', - 'MYSQL_HOST': get_conf('DB_HOST','127.0.0.1'), - 'MYSQL_PORT': get_conf('DB_PORT','3306'), + 'MYSQL_HOST': get_conf('DB_HOST','127.0.0.1'), + 'MYSQL_PORT': get_conf('DB_PORT','3306'), # Default MariaDB root user has empty password and can only connect from localhost. 'MYSQL_ROOT_PASSWD': get_conf('DB_ROOT_PASSWD', ''), } From 0ebe67ca77468ccff1f3c4e90341630163b849ba Mon Sep 17 00:00:00 2001 From: Steve Fan <29133953+stevefan1999-personal@users.noreply.github.com> Date: Fri, 5 Jul 2019 23:20:42 +0800 Subject: [PATCH 4/4] Update __init__.py --- scripts/utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/utils/__init__.py b/scripts/utils/__init__.py index 235329c0..0bab97bd 100644 --- a/scripts/utils/__init__.py +++ b/scripts/utils/__init__.py @@ -267,7 +267,7 @@ def update_version_stamp(version, fn=get_version_stamp_file()): def wait_for_mysql(): db_host = get_conf('DB_HOST', '127.0.0.1') - db_port = get_conf('DB_PORT', '3306') + db_port = int(get_conf('DB_PORT', 3306)) db_user = 'root' db_passwd = get_conf('DB_ROOT_PASSWD', '')