github.com/dirtbags/moth/v4@v4.6.3-0.20240418162859-a93bc5be85d4/docs/getting-started.md (about)

     1  Getting Started
     2  ===============
     3  
     4  Compile Mothballs
     5  --------------------
     6  
     7  Mothballs are compiled, static-content versions of a puzzle category.
     8  You need a mothball for every category you want to run.
     9  
    10  To get some mothballs, you'll need to run a development server, which includes the category compiler.
    11  See [development](development.md) for details.
    12  
    13  
    14  Set 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  
    21  MOTH 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  
    29  Run the server
    30  ----------------
    31  
    32  We'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  
    48  Copy in some mothballs
    49  -------------------------
    50  
    51      cp category1.mb category2.mb /srv/moth/mothballs
    52  
    53  You can add and remove mothballs at any time while the server is running.
    54  
    55  
    56  Get a list of valid team tokens
    57  -----------------------
    58  
    59      cat /srv/moth/state/tokens.txt
    60  
    61  You can edit or replace this file if you want to use different tokens than the pre-generated ones.
    62  
    63  
    64  Connect to the server
    65  ------------------------
    66  
    67  Open http://localhost:8080/
    68  
    69  Substitute the hostname appropriately if you're a fancypants with a cloud.
    70  
    71  
    72  Yay!
    73  -------
    74  
    75  You should be all set now!
    76  
    77  See [administration](administration.md) for how to keep your new MOTH server running the way you want.