Service for handling TeamTalk registrations via Telegram bot and web endpoints.
- Rust (stable)
- SQLite (via
sqlxwith the bundled driver) sqlx-cliinstalled (cargo install sqlx-cli)- Optional:
lefthookif you want hooks
- Create config and env files:
cp config.toml.example config.tomlCreate .env with a database URL (example for local SQLite):
DATABASE_URL=sqlite:///absolute/path/to/db/dev.db
PENDING_PASSWORD_ENCRYPTION_KEY=<BASE64_32_BYTE_KEY>- Create the database and apply migrations:
sqlx database create
sqlx migrate run- (Optional) Prepare SQLx query cache:
cargo sqlx prepare- Build and run:
cargo build
cargo runThe main configuration file is config.toml. Start from config.toml.example
and adjust values:
- Telegram bot token and admin IDs
- Host/port settings
- Registration policy toggles
- TeamTalk and download settings
- Optional
log_level(tracing filter), for example:log_level = "info"log_level = "info,teamtalk_reg_system_rs=debug,teloxide=debug"
Environment variables:
DATABASE_URLis required bysqlx(used by the app andcargo sqlx prepare)PENDING_PASSWORD_ENCRYPTION_KEYis required for pending password encryption (Base64-encoded 32-byte key)
Run checks:
cargo fmt
cargo clippy -- -D warnings
cargo testGit hooks (lefthook):
lefthook install
lefthook run pre-commit- The SQLite database file path must be absolute in
DATABASE_URL. cargo sqlx prepareupdates the.sqlx/query cache and should be committed.- App startup fails fast when
PENDING_PASSWORD_ENCRYPTION_KEYis missing or invalid.