Skip to content

Manual Installation

Feláček edited this page Mar 14, 2024 · 8 revisions

Manual Installation Instructions

This page will help you get Trakman up and running should you not want to use Docker (much easier!), as described here.

Video

If you prefer watching tutorials in video format, check out this video which goes in-depth on the installation of Trakman, configuration of a Trackmania Forever server and migration of the database. It is mostly targeted at Windows users, with a small segment dedicated towards Linux users.

Preface

To be able to set up and use the controller, you obviously need to have a working Trackmania Forever dedicated server first. You can find the dedicated server installation instructions in this Trackmania Forum post (archived).

Obtaining the source code

First things first, you will need to download the controller source code.

Using Git (CLI)

  1. git clone https://github.com/lythx/trakman.git --depth 1
  2. Done. You can skip to configuration now

Using Github (Web)

  1. Go to the project main page
  2. Click the green button that says "Code"
  3. Select the "Download ZIP" option
  4. Extract the downloaded archive wherever you like. Skip ahead to configuration

Controller Configuration

Firstly, go into the directory with the source code, either via cd trakman in terminal/powershell or via your file explorer.

There, start off by copying the file .env.example to .env, usually done with the command cp .env.example .env in the terminal/powershell. This file only holds the sensitive information, such as passwords, etc.

Inside .env the configurable values are split into categories:

Dedicated Server Config

Variable Name Value Type Description
SERVER_IP Valid IP address IP address of the server
SERVER_PORT 1-65535 Port used for the server communication from your dedicated_cfg.txt
SUPERADMIN_NAME String SuperAdmin name from your dedicated_cfg.txt
SUPERADMIN_PASSWORD String SuperAdmin password from your dedicated_cfg.txt

Database Config

Variable Name Value Type Description
DB_USER String PostgreSQL database user
DB_PASSWORD String Password for DB_USER
DB_NAME String Name of the PostgreSQL database
DB_SERVER Valid IP address IP address of the database server
DB_PORT 1-65535 Port used for the database communication (5432 by default)

Controller Config

Variable Name Value Type Description
OWNER_LOGIN String Trackmania Forever login of the server owner, the highest privilege user

Dedimania Config

Note

You do not need to fill this in if you are not planning to connect to the Dedimania records system.

Variable Name Value Type Description
DEDIMANIA_PASSWORD String Server password or the community code for your game account

Freezone Config

Note

You do not need to fill this in if you are not planning to register the server in the Freezone. For more Freezone information, see this page.

Variable Name Value Type Description
FREEZONE_PASSWORD String Your Freezone Trackmania Webservices password

Webservices Config

Note

You do not need to fill this in if you are not interested in using the Trackmania Webservices. Otherwise, see this page.

Variable Name Value Type Description
WEBSERVICES_LOGIN String Your Trackmania Webservices login
WEBSERVICES_PASSWORD String Your Trackmania Webservices password

Logging Config

Variable Name Value Type Description
LOG_LEVEL Number The level of logging (1 - error, 2 - warn, 3 - info, 4 - debug, 5 - trace)

Discord Logging Config

Note

If you do not plan on using Discord logging, the following settings are not necessary to fill out, although if you are interested in using this feature, please do take a look at the Discord webhook documentation first.

Variable Name Value Type Description
DISCORD_LOG_ENABLE YES/NO Whether to enable sending logs to Discord
DISCORD_LOG_LEVEL Number The level of logging affecting only the webhook (1 - error, 2 - warn, 3 - info, 4 - debug, 5 - trace)
DISCORD_WEBHOOK_URL String URL for the Discord webhook
DISCORD_EMBED_IMAGES String Comma-separated list of image URLs to be used in Discord embeds (thumbnails in the top right)
DISCORD_EMBED_TITLE String Text to be displayed on top of the embed
DISCORD_EMBED_TITLE_URL String URL for the named link in the title of the embed
DISCORD_EMBED_TITLE_ICON_URL String URL for the icon to be displayed next to the embed title
DISCORD_TAGGED_USERS String Comma-separated list of taggable Discord user IDs (e.g.: <@USERID1>, <@USERID2>), these IDs will be mentioned in case of a controller crash

Warning

Setting Discord log levels to higher than 2 is not recommended due to Discord ratelimits. More information is provided in this issue.

Launching the Controller

After you have configured everything and ensured that no mistakes are to be found, you should finally be ready to launch the controller.

Obtain the project dependencies

Open the terminal/powershell in the root directory of the project (where you unpacked the code or what directory git cloned it into), after that:

  1. Execute npm i, this will install all the project dependencies.

Tip

If you don't have the npm command available, but have installed NodeJS, it is likely that it was not added to your $PATH. Usually, logging out and back in fixes this.

Build & Launch

  1. Execute npm run build, this will "compile" the code.
  2. Execute npm run start, this will run the controller.

If the controller crashed on first run with several database related errors, do attempt to relaunch it a few times until that goes away. If your case is more severe and is not fixed by a simple restart, open an issue and we will look into it.

Run in the background, relaunch on crash

  1. Execute npm run build, this will "compile" the code.
  2. Execute npm run daemon, this will run the controller in the background and relaunch it on crash.

In this state:

  • To restart the controller, use npm run restart.
  • To stop the controller, use npm run stop.

If the logs are not being output, fret not, as they are still available in the /logs/ directory.

Afterword

Should Trakman crash at any point, make sure to report that in the issues. Possibly, a fix is already available on the dev branch, and is being tested on one of the development servers.