This commit is contained in:
naskya 2024-07-01 10:19:43 +09:00
parent 9973ee7029
commit 258c00b84c
Signed by: naskya
GPG key ID: 712D413B3A9FED5C
4 changed files with 71 additions and 8 deletions

View file

@ -366,7 +366,7 @@ fn create_new_server_config(
let mut server_config = server::Config { let mut server_config = server::Config {
config_revision: Revision::V1, config_revision: Revision::V1,
custom: Some(server::Custom { server_info: Some(server::ServerInfo {
name: meta.name.to_owned(), name: meta.name.to_owned(),
description: meta.description.to_owned(), description: meta.description.to_owned(),
maintainer_name: meta.maintainer_name.to_owned(), maintainer_name: meta.maintainer_name.to_owned(),
@ -379,7 +379,7 @@ fn create_new_server_config(
local: !meta.disable_local_timeline, local: !meta.disable_local_timeline,
global: !meta.disable_global_timeline, global: !meta.disable_global_timeline,
recommended: !meta.disable_recommended_timeline, recommended: !meta.disable_recommended_timeline,
guest: meta.enable_guest_timeline, publish: meta.enable_guest_timeline,
}), }),
network: server::Network { network: server::Network {
protocol: match protocol.as_str() { protocol: match protocol.as_str() {

View file

@ -16,7 +16,7 @@ pub struct Config {
#[validate(nested)] #[validate(nested)]
pub network: Network, pub network: Network,
#[validate(nested)] #[validate(nested)]
pub custom: Option<Custom>, pub server_info: Option<ServerInfo>,
#[validate(nested)] #[validate(nested)]
pub timeline: Option<Timeline>, pub timeline: Option<Timeline>,
#[validate(nested)] #[validate(nested)]
@ -63,7 +63,7 @@ pub struct Proxy {
} }
#[derive(Deserialize, Serialize, Validate, Debug, Clone)] #[derive(Deserialize, Serialize, Validate, Debug, Clone)]
pub struct Custom { pub struct ServerInfo {
/// Server name /// Server name
pub name: Option<String>, pub name: Option<String>,
/// Server description /// Server description
@ -77,8 +77,8 @@ pub struct Custom {
/// Repository URL /// Repository URL
pub repository_url: Option<String>, pub repository_url: Option<String>,
#[validate(custom(function = "validate_emoji"))] #[validate(custom(function = "validate_emoji"))]
/// Default reaction emoji /// Default reaction emoji (default: star)
pub default_reaction: String, pub default_reaction: Option<String>,
} }
#[derive(Deserialize, Serialize, Validate, Debug, Clone)] #[derive(Deserialize, Serialize, Validate, Debug, Clone)]
@ -90,7 +90,7 @@ pub struct Timeline {
/// Whether to enable the recommended timeline /// Whether to enable the recommended timeline
pub recommended: bool, pub recommended: bool,
/// Whether to publish the local/global timelines to signed out users /// Whether to publish the local/global timelines to signed out users
pub guest: bool, pub publish: bool,
} }
#[derive(Deserialize, Serialize, Debug, Clone)] #[derive(Deserialize, Serialize, Debug, Clone)]

View file

@ -2,4 +2,6 @@
# #
# DO NOT WRITE ANY SENSITIVE INFORMATION TO THIS FILE, EVEN IN COMMENTS! # DO NOT WRITE ANY SENSITIVE INFORMATION TO THIS FILE, EVEN IN COMMENTS!
# #
# This file is read from the web client (browser), so the content will be exposed. # The file content may be exposed to the Internet and directly read
# from the web client (browser) in the future.
config_revision = 1

View file

@ -1 +1,62 @@
# Firefish server configuration (config/server.toml) # Firefish server configuration (config/server.toml)
config_revision = 1
[network]
# the protocol used for federation and web UI
# must be "https" or "http" (default: https)
protocol = "https"
# the domain name
domain = "example.com"
# the port number used for federation and web UI
# (default: 443 for https protocol, 80 for http protocol)
port = 443
[network.listen]
host = "127.0.0.1"
port = 3000
# HTTP(S) proxy
[network.http_proxy]
enabled = false
url = "https://example.org"
# the list of hosts to bypass the proxy
bypass = ["127.0.0.10", "example.net"]
# SMTP(S) proxy
[network.smtp_proxy]
enabled = false
url = "socks5://example.org"
# the list of hosts to bypass the proxy
bypass = ["127.0.0.10", "example.net"]
# Media proxy (https://github.com/misskey-dev/media-proxy)
[network.media_proxy]
enabled = false
url = "https://example.org/media_proxy/"
# the list of hosts to bypass the proxy
bypass = ["127.0.0.10", "example.net"]
# Summaly proxy (https://github.com/misskey-dev/summaly)
[network.summaly_proxy]
enabled = false
url = "https://example.org/summaly_proxy/"
# the list of hosts to bypass the proxy
bypass = ["127.0.0.10", "example.net"]
[server_info]
name = "Firefish"
description = ""
maintainer_name = ""
contact_info = ""
open_registrations = false
# custom repository URL (for forks)
repository_url = ""