Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c5356f3d5 | ||
|
|
b1205edd48 |
@@ -6,6 +6,8 @@ MYSQL_PASSWORD=
|
|||||||
HIDCHE_PW_SALT=
|
HIDCHE_PW_SALT=
|
||||||
HIDCHE_DB_PREFIX=hidche
|
HIDCHE_DB_PREFIX=hidche
|
||||||
|
|
||||||
|
#이미지 동기화 키. (16글자 이상, 빈칸인 경우 랜덤)
|
||||||
|
HIDCHE_IMAGE_REQUEST_KEY=
|
||||||
|
|
||||||
#운영자 계정, 비밀번호.
|
#운영자 계정, 비밀번호.
|
||||||
HIDCHE_ADMIN=
|
HIDCHE_ADMIN=
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ COPY entrypoint_hidche_app.sh /usr/local/bin/
|
|||||||
COPY id_ecdsa known_hosts /var/www/.ssh/
|
COPY id_ecdsa known_hosts /var/www/.ssh/
|
||||||
RUN \
|
RUN \
|
||||||
chown www-data:www-data /var/www/.ssh/*; \
|
chown www-data:www-data /var/www/.ssh/*; \
|
||||||
chmod 600 /var/www/.ssh/*;
|
chmod 600 /var/www/.ssh/*; \
|
||||||
|
chmod +x /usr/local/bin/entrypoint_hidche_app.sh
|
||||||
ENTRYPOINT ["entrypoint_hidche_app.sh"]
|
ENTRYPOINT ["entrypoint_hidche_app.sh"]
|
||||||
CMD ["php-fpm"]
|
CMD ["php-fpm"]
|
||||||
@@ -14,12 +14,6 @@ if [ ! -f "$samRoot/index.php" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $HIDCHE_IMAGE_USE_INTERNAL = "yes" ] && [ ! -d "$imageRoot" ]; then
|
if [ $HIDCHE_IMAGE_USE_INTERNAL = "yes" ] && [ ! -d "$imageRoot" ]; then
|
||||||
if [[ "$imageRoot" =~ ^ssh ]]; then
|
|
||||||
query=`echo "<?php \\\$a=parse_url('$imageRoot');echo join(' ', [\\\$a['port']?'-p '.\\\$a['port']:'',\\\$a['host']]);" | php`
|
|
||||||
ssh-keyscan $query >> /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
|
gosu www-data git clone $imgGitPath /var/www/html/image
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -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_pw = hash_password('root'+env['HIDCHE_PW_SALT'], env['MYSQL_USER']+env['MYSQL_PASSWORD'])[:32]
|
||||||
db_root_name = '%s_root'%env['HIDCHE_DB_PREFIX']
|
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', {
|
setupDBResult = session.post('http://web/sam/f_install/j_setup_db.php', {
|
||||||
'db_host':'db',
|
'db_host':'db',
|
||||||
'db_port':3306,
|
'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'],
|
'serv_host':env['HIDCHE_GAME_PATH'],
|
||||||
'shared_icon_path':'%s/icons'%env['HIDCHE_IMAGE_PATH'],
|
'shared_icon_path':'%s/icons'%env['HIDCHE_IMAGE_PATH'],
|
||||||
'game_image_path':'%s/game'%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_rest_key':env['HIDCHE_KAKAO_REST_KEY'],
|
||||||
'kakao_admin_key':env['HIDCHE_KAKAO_ADMIN_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 = str(env['HIDCHE_SERVER_LIST']).split(',')
|
||||||
serverList.reverse()
|
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', {
|
updateResult = session.post('http://web/sam/j_updateServer.php', {
|
||||||
'server':serverName,
|
'server':serverName,
|
||||||
'target':'origin/devel'
|
'target':target
|
||||||
})
|
})
|
||||||
print(serverName, updateResult.text, flush=True)
|
print(serverName, updateResult.text, flush=True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user