Skip to content

kirill-jjj/teamtalk-reg-system-rs

Repository files navigation

TeamTalk Registration System (Rust)

Build Binaries

Service for handling TeamTalk registrations via Telegram bot and web endpoints.

Requirements

  • Rust (stable)
  • SQLite (via sqlx with the bundled driver)
  • sqlx-cli installed (cargo install sqlx-cli)
  • Optional: lefthook if you want hooks

Quick Start

  1. Create config and env files:
cp config.toml.example config.toml

Create .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>
  1. Create the database and apply migrations:
sqlx database create
sqlx migrate run
  1. (Optional) Prepare SQLx query cache:
cargo sqlx prepare
  1. Build and run:
cargo build
cargo run

Configuration

The 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_URL is required by sqlx (used by the app and cargo sqlx prepare)
  • PENDING_PASSWORD_ENCRYPTION_KEY is required for pending password encryption (Base64-encoded 32-byte key)

Development

Run checks:

cargo fmt
cargo clippy -- -D warnings
cargo test

Git hooks (lefthook):

lefthook install
lefthook run pre-commit

Notes

  • The SQLite database file path must be absolute in DATABASE_URL.
  • cargo sqlx prepare updates the .sqlx/ query cache and should be committed.
  • App startup fails fast when PENDING_PASSWORD_ENCRYPTION_KEY is missing or invalid.

About

TeamTalk registration service with Telegram bot and web endpoints (Rust)

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors