Code Monkey home page Code Monkey logo

master-server's Introduction

Minetest server list

Setting up the webpage

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.:

# apt-get install nodejs
# # OR:
# pacman -S nodejs
# # OR:
# emerge nodejs

Then install doT.js and its dependencies:

$ cd ~
$ npm install dot commander mkdirp

And finally compile the template:

$ cd static
$ ~/node_modules/dot/bin/dot-packer -s .

You can now serve the webpage by copying the files in static/ to your web root, or by starting the master server.

Embedding the server list in a page

<head>
	...
	<script>
		var master = {
			root: 'http://servers.minetest.net/',
			limit: 10,
			clients_min: 1,
			no_flags: 1,
			no_ping: 1,
			no_uptime: 1
		};
	</script>
	...
</head>
<body>
	...
	<div id="server_list"></div>
	...
</body>
<script src="list.js"></script>

Setting up the server

  1. Install Python 3 and pip:
pacman -S python python-pip
# OR:
apt-get install python3 python3-pip
  1. Install required Python packages:
# You might have to use pip3 if your system defaults to Python 2
pip install -r requirements.txt
  1. If using in production, install uwsgi and it's python plugin:
pacman -S uwsgi uwsgi-plugin-python
# OR:
apt-get install uwsgi uwsgi-plugin-python
# OR:
pip install uwsgi
  1. Configure the server by adding options to config.py. See config-example.py for defaults.

  2. Start the server:

$ ./server.py
$ # Or for production:
$ uwsgi -s /tmp/minetest-master.sock --plugin python -w server:app --enable-threads
$ # Then configure according to http://flask.pocoo.org/docs/deploying/uwsgi/
  1. (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;
try_files $uri @uwsgi;
location @uwsgi {
	uwsgi_pass ...;
}

License

The Minetest master server 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.