- A MongoDB instance. You can either create your own or get a free instance of Atlas (hosted on AWS/Google Cloud) here. The free instance is probably better than required for this project, haven't had any issues with that
- A Discord application. Create one here. This guide also seems pretty fine, follow it only until you have the bot invited. Make sure you copy the bot token for later use
- At least one Factorio server. If you have multiple, make sure that they are in the same directory
- Node v14
- Factorio servers to have factorio-init installed
- Clone https://github.com/Bisa/factorio-init to any directory that you wish
- Make a directory where all of your Factorio servers will be located, such as
/opt/factorio/servers/ - Go to the directory where you cloned factorio-init into and copy
config.exampletoconfig - Set the config up
- Make sure to set
SERVICE_NAMEto whatever you will recognize in the future, for exampleFactorio-AWF-Regular - Make sure the
USERNAMEandUSERGROUPare properly configured to the user profile that is able to start, stop Factorio servers and is the same as the one that Jammy will use - Set
FACTORIO_PATHto a folder in the directory you created for your Factorio servers, such as/opt/factorio/servers/awf-regular. Make sure you create this directory. This must be new and not the directory of an old server. You can copy savefiles, mods etc. later - Set
INSTALL_CACHE_DIR=/tmpto wherever downloads of Factorio server tarballs can be cached, or disable by togglingINSTALL_CACHE_TAR - Download the factorio-updater script to a place that you will remember. It can be common for multiple servers. Then set the
UPDATE_SCRIPTto the location of the python script - Set
RCON_PORTandRCON_PASSWORD(you will need to manually type those in) to whatever you will have in Jammy. Make the password consistent for all servers. - Add
--rcon-port ${RCON_PORT} --rcon-password ${RCON_PASSWORD}to theEXTRA_BINARGSfield
- Make sure to set
- Run
./factorio installand factorio-init will install Factorio to the directory that you specified previously. - Copy the whole cloned
factorio-initdirectory to the Factorio server's directory, i.e./opt/factorio/servers/awf-regular/factorio-init - Move to the server's directory and either copy in files from your old server, or set the Factorio server up freshly. Make sure you set your token/password in the
server-settings.jsonfile - Run
./factorio-init/factorio startto start the server. Refer to the factorio-init docs for reference about further usage, however some parts are managed by Jammy.
- Clone the repository and install dependencies with
git clone https://github.com/DistroByte/AwF-Bot && cd AwF-Bot && npm i - Populate your
config.tsfile from the example (config.example.ts) - Populate your
servers.tsfile from the example (servers.example.ts) - If files like
script-output/ext/awflogging.outdon't exist in your Factorio server folders, make sure they exist. All of the file names are in config.example.js. They can be blank. - Optimally, install the Discord integration mod for an easy setup, or for more features, install the scenario for Factorio onto each server as a scenario, as it has more features
- Set the database up with
npx prisma generate && npx prisma db push - Build the code with
npm run build - Run with
node .or using PM2