From 5c5356f3d51b941868ded91bc38618145e78dde9 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 22 Sep 2019 17:06:53 +0000 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=8F=99?= =?UTF-8?q?=EA=B8=B0=ED=99=94=20=ED=82=A4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hidche/account.env | 2 ++ hidche/app/entrypoint_hidche_app.sh | 6 ------ hidche/install/install_hidche.py | 16 ++++++++++++++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/hidche/account.env b/hidche/account.env index 45def9c..eb2539e 100644 --- a/hidche/account.env +++ b/hidche/account.env @@ -6,6 +6,8 @@ MYSQL_PASSWORD= HIDCHE_PW_SALT= HIDCHE_DB_PREFIX=hidche +#이미지 동기화 키. (16글자 이상, 빈칸인 경우 랜덤) +HIDCHE_IMAGE_REQUEST_KEY= #운영자 계정, 비밀번호. HIDCHE_ADMIN= diff --git a/hidche/app/entrypoint_hidche_app.sh b/hidche/app/entrypoint_hidche_app.sh index 78733b7..48bf54d 100755 --- a/hidche/app/entrypoint_hidche_app.sh +++ b/hidche/app/entrypoint_hidche_app.sh @@ -14,12 +14,6 @@ if [ ! -f "$samRoot/index.php" ]; then fi if [ $HIDCHE_IMAGE_USE_INTERNAL = "yes" ] && [ ! -d "$imageRoot" ]; then - if [[ "$imageRoot" =~ ^ssh ]]; then - query=`echo "> /var/www/.ssh/known_hosts 2>/dev/null; - chown www-data:www-data /var/www/.ssh/known_hosts - chmod 600 /var/www/.ssh/known_hosts - fi gosu www-data git clone $imgGitPath /var/www/html/image fi diff --git a/hidche/install/install_hidche.py b/hidche/install/install_hidche.py index d52696b..33198d3 100755 --- a/hidche/install/install_hidche.py +++ b/hidche/install/install_hidche.py @@ -60,6 +60,11 @@ session = requests.session() db_root_pw = hash_password('root'+env['HIDCHE_PW_SALT'], env['MYSQL_USER']+env['MYSQL_PASSWORD'])[:32] db_root_name = '%s_root'%env['HIDCHE_DB_PREFIX'] +if 'HIDCHE_IMAGE_REQUEST_KEY' in env and len(env['HIDCHE_IMAGE_REQUEST_KEY'])>=16: + image_request_key = env['HIDCHE_IMAGE_REQUEST_KEY'] +else: + image_request_key = os.urandom(16).hex() + setupDBResult = session.post('http://web/sam/f_install/j_setup_db.php', { 'db_host':'db', 'db_port':3306, @@ -69,6 +74,7 @@ setupDBResult = session.post('http://web/sam/f_install/j_setup_db.php', { 'serv_host':env['HIDCHE_GAME_PATH'], 'shared_icon_path':'%s/icons'%env['HIDCHE_IMAGE_PATH'], 'game_image_path':'%s/game'%env['HIDCHE_IMAGE_PATH'], + 'image_request_key':image_request_key, 'kakao_rest_key':env['HIDCHE_KAKAO_REST_KEY'], 'kakao_admin_key':env['HIDCHE_KAKAO_ADMIN_KEY'], }) @@ -93,10 +99,16 @@ print(loginResult.text, flush=True) serverList = str(env['HIDCHE_SERVER_LIST']).split(',') serverList.reverse() -for serverName in serverList: + +currentBranch = 'devel' +for idx, serverName in enumerate(serverList): + if idx == 0: + target = currentBranch + else: + target = 'origin/'+currentBranch updateResult = session.post('http://web/sam/j_updateServer.php', { 'server':serverName, - 'target':'origin/devel' + 'target':target }) print(serverName, updateResult.text, flush=True)