From c0805ff125c25c56aa3eec3314db101260970871 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Fri, 4 Oct 2024 18:36:32 +0200 Subject: [PATCH] fix(config): :bug: Make some default config values more sensible --- config/config.example.toml | 17 ++++++++--------- config/config.schema.json | 10 ++++------ packages/config-manager/config.type.ts | 10 ++++------ 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/config/config.example.toml b/config/config.example.toml index 7da87dc3..b1614bc6 100644 --- a/config/config.example.toml +++ b/config/config.example.toml @@ -31,7 +31,7 @@ enabled = true # Redis instance to be used as a timeline cache # Optional, can be the same as the queue instance host = "localhost" -port = 40004 +port = 6380 password = "" database = 1 enabled = false @@ -39,7 +39,7 @@ enabled = false [sonic] # If Sonic is not configured, search will not be enabled host = "localhost" -port = 40007 +port = 7700 password = "" enabled = true @@ -187,17 +187,17 @@ convert_vector = false [validation] # Checks user data # Does not retroactively apply to previously entered data -max_displayname_size = 50 -max_bio_size = 160 +max_displayname_size = 50 # Character length +max_bio_size = 5000 max_note_size = 5000 -max_avatar_size = 5_000_000 +max_avatar_size = 5_000_000 # Bytes max_header_size = 5_000_000 max_media_size = 40_000_000 max_media_attachments = 10 max_media_description_size = 1000 max_poll_options = 20 max_poll_option_size = 500 -min_poll_duration = 60 +min_poll_duration = 60 # Seconds max_poll_duration = 1893456000 max_username_size = 30 max_field_count = 10 @@ -205,8 +205,7 @@ max_field_name_size = 1000 max_field_value_size = 1000 # Forbidden usernames, defaults are from Akkoma username_blacklist = [ - ".well-known", - "~", + "well-known", "about", "activities", "api", @@ -293,7 +292,7 @@ placeholder_style = "thumbs" [federation] # This is a list of domain names, such as "mastodon.social" or "pleroma.site" # These changes will not retroactively apply to existing data before they were changed -# For that, please use the CLI +# For that, please use the CLI (in a later release) # These instances will not be federated with blocked = [] diff --git a/config/config.schema.json b/config/config.schema.json index 878bf59b..63c5ddc5 100644 --- a/config/config.schema.json +++ b/config/config.schema.json @@ -578,7 +578,7 @@ }, "max_bio_size": { "type": "integer", - "default": 160 + "default": 5000 }, "max_note_size": { "type": "integer", @@ -642,8 +642,7 @@ "type": "string" }, "default": [ - ".well-known", - "~", + "well-known", "about", "activities", "api", @@ -1932,7 +1931,7 @@ "additionalProperties": false, "default": { "max_displayname_size": 50, - "max_bio_size": 160, + "max_bio_size": 5000, "max_note_size": 5000, "max_avatar_size": 5000000, "max_header_size": 5000000, @@ -1948,8 +1947,7 @@ "max_field_name_size": 1000, "max_field_value_size": 1000, "username_blacklist": [ - ".well-known", - "~", + "well-known", "about", "activities", "api", diff --git a/packages/config-manager/config.type.ts b/packages/config-manager/config.type.ts index 861927cc..9b21a838 100644 --- a/packages/config-manager/config.type.ts +++ b/packages/config-manager/config.type.ts @@ -283,7 +283,7 @@ export const configValidator = z.object({ validation: z .object({ max_displayname_size: z.number().int().default(50), - max_bio_size: z.number().int().default(160), + max_bio_size: z.number().int().default(5000), max_note_size: z.number().int().default(5000), max_avatar_size: z.number().int().default(5000000), max_header_size: z.number().int().default(5000000), @@ -301,8 +301,7 @@ export const configValidator = z.object({ username_blacklist: z .array(z.string()) .default([ - ".well-known", - "~", + "well-known", "about", "activities", "api", @@ -371,7 +370,7 @@ export const configValidator = z.object({ }) .default({ max_displayname_size: 50, - max_bio_size: 160, + max_bio_size: 5000, max_note_size: 5000, max_avatar_size: 5000000, max_header_size: 5000000, @@ -387,8 +386,7 @@ export const configValidator = z.object({ max_field_name_size: 1000, max_field_value_size: 1000, username_blacklist: [ - ".well-known", - "~", + "well-known", "about", "activities", "api",