init
This commit is contained in:
@@ -60,6 +60,9 @@ url = "sqlite://oxspeak.db"
|
||||
# MySQL
|
||||
# url = "mysql://user:passwd@localhost:3306/db_name"
|
||||
|
||||
[media]
|
||||
root = "media"
|
||||
|
||||
[jwt]
|
||||
secret = "changeme"
|
||||
# Duration in seconds
|
||||
@@ -72,6 +75,26 @@ pub struct AppConfig {
|
||||
pub network: NetworkConfig,
|
||||
pub database: DatabaseConfig,
|
||||
pub jwt: JwtConfig,
|
||||
#[serde(default)]
|
||||
pub media: MediaConfig,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct MediaConfig {
|
||||
#[serde(default = "default_media_root")]
|
||||
pub root: String,
|
||||
}
|
||||
|
||||
impl Default for MediaConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
root: default_media_root(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn default_media_root() -> String {
|
||||
"media".to_string()
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
|
||||
Reference in New Issue
Block a user