feat: DEFAULT_LANGUAGE/DEFAULT_TIMEZONE config + public GET /api/config
This commit is contained in:
@@ -50,4 +50,21 @@ pub struct Config {
|
||||
default_value_t = 5
|
||||
)]
|
||||
pub db_max_connections: u32,
|
||||
|
||||
/// Default UI + content-authoring language for this instance (i18n key, e.g. "sv").
|
||||
#[arg(
|
||||
long = "default-language",
|
||||
env = "DEFAULT_LANGUAGE",
|
||||
default_value = "sv"
|
||||
)]
|
||||
pub default_language: String,
|
||||
|
||||
/// Default display timezone (IANA name, e.g. "Europe/Stockholm"). Storage stays UTC;
|
||||
/// this is a display hint surfaced to clients (and, later, server-side renderers).
|
||||
#[arg(
|
||||
long = "default-timezone",
|
||||
env = "DEFAULT_TIMEZONE",
|
||||
default_value = "Europe/Stockholm"
|
||||
)]
|
||||
pub default_timezone: String,
|
||||
}
|
||||
|
||||
@@ -53,6 +53,8 @@ pub async fn run(config: Config) -> anyhow::Result<()> {
|
||||
app_name: config.app_name,
|
||||
cookie_secure: config.cookie_secure,
|
||||
search,
|
||||
default_language: config.default_language,
|
||||
default_timezone: config.default_timezone,
|
||||
};
|
||||
|
||||
let listener = TcpListener::bind(&config.bind_addr)
|
||||
|
||||
Reference in New Issue
Block a user