Skip to content

Selhosting

Martin edited this page Jan 18, 2023 · 3 revisions

Selfhosting Zwei

Selfhosting a bot is nothing more or less than running your own version of it, where you get access to all the owner-only commands as well as gaining control over the functions the bot offers and who's allowed to use it.
It's recommended to run the bot on a dedicated system or on a VPS for optimal performance of the bot. Running it on a PC that's being used for other things at the same time might interfere with the response time and general usability.

Dependencies

In order to self-host Zwei there are a few dependencies that need to be met. These dependencies are/will be at least:

  • Rust toolchain v1.59. With some effort Serenity supports 1.53, see their MSRV policy;
    • It's recommended to install through Rustup, see rust-lang.org
    • Any other dependencies causing problems are unforeseen problems. Development is being done on either latest stable, or recent nightly.
      • Please open an issue if certain Rust versions above the MSRV cause problems.
      • Build automation to ensure a working environment might be added in the future, feel free to help!
  • Proper build system tooling (x86_64-pc-windows-gnu and x86_64-unknown-linux-gnu toolchains have been tested)
  • Access to any dependencies of dependencies. This includes being able to build libsqlite-sys and sqlite3.
    • Dependencies should resolve their own dependencies
    • Development is being done in an MSYS2 environment and that has not caused any conflicts yet.

In order to host the bot yourself, make sure to have all dependencies on your PATH or in the root directory of the bot so it can find it properly. You might want to set the path to certain files in variables instead; look at the dependency's guides in order to solve this properly.

Assuming you have a working environment, running Zwei should be as simple as cargo run --release for an optimized build. If you plan to update, it's recommended to run relevant git commands prior to restarting the bot. This is because pulling in changes should not interfere with the running process, so downtime should be minimal between runs. If you wish to move Zwei elsewhere on the system, move target/release/zwei_bot[.exe] and any other files emitted during the build, as well as the data folder and all of its contents to the new directory. You should be able to run the binary just like any other program. The directory should look something like

- Zwei/
  |- data/
    |- config.json
    |- Zwei.sdb  <- will be created if missing
  |- zwei_bot[.exe]
  |- ...

Disclaimer

The development team is not responsible for any problems, damages or expenses that may occur when selfhosting.
We do not take payment or donations. If you wish to help, please contribute using Issues or through Pull Requests!

Clone this wiki locally