Skip to content

Commit d94a0d8

Browse files
committed
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
1 parent c5f126f commit d94a0d8

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

build.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import shutil
1818
import subprocess
1919
import sys
20-
20+
import traceback
2121

2222
release_files = (
2323
"html/banned.png",
@@ -339,6 +339,13 @@ def install(prefix="/usr", document_root="/srv/gochan", symlinks=False, js_only=
339339
mkdir(path.join(prefix, "share/gochan/templates/override/"))
340340
except shutil.SameFileError as err:
341341
print(err)
342+
except FileNotFoundError as err:
343+
if file == "html/js/":
344+
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")
345+
else:
346+
traceback.print_exc()
347+
sys.exit(1)
348+
342349

343350
if path.exists(gochan_exe) is False:
344351
build()

docker/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ EXPOSE 9000
4242
CMD ls -la /opt/gochan && ls -la && ls -la .. && sed -i /etc/gochan/gochan.json \
4343
-e 's/"Port": 8080/"Port": 9000/' \
4444
-e 's/"UseFastCGI": false/"UseFastCGI": true/' \
45+
-e 's/"Username": ".*",//' \
4546
-e 's#"DocumentRoot": "html"#"DocumentRoot": "/srv/gochan"#' \
4647
-e 's#"TemplateDir": "templates"#"TemplateDir": "/usr/share/gochan/templates"#' \
4748
-e 's#"LogDir": "log"#"LogDir": "/var/log/gochan"#' \

docker/bootstrap.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ sed -i /etc/gochan/gochan.json \
8080
-e 's#"DocumentRoot": "html"#"DocumentRoot": "/srv/gochan"#' \
8181
-e 's#"TemplateDir": "templates"#"TemplateDir": "/usr/share/gochan/templates"#' \
8282
-e 's#"LogDir": "log"#"LogDir": "/var/log/gochan"#' \
83+
-e 's/"Username": ".*",/ /' \
8384
-e 's/"DBpassword": ""/"DBpassword": "gochan"/' \
8485
-e 's/"RandomSeed": ""/"RandomSeed": "abc123"/' \
8586
-e 's/"Verbosity": 0/"Verbosity": 1/'

0 commit comments

Comments
 (0)