Skip to content

Commit

Permalink
fix(config): 🐛 Make some default config values more sensible
Browse files Browse the repository at this point in the history
  • Loading branch information
CPlusPatch committed Oct 4, 2024
1 parent f9dcbb1 commit c0805ff
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
17 changes: 8 additions & 9 deletions config/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ 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

[sonic]
# If Sonic is not configured, search will not be enabled
host = "localhost"
port = 40007
port = 7700
password = ""
enabled = true

Expand Down Expand Up @@ -187,26 +187,25 @@ 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
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",
Expand Down Expand Up @@ -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 = []
Expand Down
10 changes: 4 additions & 6 deletions config/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@
},
"max_bio_size": {
"type": "integer",
"default": 160
"default": 5000
},
"max_note_size": {
"type": "integer",
Expand Down Expand Up @@ -642,8 +642,7 @@
"type": "string"
},
"default": [
".well-known",
"~",
"well-known",
"about",
"activities",
"api",
Expand Down Expand Up @@ -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,
Expand All @@ -1948,8 +1947,7 @@
"max_field_name_size": 1000,
"max_field_value_size": 1000,
"username_blacklist": [
".well-known",
"~",
"well-known",
"about",
"activities",
"api",
Expand Down
10 changes: 4 additions & 6 deletions packages/config-manager/config.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -301,8 +301,7 @@ export const configValidator = z.object({
username_blacklist: z
.array(z.string())
.default([
".well-known",
"~",
"well-known",
"about",
"activities",
"api",
Expand Down Expand Up @@ -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,
Expand All @@ -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",
Expand Down

0 comments on commit c0805ff

Please sign in to comment.