Novel project: Luanti Web Services Proxy
I wrote in 10 hours a small project that makes it easy to use multiple instances of ContentDB and Serverlist in Luanti. Because the official ContentDB is very picky about what mods are allowed (under the laws where they are hosted, among other reasons), there might be other places to get packages, i.e., games, mods, and texture packs. I'm not aware of any other public ContentDB instances, but my internal network has a private ContentDB instance and I want to use it as well as the public ContentDB.
This new project is named lwsp and runs in docker or else with python3/flask.
Use LWSP for ContentDB and Serverlist when you want your Luanti client to easily access multiple ContentDB instances, or multiple Serverlist instances, or both.
Because of the way a ContentDB instance enforces mod dependencies to be resolvable within that instance, any dependencies for a package will be resolvable from that one instance only.
This is not designed for a general-purpose website to manage multiple ContentDB instances' packages; it is only a shim for Luanti clients to use.
Using LWSP
Running the proxy server locally
Set up a python3 virtual environment and install any dependencies.
python3 -m venv ~/venv-cdbp source ~/venv-cdbp pip3 install -r requirements.txt
Adjust config.cfg from config.cfg.example. In this file, you can set the default backend servers, for when the client uses "default." You can even force the usage of only these backends (ignoring any that the client might send) in the configuration. You can also configure packages to ignore by tag, author name, or regular expression matching the name or title.
Start the development server.
./start.sh
Running proxy server in docker or docker-compose
See the example docker-compose.yml.
Configuring Luanti client to use the proxy server
Any mods installed before configuring a client to use the proxy can be upgraded, but at the time of upgrade, the mod's mod.conf field author will be updated with the hostname+protocol as part of the author name. This change will make it harder to disable the usage of the LWSP for contentdb_url, and will require manual updates to each mod.conf before then being able to update them when pointing directly to the canonical ContentDB.
Using multiplexer for ContentDB
Set contentdb_url in minetest.conf to a string similar to the following. The top of the virtual path is a url-encoded representation of space-delimited connection strings (protocol, hostname, and optionally port).
http://localhost:5124/https%3A%2F%2Fcontent.luanti.org%2F+http%3A%2F%2Fvm4%3A5123%2F
For example, to list https://content.luanti.org/ and http://vm4:5123/ you would place this into a url encoder utility.
https://content.luanti.org/ http://vm4:5123/
Optionally, you can set the list to "default" to use the backends configured by the proxy server, or even just omit the "default" virtual path.
http://localhost:5124/default/ http://localhost:5124/
Using multiplexer for Serverlist
Set serverlist_url in minetest.conf to a line formatted in the same way, but with serverlist urls.
http://localhost:5124/https%3A%2F%2Fservers.luanti.org+http%3A%2F%2Fvm4%3Aserverlist
Like contentdb config, you can omit the top virtual directory of the path, and use the default configured in the server.
http://localhost:5124/
Screenshot of browsing available packages in Luanti
Author
bgstack15
Alternatives
None. This is novel on the www.
Comments