This commit is contained in:
naskya 2024-06-20 12:47:56 +09:00
parent 507b00c936
commit 05fc5bdbc4
Signed by: naskya
GPG key ID: 712D413B3A9FED5C

View file

@ -2,6 +2,7 @@
//! <https://firefish.dev/firefish/firefish/-/issues/10947> //! <https://firefish.dev/firefish/firefish/-/issues/10947>
use crate::config::{client, server}; use crate::config::{client, server};
use color_print::cprintln;
use sqlx::{postgres::PgConnectOptions, ConnectOptions}; use sqlx::{postgres::PgConnectOptions, ConnectOptions};
use std::{ use std::{
collections::HashMap, collections::HashMap,
@ -265,10 +266,9 @@ fn create_new_server_config(
let repository_url = match meta.repository_url.as_ref() { let repository_url = match meta.repository_url.as_ref() {
"https://codeberg.org/calckey/calckey" "https://codeberg.org/calckey/calckey"
| "https://codeberg.org/firefish/firefish" | "https://codeberg.org/firefish/firefish"
| "https://git.joinfirefish.org/firefish/firefish" => { | "https://git.joinfirefish.org/firefish/firefish"
"https://firefish.dev/firefish/firefish".to_owned() | "https://firefish.dev/firefish/firefish" => None,
} url => Some(url.to_owned()),
url => url.to_owned(),
}; };
let mut server_config = server::Config { let mut server_config = server::Config {
@ -278,7 +278,7 @@ fn create_new_server_config(
maintainer_name: meta.maintainer_name.to_owned(), maintainer_name: meta.maintainer_name.to_owned(),
contact_info: meta.maintainer_email.to_owned(), contact_info: meta.maintainer_email.to_owned(),
open_registrations: !meta.disable_registration, open_registrations: !meta.disable_registration,
repository_url: Some(repository_url), repository_url,
}), }),
timelines: Some(server::Timelines { timelines: Some(server::Timelines {
local: !meta.disable_local_timeline, local: !meta.disable_local_timeline,
@ -444,6 +444,7 @@ pub(super) async fn run() -> Result<(), Error> {
.as_bytes(), .as_bytes(),
) )
.map_err(WriteTomlConfigError::ServerWrite)?; .map_err(WriteTomlConfigError::ServerWrite)?;
cprintln!("<g>config/server.toml</> has been created!");
let mut client_toml = let mut client_toml =
fs::File::create_new("config/client.toml").map_err(WriteTomlConfigError::ClientWrite)?; fs::File::create_new("config/client.toml").map_err(WriteTomlConfigError::ClientWrite)?;
@ -454,6 +455,7 @@ pub(super) async fn run() -> Result<(), Error> {
.as_bytes(), .as_bytes(),
) )
.map_err(WriteTomlConfigError::ClientWrite)?; .map_err(WriteTomlConfigError::ClientWrite)?;
cprintln!("<g>config/client.toml</> has been created!");
Ok(()) Ok(())
} }