Crates.io | fercord_storage |
lib.rs | fercord_storage |
version | |
source | src |
created_at | 2023-10-18 13:24:16.414606 |
updated_at | 2025-02-04 18:11:11.267328 |
description | Storage crate for Fercord |
homepage | |
repository | https://github.com/kekonn/fercord |
max_upload_size | |
id | 1006758 |
Cargo.toml error: | TOML parse error at line 24, column 1 | 24 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
A discord bot written in Rust, for personal use.
You can specify the location of the config file by setting the CONFIG
environment variable (i.e.: CONFIG=$XDG_CONFIG_HOME/fercord/config.toml
) or if not specified we look in .config/config.toml
in the current working directory.
Example config.toml
:
discord_token = "your-bot-token"
database_url = "sqlite://fercord.db"
redis_url = "redis://localhost/"
job_interval_min = 1
shard_key = "c69b7bb6-0ca4-40da-8bad-26d9d4d2fb50"
The following items should be added to the configuration file if the file is to be used with the web API:
session_key = "base64 value"
client_id = 948517362313863198
You will also need to set the following environment variable: FERCORD_CLIENT_SECRET
. This secret can be found on the same page as the client id.
Every variable mentioned above can be overriden from the environment. The correct environment variable prefix is "FERCORD_".
To override your discord token you would set the environment variable FERCORD_DISCORD_TOKEN
to your token.
Settings set through environment variables take precedence over configuration set via a config file.
The container has a built-in config.toml
stored at /config/config.toml
. The only setting there is job_interval_min (set to 1).
If you want to build your own docker image, you can override the location fercord looks for the config file by setting the CONFIG
environment variable in the Dockerfile.
This means the following environment variables HAVE to be specified in order for the container to be able to function:
If you want a different job interval, you can specify it through FERCORD_JOB_INTERVAL_MIN
.
The sqlite database is placed in the /data
directory and called fercord.db
. The container exposes /data
as a volume, so it will persist between updates etc.
The default value for RUST_LOG
in the container is info,sqlx::query=warn
. You can override this, but if you choose to, please copy the value for sqlx::query
.
Any log level lower than that will output the queries that sqlx runs, which might be a security issue.
Visit /docs
on the root of the API and you will get the API docs.