- Node.js 12 (works on older versions too, but compatibility isn't guaranteed).
- uWebSockets.js is C++ lib and distributed in binary files for the most popular operation systems, so it is unlikely, but you may have to compile it from source if you use an unpopular OS.
npm i cp .env.example .env
SU_PASSWORD variable value.
npm run build:dev
npm run watch
npm run start
Available environment variables.
The current implementation does not support accounts synchronization between server instances.
User accounts data are stored in
./data/user-stats.json and in memory during the server run. Set
false to turn user accounts off.
Each user session is signed by the login server (Ed25519). Validation uses the public key, which is downloaded when the server starts. To change the default key server URL set
AUTH_LOGIN_SERVER_KEY_URL variable value (only https is supported).
The server exports a
/admin URL to allow privileged players to moderate the
game, and a public log to allow everyone to see moderation actions.
Add passwords to
admin/passwords.txt like so:
The username is only used to enter a name into the log.
false to turn moderation panel off. To change panel URL set
MODERATION_PANEL_URL_ROUTE variable value (
admin by default).
"How to run" examples
.env.production is default .env file for docker image.
Build an image.
docker build -t airbattle-server .
Run. Don't forget to pass envirounment variables and mount the volumes you need. Example:
docker run -v /host/logs:/app/logs -v /host/data:/app/data -p 3501:3501 -e SERVER_TYPE=FFA -e SU_PASSWORD=mypass airbattle-server
If you want to use TLS also mount
/app/certsto the host directory with
fullchain.pem, and set ENDPOINTS_TLS=true.
Run directly or behind the proxy
cp .env.production .env npm i npm run build npm prune --production node ./dist/app.js
or use some kind of process managers.
If you run the server behind the proxy it is important to pass the real IP to the server (
- Server performance is important. Some bots (like https://github.com/airmash-refugees/airmash_bot) generate many packets espesially in
-follow memode, you can use them to test.
- There are eslint rules here, please don't forget about this.