self-hosting
prerequisites
- Git
- Node.js
- C++ build tools
- FFmpeg
- SOX
- PostgreSQL server (for production)
PostgreSQL server is not needed, because on development
environment it uses SQLite3, however it
is recommended that you set it up because running things on a development
environment is generally
a bad practice.
setting up
clone foxtrot.ts
repository into the workspace and install dependencies.
configuration
configure the application using *.example.json
files in the configs/
directory as a template.
formats.json
is unused, and you may leave it empty:
{}
app.json
fields
name | description | required |
---|---|---|
token | Discord bot token. | yes |
prefix | default message-content-based prefix. | yes |
proxy | HTTPS proxy. if you do not have one, leave it empty: "" . | no |
feedbackWebhook | feedback webhook. it is also used to report any cluster crashes. you need to extract the ID and the token of the webhook from its URL. | yes |
devId | owner/runner user ID on Discord. it is used only to ping the user on cluster crashes. | yes |
shardCount | set it to 1 . | yes |
shardStart | set it to 0 . | yes |
shardEnd | set it to 1 . | yes |
configuring shat.json
the only thing that you need to specify here is the gitHubToken
field. everything else does not need to be modified.
go here and create a new token, then put it into the gitHubToken
variable.
creating a separate repository for sound effects (or otherwise chatsounds) will not be described in detail, however if
you would like to use your own chatsounds GitHub repository with foxtrot, add an object to sources
, templated to the
following structure:
// author/repository-name#branch
"Metastruct/garrysmod-chatsounds#master": {
// bases (array of paths)
"bases": ["sound/chatsounds/autoadd"],
// if you somehow managed to create a msgpack file for chatsounds
"useMsgPack": false
},
configuring Knex
create a user and a database in the PostgreSQL server if you have not done it already.
in the root of the project, copy knexfile.example.ts
to knexfile.ts
and configure it.
after configuring, you need to run migrations. to do that, you need to run the following:
configuring Spotify
if needed, you may add support for Spotify by following these instructions:
- extract client ID and private key with https://github.com/wvdumper/dumper.
- extract cookies (in Netscape format) from open.spotify.com while being logged in.
- put these files into
configs/
folder and name them accordingly:
- Widevine client ID:
widevine_client_id.bin
- Widevine device private key:
widevine_private_key.pem
- cookies:
spotify_cookies.txt
if the needed files are missing, Spotify as a format will not be considered supported by foxtrot.
almost done
build the application, including the C++ audio mixer.
to run it under production, you need to set NODE_ENV
environment variable to production
and then just run
npm run start
.