Neale Pickett
·
2021-10-20
getting-started.md
1Getting Started
2===============
3
4Compile Mothballs
5--------------------
6
7Mothballs are compiled, static-content versions of a puzzle category.
8You need a mothball for every category you want to run.
9
10To get some mothballs, you'll need to run a development server, which includes the category compiler.
11See [development](development.md) for details.
12
13
14Set up directories
15--------------------
16
17 mkdir -p /srv/moth/state
18 mkdir -p /srv/moth/mothballs
19 cp -r /path/to/src/moth/theme /srv/moth/theme # Skip if using Docker/Podman/Kubernetes
20
21MOTH needs three directories. We recommend putting them all in `/srv/moth`.
22
23* `/srv/moth/state`: (read-write) an empty directory for the server to record its state
24* `/srv/moth/mothballs`: (read-only) drop your mothballs here
25* `/srv/moth/theme`: (read-only) The HTML5 MOTH client: static content served to web browsers
26
27
28
29Run the server
30----------------
31
32We're going to assume you put everything in `/srv/moth`, like we suggested.
33
34### Podman
35
36 podman run --name=moth -d -v /srv/moth/mothballs:/mothballs:ro -v /srv/moth/state:/state ghcr.io/dirtbags/moth
37
38### Docker
39
40 docker run --name=moth -d -v /srv/moth/mothballs:/mothballs:ro -v /srv/moth/state:/state ghcr.io/dirtbags/moth
41
42### Native
43
44 cd /srv/moth
45 moth
46
47
48Copy in some mothballs
49-------------------------
50
51 cp category1.mb category2.mb /srv/moth/mothballs
52
53You can add and remove mothballs at any time while the server is running.
54
55
56Get a list of valid team tokens
57-----------------------
58
59 cat /srv/moth/state/tokens.txt
60
61You can edit or replace this file if you want to use different tokens than the pre-generated ones.
62
63
64Connect to the server
65------------------------
66
67Open http://localhost:8080/
68
69Substitute the hostname appropriately if you're a fancypants with a cloud.
70
71
72Yay!
73-------
74
75You should be all set now!
76
77See [administration](administration.md) for how to keep your new MOTH server running the way you want.