mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-02 15:06:23 -07:00
Build gochan on first run in startup script
This commit is contained in:
parent
608ff24d9a
commit
20ab2397f1
2 changed files with 24 additions and 17 deletions
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
apk --no-cache add \
|
apk add \
|
||||||
postgresql-client \
|
|
||||||
mariadb-client \
|
mariadb-client \
|
||||||
nginx \
|
nginx \
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
|
@ -12,7 +11,7 @@ apk --no-cache add \
|
||||||
gcc \
|
gcc \
|
||||||
musl-dev \
|
musl-dev \
|
||||||
openssl \
|
openssl \
|
||||||
bash
|
exiftool
|
||||||
|
|
||||||
mkdir -p /root/bin
|
mkdir -p /root/bin
|
||||||
|
|
||||||
|
@ -34,4 +33,4 @@ mkdir -p /etc/ssl/private
|
||||||
openssl req -x509 -nodes -days 7305 -newkey rsa:2048 \
|
openssl req -x509 -nodes -days 7305 -newkey rsa:2048 \
|
||||||
-keyout /etc/ssl/private/nginx-selfsigned.key \
|
-keyout /etc/ssl/private/nginx-selfsigned.key \
|
||||||
-out /etc/ssl/certs/nginx-selfsigned.crt \
|
-out /etc/ssl/certs/nginx-selfsigned.crt \
|
||||||
-subj "/CN=192.168.56.3"
|
-subj "/CN=127.0.0.1"
|
||||||
|
|
|
@ -2,19 +2,27 @@
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
sed -i "/etc/gochan/gochan.json" \
|
if [ ! -f /etc/gochan/.installed ]; then
|
||||||
-e "s/\"Port\": 8080/\"Port\": 9000/" \
|
sed -i "/etc/gochan/gochan.json" \
|
||||||
-e "s/\"UseFastCGI\": false/\"UseFastCGI\": true/" \
|
-e "s/\"Port\": 8080/\"Port\": 9000/" \
|
||||||
-e "s/\"Username\": \".*\",//" \
|
-e "s/\"UseFastCGI\": false/\"UseFastCGI\": true/" \
|
||||||
-e "s#\"DocumentRoot\": \"html\"#\"DocumentRoot\": \"/srv/gochan\"#" \
|
-e "s/\"Username\": \".*\",//" \
|
||||||
-e "s#\"TemplateDir\": \"templates\"#\"TemplateDir\": \"/usr/share/gochan/templates\"#" \
|
-e "s#\"DocumentRoot\": \"html\"#\"DocumentRoot\": \"/srv/gochan\"#" \
|
||||||
-e "s#\"LogDir\": \"log\"#\"LogDir\": \"/var/log/gochan\"#" \
|
-e "s#\"TemplateDir\": \"templates\"#\"TemplateDir\": \"/usr/share/gochan/templates\"#" \
|
||||||
-e "s/\"Verbosity\": 0/\"Verbosity\": 1/" \
|
-e "s#\"LogDir\": \"log\"#\"LogDir\": \"/var/log/gochan\"#" \
|
||||||
-e "s/\"DBtype\".*/\"DBtype\": \"${DBTYPE}\",/" \
|
-e "s/\"Verbosity\": 0/\"Verbosity\": 1/" \
|
||||||
-e "s/\"DBhost\".*/\"DBhost\": \"tcp(${DATABASE_HOST}:${DATABASE_PORT})\",/" \
|
-e "s/\"DBtype\".*/\"DBtype\": \"${DBTYPE}\",/" \
|
||||||
-e "s/\"DBname\".*/\"DBname\": \"${DATABASE_NAME}\",/" \
|
-e "s/\"DBhost\".*/\"DBhost\": \"tcp(${DATABASE_HOST}:${DATABASE_PORT})\",/" \
|
||||||
-e "s/\"DBusername\".*/\"DBusername\": \"${DATABASE_USER}\",/" \
|
-e "s/\"DBname\".*/\"DBname\": \"${DATABASE_NAME}\",/" \
|
||||||
-e "s/\"DBpassword\".*/\"DBpassword\": \"${DATABASE_PASSWORD}\",/"
|
-e "s/\"DBusername\".*/\"DBusername\": \"${DATABASE_USER}\",/" \
|
||||||
|
-e "s/\"DBpassword\".*/\"DBpassword\": \"${DATABASE_PASSWORD}\",/"
|
||||||
|
echo "Finished first-time Gochan configuration"
|
||||||
|
git config --global --add safe.directory /opt/gochan
|
||||||
|
./build.py
|
||||||
|
./build.py install
|
||||||
|
touch /etc/gochan/.installed
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
nginx
|
nginx
|
||||||
echo "pinging db, DBTYPE: '$DBTYPE'"
|
echo "pinging db, DBTYPE: '$DBTYPE'"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue