feat: add support for user registration toggle and Traefik integration in Docker setup

This commit is contained in:
2026-03-11 22:56:23 +01:00
parent dc29976c1f
commit 4e1de172f7
7 changed files with 85 additions and 3 deletions

View File

@@ -1,4 +1,6 @@
use axum::{Json, Router, routing::get};
use axum::{Json, Router, extract::State, routing::get};
use std::sync::Arc;
use crate::config::Config;
use crate::dto::ConfigResponse;
use crate::state::AppState;
@@ -6,8 +8,8 @@ pub fn router() -> Router<AppState> {
Router::new().route("/", get(get_config))
}
async fn get_config() -> Json<ConfigResponse> {
async fn get_config(State(config): State<Arc<Config>>) -> Json<ConfigResponse> {
Json(ConfigResponse {
allow_registration: true, // Default to true for template
allow_registration: config.allow_registration,
})
}