[bugfix] Align default values in the configuration file with the code (#1971)

* Set default value of SMTPFrom to empty string

This parameter should contain proper e-mail address (to be provided by user during configuration).

* Update default values in example/config.yaml

Default values and related comments in example/config.yaml are aligned
with values defined in internal/config/defaults.go.
Small improvements to foramting of config.yaml file.

* Add default value for AdvancedThrottlingRetryAfter to internal/config/defaults.go

AdvancedThrottlingRetryAfter was introduced in 70739d3 (superseriousbusiness/gotosocial#1466).

* Update config.yaml snippets in documentation
This commit is contained in:
firescry 2023-07-12 10:28:41 +02:00 committed by GitHub
parent f5d6503aad
commit 8d92b2479f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 55 additions and 32 deletions

View file

@ -80,6 +80,13 @@ advanced-rate-limit-requests: 300
# Default: 8
advanced-throttling-multiplier: 8
# Duration. Time period to use as the "retry-after" header value in response to throttled requests.
# Minimum resolution is 1 second.
#
# Examples: [30s, 10s, 5s, 1m]
# Default: "30s"
advanced-throttling-retry-after: "30s"
# Int. CPU multiplier for the amount of goroutines to spawn in order to send messages via ActivityPub.
# Messages will be batched so that at most multiplier * CPU count messages will be sent out at once.
# This can be tuned to limit concurrent POSTing to remote inboxes, preventing your instance CPU

View file

@ -165,6 +165,6 @@ db-sqlite-cache-size: "8MiB"
# If set to empty string or zero, the sqlite default will be used.
# See: https://www.sqlite.org/pragma.html#pragma_busy_timeout
# Examples: ["0s", "1s", "30s", "1m", "5m"]
# Default: "5s"
db-sqlite-busy-timeout: "5m"
# Default: "30m"
db-sqlite-busy-timeout: "30m"
```

View file

@ -23,11 +23,21 @@ log-level: "info"
# Default: false
log-db-queries: false
# Bool. Include the client IP in the emitted log lines
# Options: [true, false]
# Default: true
log-client-ip: true
# String. Application name to use internally.
# Examples: ["My Application","gotosocial"]
# Default: "gotosocial"
application-name: "gotosocial"
# String. The user that will be shown instead of the landing page. if no user is set, the landing page will be shown.
# Examples: "admin"
# Default: ""
landing-page-user: ""
# String. Hostname that this server will be reachable at. Defaults to localhost for local testing,
# but you should *definitely* change this when running for real, or your server won't work at all.
# DO NOT change this after your server has already run once, or you will break things!
@ -44,7 +54,9 @@ host: "localhost"
#
# You should also redirect requests at "example.org/.well-known/nodeinfo" in the same way.
#
# You should also redirect requests at "example.org/.well-known/host-meta" in the same way. This endpoint is used by a number of clients to discover the API endpoint to use when the host and account domain are different.
# You should also redirect requests at "example.org/.well-known/host-meta" in the same way. This endpoint
# is used by a number of clients to discover the API endpoint to use when the host and account domain are
# different.
#
# An empty string (ie., not set) means that the same value as 'host' will be used.
#

View file

@ -7,7 +7,7 @@
##### MEDIA CONFIG #####
########################
# Config pertaining to user media uploads (videos, image, image descriptions).
# Config pertaining to media uploads (videos, image, image descriptions, emoji).
# Int. Maximum allowed image upload size in bytes.
# Examples: [2097152, 10485760]
@ -53,6 +53,6 @@ media-emoji-local-max-size: 51200
# This strikes a good balance between decent interoperability with instances that have
# higher emoji size limits, and not taking up too much space in storage.
# Examples: [51200, 102400]
# Default: 51200
# Default: 102400
media-emoji-remote-max-size: 102400
```

View file

@ -9,10 +9,6 @@ These settings let you tune and configure certain observability related behaviou
##### OBSERVABILITY SETTINGS #####
##################################
# Bool. Enable generation/parsing of a request ID for each received HTTP Request.
# Default: true
request-id-enabled: true
# String. Header name to use to extract a request or trace ID from. Typically set by a
# loadbalancer or proxy.
# Default: "X-Request-Id"

View file

@ -79,9 +79,8 @@ oidc-scopes:
# Default: false
oidc-link-existing: false
# Array of string. If the returned ID token contains a 'groups' claim that
# matches one of the groups in oidc-admin-groups, then this user will be granted
# admin rights on the GtS instance
# Array of string. If the returned ID token contains a 'groups' claim that matches one of the
# groups in oidc-admin-groups, then this user will be granted admin rights on the GtS instance
# Default: []
oidc-admin-groups: []
```

View file

@ -24,11 +24,9 @@ storage-local-base-path: "/gotosocial/storage"
# String. API endpoint of the S3 compatible service.
# Only required when running with the s3 storage backend.
#
# If your endpoint contains the bucket name, all files will be put into a
# subdirectory with the name of `storage-s3-bucket`
#
# Examples: ["minio:9000", "s3.nl-ams.scw.cloud", "s3.us-west-002.backblazeb2.com"]
# GoToSocial uses "DNS-style" when accessing buckets.
# If you are using Scaleways object storage, please remove the "bucket name" from the endpoint address
# Default: ""
storage-s3-endpoint: ""
@ -36,6 +34,7 @@ storage-s3-endpoint: ""
#
# Default: false
storage-s3-proxy: false
# Bool. Use SSL for S3 connections.
#
# Only set this to 'false' when testing locally.
@ -49,12 +48,14 @@ storage-s3-use-ssl: true
# Examples: ["AKIAJSIE27KKMHXI3BJQ","miniouser"]
# Default: ""
storage-s3-access-key: ""
# String. Secret key part of the S3 credentials.
# Consider setting this value using environment variables to avoid leaking it via the config file
# Only required when running with the s3 storage backend.
# Examples: ["5bEYu26084qjSFyclM/f2pz4gviSfoOg+mFwBH39","miniopassword"]
# Default: ""
storage-s3-secret-key: ""
# String. Name of the storage bucket.
#
# If you have already encoded your bucket name in the storage-s3-endpoint, this

View file

@ -32,7 +32,7 @@ syslog-enabled: false
# String. Protocol to use when directing logs to syslog. Leave empty to connect to local syslog.
# Options: ["udp", "tcp", ""]
# Default: "tcp"
# Default: "udp"
syslog-protocol: "udp"
# String. Address:port to send syslog logs to. Leave empty to connect to local syslog.

View file

@ -231,8 +231,8 @@ db-sqlite-cache-size: "8MiB"
# If set to empty string or zero, the sqlite default will be used.
# See: https://www.sqlite.org/pragma.html#pragma_busy_timeout
# Examples: ["0s", "1s", "30s", "1m", "5m"]
# Default: "5s"
db-sqlite-busy-timeout: "5m"
# Default: "30m"
db-sqlite-busy-timeout: "30m"
cache:
# Cache configuration options:
@ -265,7 +265,7 @@ cache:
account-ttl: "30m"
account-sweep-freq: "1m"
block-max-size: 100
block-max-size: 1000
block-ttl: "30m"
block-sweep-freq: "1m"
@ -289,6 +289,10 @@ cache:
follow-request-ttl: "30m"
follow-request-sweep-freq: "1m"
instance-max-size: 2000
instance-ttl: "30m"
instance-sweep-freq: "1m"
list-max-size: 2000
list-ttl: "30m"
list-sweep-freq: "1m"
@ -331,7 +335,7 @@ cache:
webfinger-max-size: 250
webfinger-ttl: "24h"
webfinger-sweep-freq: "1m"
webfinger-sweep-freq: "15m"
######################
##### WEB CONFIG #####
@ -490,7 +494,7 @@ media-emoji-local-max-size: 51200
# This strikes a good balance between decent interoperability with instances that have
# higher emoji size limits, and not taking up too much space in storage.
# Examples: [51200, 102400]
# Default: 51200
# Default: 102400
media-emoji-remote-max-size: 102400
##########################
@ -524,6 +528,7 @@ storage-s3-endpoint: ""
#
# Default: false
storage-s3-proxy: false
# Bool. Use SSL for S3 connections.
#
# Only set this to 'false' when testing locally.
@ -537,12 +542,14 @@ storage-s3-use-ssl: true
# Examples: ["AKIAJSIE27KKMHXI3BJQ","miniouser"]
# Default: ""
storage-s3-access-key: ""
# String. Secret key part of the S3 credentials.
# Consider setting this value using environment variables to avoid leaking it via the config file
# Only required when running with the s3 storage backend.
# Examples: ["5bEYu26084qjSFyclM/f2pz4gviSfoOg+mFwBH39","miniopassword"]
# Default: ""
storage-s3-secret-key: ""
# String. Name of the storage bucket.
#
# If you have already encoded your bucket name in the storage-s3-endpoint, this
@ -775,7 +782,7 @@ syslog-enabled: false
# String. Protocol to use when directing logs to syslog. Leave empty to connect to local syslog.
# Options: ["udp", "tcp", ""]
# Default: "tcp"
# Default: "udp"
syslog-protocol: "udp"
# String. Address:port to send syslog logs to. Leave empty to connect to local syslog.
@ -939,7 +946,7 @@ advanced-throttling-multiplier: 8
# Minimum resolution is 1 second.
#
# Examples: [30s, 10s, 5s, 1m]
# Default: 30s
# Default: "30s"
advanced-throttling-retry-after: "30s"
# Int. CPU multiplier for the amount of goroutines to spawn in order to send messages via ActivityPub.

View file

@ -107,7 +107,7 @@ var Defaults = Configuration{
SMTPPort: 0,
SMTPUsername: "",
SMTPPassword: "",
SMTPFrom: "GoToSocial",
SMTPFrom: "",
SMTPDiscloseRecipients: false,
TracingEnabled: false,
@ -122,7 +122,8 @@ var Defaults = Configuration{
AdvancedCookiesSamesite: "lax",
AdvancedRateLimitRequests: 300, // 1 per second per 5 minutes
AdvancedThrottlingMultiplier: 8, // 8 open requests per CPU
AdvancedSenderMultiplier: 2, // 2 senders per CPU
AdvancedThrottlingRetryAfter: time.Second * 30,
AdvancedSenderMultiplier: 2, // 2 senders per CPU
Cache: CacheConfiguration{
GTS: GTSCacheConfiguration{