From 96835d650486977b4e2fb1d324c9894836a49f69 Mon Sep 17 00:00:00 2001 From: John Donaldson Date: Mon, 29 Apr 2019 19:26:55 +0100 Subject: [PATCH 1/3] Adding more information about running devel server --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 58f5d7d..74c6d44 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ and comes with a JavaScript-based scoreboard to display team rankings. Running a Development Server ============================ - docker run --rm -it -p 8080:8080 dirtbags/moth-devel + docker run --rm -it -p 8080:8080 -v /path/to/puzzles:/puzzles:ro dirtbags/moth-devel And point a browser to http://localhost:8080/ (or whatever host is running the server). From e3309902117008a93c32e54548a3aef2713db7d7 Mon Sep 17 00:00:00 2001 From: John Donaldson Date: Mon, 29 Apr 2019 20:31:16 +0100 Subject: [PATCH 2/3] Fixing some Python 3.5 vs 3.7 compatibility issues --- Dockerfile.moth-devel | 1 - devel/devel-server.py | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile.moth-devel b/Dockerfile.moth-devel index 20c659a..6e8466a 100644 --- a/Dockerfile.moth-devel +++ b/Dockerfile.moth-devel @@ -16,6 +16,5 @@ COPY devel /app/ COPY example-puzzles /puzzles/ COPY theme /theme/ -WORKDIR /moth/ ENTRYPOINT [ "python3", "/app/devel-server.py" ] CMD [ "--bind", "0.0.0.0:8080", "--puzzles", "/puzzles", "--theme", "/theme" ] diff --git a/devel/devel-server.py b/devel/devel-server.py index 1a6167d..37fda8c 100755 --- a/devel/devel-server.py +++ b/devel/devel-server.py @@ -43,7 +43,11 @@ class MothRequestHandler(http.server.SimpleHTTPRequestHandler): def __init__(self, request, client_address, server): self.directory = str(server.args["theme_dir"]) - super().__init__(request, client_address, server) + try: + super().__init__(request, client_address, server, directory=server.args["theme_dir"]) + except TypeError: + super().__init__(request, client_address, server) + # Backport from Python 3.7 def translate_path(self, path): From acafeebcd99701d5ef0802f1270bf8d106982292 Mon Sep 17 00:00:00 2001 From: Donaldson Date: Tue, 11 Jun 2019 17:58:15 -0500 Subject: [PATCH 3/3] Adding devel server instructions --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 74c6d44..9d9d9c9 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,12 @@ and comes with a JavaScript-based scoreboard to display team rankings. Running a Development Server ============================ +To use example puzzles + + docker run --rm -it -p 8080:8080 dirtbags/moth-devel + +or, to use your own puzzles + docker run --rm -it -p 8080:8080 -v /path/to/puzzles:/puzzles:ro dirtbags/moth-devel And point a browser to http://localhost:8080/ (or whatever host is running the server).