diff options
Diffstat (limited to 'common/src/config.rs')
| -rw-r--r-- | common/src/config.rs | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/common/src/config.rs b/common/src/config.rs deleted file mode 100644 index 73e2a08..0000000 --- a/common/src/config.rs +++ /dev/null @@ -1,61 +0,0 @@ -/* - This file is part of jellything (https://codeberg.org/metamuffin/jellything) - which is licensed under the GNU Affero General Public License (version 3); see /COPYING. - Copyright (C) 2026 metamuffin <metamuffin.org> -*/ - -use crate::user::PermissionSet; -use serde::{Deserialize, Serialize}; -use std::{collections::HashMap, path::PathBuf}; - -#[derive(Debug, Deserialize, Serialize, Default)] -pub struct GlobalConfig { - pub hostname: String, - pub brand: String, - pub slogan: String, - #[serde(default = "return_true")] - pub tls: bool, - pub asset_path: PathBuf, - pub database_path: PathBuf, - pub cache_path: PathBuf, - pub media_path: PathBuf, - pub secrets_path: PathBuf, - #[serde(default = "max_in_memory_cache_size")] - pub max_in_memory_cache_size: usize, - #[serde(default)] - pub admin_username: Option<String>, - #[serde(default = "login_expire")] - pub login_expire: i64, - #[serde(default)] - pub default_permission_set: PermissionSet, -} - -#[derive(Serialize, Deserialize, Debug, Default)] -pub struct SecretsConfig { - #[serde(default)] - pub federation: HashMap<String, FederationAccount>, - #[serde(default)] - pub cookie_key: Option<String>, - #[serde(default)] - pub session_key: Option<String>, - #[serde(default)] - pub admin_password: Option<String>, -} -#[derive(Serialize, Deserialize, Debug)] -pub struct FederationAccount { - pub username: String, - pub password: String, - #[serde(default = "return_true")] - pub tls: bool, -} - -fn login_expire() -> i64 { - 60 * 60 * 24 -} -fn max_in_memory_cache_size() -> usize { - 200_000_000 -} - -fn return_true() -> bool { - true -} |