Skip to content

Commit

Permalink
Apply Luanti rename
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Nov 2, 2024
1 parent 6edaa91 commit 7795110
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 23 deletions.
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Minetest server list
Luanti server list
====================

Setting up the webpage
Expand Down Expand Up @@ -32,7 +32,7 @@ Embedding the server list in a page
...
<script>
var master = {
root: 'https://servers.minetest.net/',
root: 'https://servers.luanti.org/',
limit: 10,
clients_min: 1,
no_flags: true,
Expand All @@ -46,7 +46,7 @@ Embedding the server list in a page
...
<div id="server_list"></div>
...
<script src="https://servers.minetest.net/list.js"></script>
<script defer src="https://servers.luanti.org/list.js"></script>
</body>

Setting up the server
Expand Down Expand Up @@ -75,18 +75,20 @@ Setting up the server

$ ./server.py
$ # Or for production:
$ uwsgi -s /tmp/minetest-master.sock --plugin python -w server:app --enable-threads
$ uwsgi -s /run/serverlist.sock --plugin python -w server:app --enable-threads
$ # Then configure according to http://flask.pocoo.org/docs/deploying/uwsgi/

7. (optional) Configure the proxy server, if any. You should make the server
load static files directly from the static directory. Also, `/list`
should be served from `list.json`. Example for nginx:

root /path/to/server/static;
rewrite ^/list$ /list.json;
rewrite ^/$ /index.html break;
rewrite ^/list$ /list.json break;
try_files $uri @uwsgi;
location @uwsgi {
uwsgi_pass ...;
include uwsgi_params;
uwsgi_pass unix:/run/serverlist.sock;
}

Setting up the server (Apache version)
Expand All @@ -96,30 +98,29 @@ If you wish to use Apache to host the server list, do steps 1-2, 4, above. Addit

# This config assumes you have the server list at DocumentRoot.
# Visitors to the server list in this config would visit http://local.server/ and
# apache would serve up the output from server.py. Static resources would be served
# from http://local.server/static.
# apache would serve up the output from server.py.

# Where are the minetest-server files located?
DocumentRoot /var/games/minetest/serverlist
# Where are the serverlist files located?
DocumentRoot /var/games/luanti/serverlist

# Serve up server.py at the root of the URL.
WSGIScriptAlias / /var/games/minetest/serverlist/server.py
WSGIScriptAlias / /var/games/luanti/serverlist/server.py

# The name of the function that we call when we invoke server.py
WSGICallableObject app

# These options are necessary to enable Daemon mode. Without this, you'll have strange behavior
# with servers dropping off your list! You can tweak threads as needed. See mod_wsgi documentation.
WSGIProcessGroup minetest-serverlist
WSGIDaemonProcess minetest-serverlist threads=2
WSGIProcessGroup luanti-serverlist
WSGIDaemonProcess luanti-serverlist threads=2

<Directory /var/games/minetest/serverlist>
<Directory /var/games/luanti/serverlist>
Require all granted
</Directory>

License
-------

The Minetest server list code is licensed under the GNU Lesser General Public
The Luanti server list code is licensed under the GNU Lesser General Public
License version 2.1 or later (LGPLv2.1+). A LICENSE.txt file should have been
supplied with your copy of this software containing a copy of the license.
2 changes: 1 addition & 1 deletion config-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
PORT = 5000

# Amount of time, is seconds, after which servers are removed from the list
# if they haven't updated their listings. Note: By default Minetest servers
# if they haven't updated their listings. Note: By default Luanti servers
# only announce once every 5 minutes, so this should be more than 300.
PURGE_TIME = 350

Expand Down
6 changes: 3 additions & 3 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def checkRequestAddress(server):
return ADDR_IS_INVALID
# if not ipv6, there must be at least one dot (two components)
# Note: This is not actually true ('com' is valid domain), but we'll assume
# nobody who owns a TLD will ever host a Minetest server on the root domain.
# nobody who owns a TLD will ever host a Luanti server on the root domain.
# getaddrinfo also allows specifying IPs as integers, we don't want people
# to do that either.
if ":" not in name and "." not in name:
Expand All @@ -302,7 +302,7 @@ def checkRequestAddress(server):
return ADDR_IS_INVALID_PORT

# unicode in hostname
# Not sure about Python but the Minetest client definitely doesn't support it.
# Not sure about Python but the Luanti client definitely doesn't support it.
if any(ord(c) > 127 for c in name):
return ADDR_IS_UNICODE

Expand Down Expand Up @@ -358,7 +358,7 @@ def checkRequestSchema(server):
server[name] = server[name].lower() in ("true", "1")
continue
# Accept strings in integer fields but convert it to an
# integer, for interoperability with e.g. minetest.write_json.
# integer, for interoperability with e.g. core.write_json().
if data[1] == "int":
server[name] = int(server[name])
continue
Expand Down
4 changes: 2 additions & 2 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>Minetest server list</title>
<title>Luanti server list</title>
<link rel="stylesheet" href="modern-normalize.min.css">
<style>
body {
Expand All @@ -29,7 +29,7 @@
</script>
</head>
<body>
<span class="h"><strong>Minetest server list</strong> | <a href="https://www.minetest.net/get-involved/#reporting-issues">Contact</a> | <a href="https://www.minetest.net/app-privacy-policy/">Privacy</a></span>
<span class="h"><strong>Luanti server list</strong> | <a href="https://www.minetest.net/get-involved/#reporting-issues">Contact</a> | <a href="https://www.minetest.net/app-privacy-policy/">Privacy</a></span>
<hr />
<div id="server_list"></div>
<script src="list.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions static/servers.jst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
{{? master.show_proto_select}}
, Protocol: <select class="proto_select">
<option value="">All</option>
<option value="[11,32]" {{? master.proto_range=='[11,32]'}}selected{{?}}>11-32 (Minetest 0.4)</option>
<option value="[37,99]" {{? master.proto_range=='[37,99]'}}selected{{?}}>37+ (Minetest 5.x)</option>
<option value="[11,32]" {{? master.proto_range=='[11,32]'}}selected{{?}}>11-32 (0.4 series)</option>
<option value="[37,99]" {{? master.proto_range=='[37,99]'}}selected{{?}}>37+ (5.0 or newer)</option>
</select>{{?}}
</div>
{{?}}
Expand Down

0 comments on commit 7795110

Please sign in to comment.