add: image proxy

add: mentions in posts
TODO: audit log, reports, user mod panel
This commit is contained in:
trisua 2025-04-01 13:26:33 -04:00
parent e183a01887
commit 3a8af17154
14 changed files with 308 additions and 33 deletions

View file

@ -124,6 +124,14 @@ pub struct Config {
/// The port to serve the server on.
#[serde(default = "default_port")]
pub port: u16,
/// A list of hosts which cannot be proxied through the image proxy.
///
/// They will return the default banner image instead of proxying.
///
/// It is recommended to put the host of your own public server in this list in
/// order to prevent a way too easy DOS.
#[serde(default = "default_banned_hosts")]
pub banned_hosts: Vec<String>,
/// Database security.
#[serde(default = "default_security")]
pub security: SecurityConfig,
@ -157,6 +165,10 @@ fn default_port() -> u16 {
4118
}
fn default_banned_hosts() -> Vec<String> {
Vec::new()
}
fn default_security() -> SecurityConfig {
SecurityConfig::default()
}
@ -193,6 +205,7 @@ impl Default for Config {
description: default_description(),
color: default_color(),
port: default_port(),
banned_hosts: default_banned_hosts(),
database: default_database(),
security: default_security(),
dirs: default_dirs(),