From 258c00b84c5d9aee301bd6d69732d5f0f1ff35f2 Mon Sep 17 00:00:00 2001 From: naskya Date: Mon, 1 Jul 2024 10:19:43 +0900 Subject: [PATCH] WIP --- fishctl/src/command/config/update/v1.rs | 4 +- fishctl/src/config/server.rs | 10 ++-- fishctl/src/config/template/client.toml | 4 +- fishctl/src/config/template/server.toml | 61 +++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 8 deletions(-) diff --git a/fishctl/src/command/config/update/v1.rs b/fishctl/src/command/config/update/v1.rs index 5a52173..f95bd81 100644 --- a/fishctl/src/command/config/update/v1.rs +++ b/fishctl/src/command/config/update/v1.rs @@ -366,7 +366,7 @@ fn create_new_server_config( let mut server_config = server::Config { config_revision: Revision::V1, - custom: Some(server::Custom { + server_info: Some(server::ServerInfo { name: meta.name.to_owned(), description: meta.description.to_owned(), maintainer_name: meta.maintainer_name.to_owned(), @@ -379,7 +379,7 @@ fn create_new_server_config( local: !meta.disable_local_timeline, global: !meta.disable_global_timeline, recommended: !meta.disable_recommended_timeline, - guest: meta.enable_guest_timeline, + publish: meta.enable_guest_timeline, }), network: server::Network { protocol: match protocol.as_str() { diff --git a/fishctl/src/config/server.rs b/fishctl/src/config/server.rs index e0491bf..38b689c 100644 --- a/fishctl/src/config/server.rs +++ b/fishctl/src/config/server.rs @@ -16,7 +16,7 @@ pub struct Config { #[validate(nested)] pub network: Network, #[validate(nested)] - pub custom: Option, + pub server_info: Option, #[validate(nested)] pub timeline: Option, #[validate(nested)] @@ -63,7 +63,7 @@ pub struct Proxy { } #[derive(Deserialize, Serialize, Validate, Debug, Clone)] -pub struct Custom { +pub struct ServerInfo { /// Server name pub name: Option, /// Server description @@ -77,8 +77,8 @@ pub struct Custom { /// Repository URL pub repository_url: Option, #[validate(custom(function = "validate_emoji"))] - /// Default reaction emoji - pub default_reaction: String, + /// Default reaction emoji (default: star) + pub default_reaction: Option, } #[derive(Deserialize, Serialize, Validate, Debug, Clone)] @@ -90,7 +90,7 @@ pub struct Timeline { /// Whether to enable the recommended timeline pub recommended: bool, /// Whether to publish the local/global timelines to signed out users - pub guest: bool, + pub publish: bool, } #[derive(Deserialize, Serialize, Debug, Clone)] diff --git a/fishctl/src/config/template/client.toml b/fishctl/src/config/template/client.toml index 7bfc6dc..8b47a01 100644 --- a/fishctl/src/config/template/client.toml +++ b/fishctl/src/config/template/client.toml @@ -2,4 +2,6 @@ # # 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 diff --git a/fishctl/src/config/template/server.toml b/fishctl/src/config/template/server.toml index 6b7a54a..f2498c7 100644 --- a/fishctl/src/config/template/server.toml +++ b/fishctl/src/config/template/server.toml @@ -1 +1,62 @@ # 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 = "" + +