Made subs works
All checks were successful
Rust Docker Build / docker (push) Successful in 1h11m56s

This commit is contained in:
AB from home.homenet
2025-10-19 15:23:17 +03:00
parent dae787657c
commit c6892b1a73
11 changed files with 87 additions and 49 deletions

View File

@@ -37,6 +37,10 @@ pub struct WebConfig {
pub jwt_secret: String,
#[validate(range(min = 3600))]
pub jwt_expiry: u64,
/// Base URL for the application (used in subscription links and Telegram messages)
/// Example: "https://vpn.hexor.cy"
#[validate(url)]
pub base_url: String,
}
#[derive(Debug, Clone, Serialize, Deserialize, Validate)]
@@ -84,6 +88,7 @@ impl Default for WebConfig {
cors_origins: vec!["http://localhost:3000".to_string()],
jwt_secret: "your-secret-key-change-in-production".to_string(),
jwt_expiry: 86400, // 24 hours
base_url: "http://localhost:8080".to_string(),
}
}
}
@@ -174,6 +179,9 @@ impl AppConfig {
if let Some(log_level) = &args.log_level {
builder = builder.set_override("logging.level", log_level.as_str())?;
}
if let Some(base_url) = &args.base_url {
builder = builder.set_override("web.base_url", base_url.as_str())?;
}
let config: AppConfig = builder.build()?.try_deserialize()?;