ssh git이 가능하도록 변경, cron 버그 수정, fpm timezone 수정

This commit is contained in:
2019-09-15 13:30:12 +00:00
parent 0d49729c63
commit af6353105b
12 changed files with 121 additions and 64 deletions
+8 -10
View File
@@ -1,27 +1,25 @@
#!/bin/bash
set -euxo pipefail
set -uxo pipefail
shopt -s nullglob
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
printf "[PHP]\ndate.timezone = \"$TZ\"\n" > /usr/local/etc/php/conf.d/tzone.ini
wwwRoot="/var/www/html"
samRoot="$wwwRoot/sam"
imageRoot="$wwwRoot/image"
gameGitPath="https://storage.hided.net/gogs/devsam/core.git"
imgGitPath="https://storage.hided.net/gogs/devsam/image.git"
if [ ! -f "$wwwRoot/index.php" ]; then
echo "<?php header('location:sam',TRUE,301);" > $wwwRoot/index.php
chown www-data:www-data $wwwRoot/index.php
fi
if [ ! -f "$samRoot/index.php" ]; then
gosu www-data git clone $gameGitPath /var/www/html/sam
fi
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
fi