- Add toml crate dependency for TOML file parsing - Create config module with Config struct to deserialize config.toml - Support OIDC URLs (auth_url, token_url, redirect_url), credentials (client_id, client_secret) - Make server host/port, database URL, and session secret configurable - Create config.example.toml with all configuration options documented - Update main.rs to load config.toml with fallback to environment variables - Maintain backward compatibility with environment variable configuration
21 lines
486 B
TOML
21 lines
486 B
TOML
# OIDC Configuration
|
|
[oidc]
|
|
client_id = "your_client_id"
|
|
client_secret = "your_client_secret"
|
|
auth_url = "https://your-provider.com/auth"
|
|
token_url = "https://your-provider.com/token"
|
|
redirect_url = "http://localhost:3000/auth/callback"
|
|
|
|
# Server Configuration
|
|
[server]
|
|
host = "127.0.0.1"
|
|
port = 3000
|
|
|
|
# Database Configuration
|
|
[database]
|
|
url = "sqlite:weight_tracker.db"
|
|
|
|
# Session Configuration
|
|
[session]
|
|
secret = "your_secret_key_that_is_long_enough_so_the_library_does_not_complain"
|