Files
biggus-dickus/crates/server/src/config.rs
T
2026-06-02 00:46:31 +02:00

22 lines
803 B
Rust

use clap::Parser;
/// Runtime configuration, sourced from CLI arguments and environment variables.
#[derive(Debug, Clone, Parser)]
#[command(version, about = "Collection management system server")]
pub struct Config {
/// PostgreSQL connection string.
#[arg(long, env = "DATABASE_URL")]
pub database_url: String,
/// Address to bind the HTTP server to.
#[arg(long, env = "BIND_ADDR", default_value = "0.0.0.0:8080")]
pub bind_addr: String,
/// User-facing application name (OpenAPI title, page title, …).
///
/// Defaults to a neutral name; set this to the real product name at deploy
/// time. The product name must never be hardcoded in source.
#[arg(long, env = "APP_NAME", default_value = "Collection Management System")]
pub app_name: String,
}