add instance motto config option

This commit is contained in:
blek 2023-10-21 11:55:07 +10:00
parent 6a95446ebe
commit 352444198f
Signed by: blek
GPG Key ID: 14546221E3595D0C
2 changed files with 11 additions and 2 deletions

View File

@ -46,6 +46,10 @@ file_del_timeout=1800
# Change it to fit your website's image # Change it to fit your website's image
instance_name="blek! File" instance_name="blek! File"
# Instance motto.
# Leave a blank string to disable
instance_motto="A minute file sharing service"
# URL of the instance. # URL of the instance.
# You must set this to a valid URL # You must set this to a valid URL
instance_url="" instance_url=""

View File

@ -53,16 +53,21 @@ pub struct Branding {
/// Instance name /// Instance name
#[serde(default)] #[serde(default)]
instance_name: String, instance_name: String,
/// Instance motto
#[serde(default)]
instance_motto: String,
/// Instance URL (not the bind URL). Must be Some(...) /// Instance URL (not the bind URL). Must be Some(...)
#[serde(default)] #[serde(default)]
instance_url: Option<String> instance_url: Option<String>,
} }
impl Default for Branding { impl Default for Branding {
fn default() -> Self { fn default() -> Self {
Branding { Branding {
instance_name: "blek! File".into(), instance_name: "blek! File".into(),
instance_motto: "A minute file sharing".into(),
instance_url: None, instance_url: None,
} }
} }
@ -94,7 +99,7 @@ impl Config {
pub fn validate(self: &Self) -> Result<(), String> { pub fn validate(self: &Self) -> Result<(), String> {
self.files.validate()?; self.files.validate()?;
self.brand.validate()?; self.brand.validate()?;
Ok(()) Ok(())
} }