From 7bc2f9fd6df0466f3f9ffb5b415612fbf68f4c95 Mon Sep 17 00:00:00 2001 From: Nutomic Date: Wed, 8 Jun 2022 15:44:53 +0000 Subject: [PATCH] Remove unused setup config vars (#2302) --- config/defaults.hjson | 18 ++-------------- crates/api_crud/src/site/read.rs | 15 +------------- crates/utils/src/settings/structs.rs | 31 ++-------------------------- 3 files changed, 5 insertions(+), 59 deletions(-) diff --git a/config/defaults.hjson b/config/defaults.hjson index 681e60966..caed23e97 100644 --- a/config/defaults.hjson +++ b/config/defaults.hjson @@ -91,25 +91,11 @@ # Username for the admin user admin_username: "admin" # Password for the admin user. It must be at least 10 characters. - admin_password: "my_passwd_longer_than_ten_characters" + admin_password: "tf6HHDS4RolWfFhk4Rq9" # Name of the site (can be changed later) site_name: "My Lemmy Instance" # Email for the admin user (optional, can be omitted and set later through the website) - admin_email: "string" - sidebar: "string" - description: "string" - icon: "string" - banner: "string" - enable_downvotes: true - open_registration: true - enable_nsfw: true - community_creation_admin_only: true - require_email_verification: true - require_application: true - application_question: "string" - private_instance: true - default_theme: "string" - default_post_listing_type: "string" + admin_email: "user@example.com" } # the domain name of your instance (mandatory) hostname: "unset" diff --git a/crates/api_crud/src/site/read.rs b/crates/api_crud/src/site/read.rs index 808dcf7d9..1ef84a91f 100644 --- a/crates/api_crud/src/site/read.rs +++ b/crates/api_crud/src/site/read.rs @@ -54,21 +54,8 @@ impl PerformCrud for GetSite { let create_site = CreateSite { name: setup.site_name.to_owned(), - sidebar: setup.sidebar.to_owned(), - description: setup.description.to_owned(), - icon: setup.icon.to_owned(), - banner: setup.banner.to_owned(), - enable_downvotes: setup.enable_downvotes, - open_registration: setup.open_registration, - enable_nsfw: setup.enable_nsfw, - community_creation_admin_only: setup.community_creation_admin_only, - require_email_verification: setup.require_email_verification, - require_application: setup.require_application, - application_question: setup.application_question.to_owned(), - private_instance: setup.private_instance, - default_theme: setup.default_theme.to_owned(), - default_post_listing_type: setup.default_post_listing_type.to_owned(), auth: admin_jwt, + ..CreateSite::default() }; create_site.perform(context, websocket_id).await?; info!("Site {} created", setup.site_name); diff --git a/crates/utils/src/settings/structs.rs b/crates/utils/src/settings/structs.rs index 561d5cec9..f57410ee3 100644 --- a/crates/utils/src/settings/structs.rs +++ b/crates/utils/src/settings/structs.rs @@ -183,40 +183,13 @@ pub struct SetupConfig { #[doku(example = "admin")] pub admin_username: String, /// Password for the admin user. It must be at least 10 characters. - #[doku(example = "my_passwd_longer_than_ten_characters")] + #[doku(example = "tf6HHDS4RolWfFhk4Rq9")] pub admin_password: String, /// Name of the site (can be changed later) #[doku(example = "My Lemmy Instance")] pub site_name: String, /// Email for the admin user (optional, can be omitted and set later through the website) + #[doku(example = "user@example.com")] #[default(None)] pub admin_email: Option, - #[default(None)] - pub sidebar: Option, - #[default(None)] - pub description: Option, - #[default(None)] - pub icon: Option, - #[default(None)] - pub banner: Option, - #[default(None)] - pub enable_downvotes: Option, - #[default(None)] - pub open_registration: Option, - #[default(None)] - pub enable_nsfw: Option, - #[default(None)] - pub community_creation_admin_only: Option, - #[default(None)] - pub require_email_verification: Option, - #[default(None)] - pub require_application: Option, - #[default(None)] - pub application_question: Option, - #[default(None)] - pub private_instance: Option, - #[default(None)] - pub default_theme: Option, - #[default(None)] - pub default_post_listing_type: Option, }