mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 08:52:16 +00:00
config: default http options
This commit is contained in:
@@ -2,12 +2,30 @@ use rustical_frontend::FrontendConfig;
|
||||
use rustical_store::auth::StaticUserStoreConfig;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
fn http_default_host() -> String {
|
||||
"0.0.0.0".to_owned()
|
||||
}
|
||||
fn http_default_port() -> u16 {
|
||||
4000
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct HttpConfig {
|
||||
#[serde(default = "http_default_host")]
|
||||
pub host: String,
|
||||
#[serde(default = "http_default_port")]
|
||||
pub port: u16,
|
||||
}
|
||||
|
||||
impl Default for HttpConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
host: http_default_host(),
|
||||
port: http_default_port(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct SqliteDataStoreConfig {
|
||||
pub db_url: String,
|
||||
@@ -34,6 +52,7 @@ pub struct TracingConfig {
|
||||
pub struct Config {
|
||||
pub data_store: DataStoreConfig,
|
||||
pub auth: AuthConfig,
|
||||
#[serde(default)]
|
||||
pub http: HttpConfig,
|
||||
pub frontend: FrontendConfig,
|
||||
#[serde(default)]
|
||||
|
||||
Reference in New Issue
Block a user