Minetest Server List ==================== Webpage Setup --- You will have to install node.js, doT.js and their dependencies to compile the server list webpage template. First install node.js, e.g.: ```sh sudo pacman -S nodejs # OR: sudo apt-get install nodejs ``` Then install doT.js and its dependencies: ```sh npm install ``` And finally compile the template: ```sh cd server_list/static ../../node_modules/dot/bin/dot-packer -s . ``` You can now serve the webpage by copying the files in `server_list/static/` to your web root, or by [starting the server list](#server-setup). Embedding in a Webpage --- ```html
... ... ... ... ``` Server Setup --- 1. Install Python 3 and Pipenv: ```sh sudo pacman -S python python-pipenv # OR: sudo apt-get install python3 python3-pip && pip install pipenv ``` 2. Install required Python packages: ```sh pipenv sync ``` 3. Set up Celery message broker. Pick a Celery backend (Redis or RabbitMQ are recommended), and install and enable the required packages. For example: ```sh # Redis support requires an additional package pipenv run pip install redis sudo pacman -S redis # or sudo apt-get install redis sudo systemctl enable --now redis ``` 4. Configure the server by adding options to `config.py`. See `server_list/config.py` for defaults. 5. Start the server for development: ```sh pipenv run flask run ``` 6. Start the celery background worker: ```sh pipenv run celery --app server_list:celery worker --beat ``` Running in Production --- When running in production you should set up a proxy server that calls the server list through WSGI. These examples assume that the server list is installed to `/srv/http/serverlist`. ### Nginx First [set up uWSGI](#uwsgi), then update the Nginx configuration to proxy to uWSGI. You should make the server load static files directly from the static directory. Also, `/list` should be aliased to `list.json`. Here's an example configuration: ```nginx root /srv/http/serverlist/server_list/static; rewrite ^/list$ /list.json; try_files $uri @uwsgi; location @uwsgi { uwsgi_pass unix:/run/uwsgi/server_list.sock; } ``` Also see [the Flask uwsgi documentation](https://flask.palletsprojects.com/en/2.0.x/deploying/uwsgi/). ### Apache There are two options for Apache, you can use either `mod_wsgi` or `mod_proxy_uwsgi`. Note: both of these example configurations serve static through WSGI, instead of bypassing WSGI for performance. #### mod_wsgi First install/enable `mod_wsgi`. Then create `wsgi.py` in the directory containing `server_list` with the following contents: ```py import os, sys sys.path.append(os.path.dirname(__file__)) from server_list import app ``` Then configure the Apache VirtualHost like the following: ```apache WSGIDaemonProcess server_list python-home=