1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-24 08:46:24 -07:00

Add explanation if Docker boot fails because of missing js dir,

remove Username from gochan.json in Docker since there's no www-data user
This commit is contained in:
Eggbertx 2023-01-01 15:59:54 -08:00
parent c5f126ff45
commit d94a0d8fcf
3 changed files with 10 additions and 1 deletions

View file

@ -17,7 +17,7 @@ from pathlib import Path
import shutil
import subprocess
import sys
import traceback
release_files = (
"html/banned.png",
@ -339,6 +339,13 @@ def install(prefix="/usr", document_root="/srv/gochan", symlinks=False, js_only=
mkdir(path.join(prefix, "share/gochan/templates/override/"))
except shutil.SameFileError as err:
print(err)
except FileNotFoundError as err:
if file == "html/js/":
print("Missing html/js directory, this must be built before installation by running python3 build.py js, or mkdir html/js if you don't want JavaScript")
else:
traceback.print_exc()
sys.exit(1)
if path.exists(gochan_exe) is False:
build()

View file

@ -42,6 +42,7 @@ EXPOSE 9000
CMD ls -la /opt/gochan && ls -la && ls -la .. && sed -i /etc/gochan/gochan.json \
-e 's/"Port": 8080/"Port": 9000/' \
-e 's/"UseFastCGI": false/"UseFastCGI": true/' \
-e 's/"Username": ".*",//' \
-e 's#"DocumentRoot": "html"#"DocumentRoot": "/srv/gochan"#' \
-e 's#"TemplateDir": "templates"#"TemplateDir": "/usr/share/gochan/templates"#' \
-e 's#"LogDir": "log"#"LogDir": "/var/log/gochan"#' \

View file

@ -80,6 +80,7 @@ sed -i /etc/gochan/gochan.json \
-e 's#"DocumentRoot": "html"#"DocumentRoot": "/srv/gochan"#' \
-e 's#"TemplateDir": "templates"#"TemplateDir": "/usr/share/gochan/templates"#' \
-e 's#"LogDir": "log"#"LogDir": "/var/log/gochan"#' \
-e 's/"Username": ".*",/ /' \
-e 's/"DBpassword": ""/"DBpassword": "gochan"/' \
-e 's/"RandomSeed": ""/"RandomSeed": "abc123"/' \
-e 's/"Verbosity": 0/"Verbosity": 1/'