From 49dacb2418821d354afbd8852967ad85a4a104e5 Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 20 Jun 2024 07:52:50 +0900 Subject: [PATCH] WIP --- src/command/config/migrate/v20240701.rs | 80 +++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/src/command/config/migrate/v20240701.rs b/src/command/config/migrate/v20240701.rs index 8879e21..078e785 100644 --- a/src/command/config/migrate/v20240701.rs +++ b/src/command/config/migrate/v20240701.rs @@ -62,6 +62,86 @@ fn read_default_yml() -> Result, ReadYamlConfigError> { Ok(res) } +struct Meta { + name: Option, + description: Option, + maintainer_name: Option, + maintainer_email: Option, + disable_registration: bool, + disable_local_timeline: bool, + disable_global_timeline: bool, + banner_url: Option, + error_image_url: Option, + icon_url: Option, + cache_remote_files: bool, + enable_recaptcha: bool, + recaptcha_site_key: Option, + recaptcha_secret_key: Option, + local_drive_capacity_mb: u64, + remote_drive_capacity_mb: u64, + summaly_proxy: Option, + enable_email: bool, + email: Option, + smtp_secure: bool, + smtp_host: Option, + smtp_port: Option, + smtp_user: Option, + smtp_pass: Option, + enable_service_worker: bool, + sw_public_key: Option, + sw_private_key: Option, + pinned_users: Vec, + tos_url: Option, + repository_url: String, + feedback_url: Option, + use_object_storage: bool, + object_storage_bucket: Option, + object_storage_prefix: Option, + object_storage_base_url: Option, + object_storage_endpoint: Option, + object_storage_region: Option, + object_storage_access_key: Option, + object_storage_secret_key: Option, + object_storage_port: u16, + object_storage_use_ssl: bool, + object_storage_set_public_read: bool, + object_storage_s3_force_path_style: bool, + proxy_account_id: String, + object_storage_use_proxy: bool, + enable_hcaptcha: bool, + hcaptcha_site_key: Option, + hcaptcha_secret_key: Option, + background_image_url: Option, + logo_image_url: Option, + pinned_clip_id: Option, + allowed_hosts: Vec, + secure_mode: bool, + private_mode: bool, + deepl_auth_key: Option, + deepl_is_pro: bool, + email_required_for_signup: bool, + theme_color: Option, + default_light_theme: Option, + default_dark_theme: Option, + enable_ip_logging: bool, + enable_active_email_validation: bool, + custom_motd: Vec, + custom_splash_icons: Vec, + disable_recommended_timeline: bool, + recommended_instances: Vec, + enable_guest_timeline: bool, + default_reaction: String, + libre_translate_api_url: Option, + libre_translate_api_key: Option, + enable_server_machine_stats: bool, + enable_identicon_generation: bool, + donation_link: Option, + mark_local_files_nsfw_by_default: bool, + antenna_limit: u8, + // more_urls: jsonb + // experimental_features: jsonb +} + async fn read_meta_table( host: &str, port: u16,