diff --git a/config b/config index 276d777..b8e5646 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit 276d7777d1de147baf5c37c3578ef8384a68c63d +Subproject commit b8e5646d68ba1cd4f7fa985e202a10a40bcb0815 diff --git a/magefiles/config.go b/magefiles/config.go index 739c18f..dc04c83 100644 --- a/magefiles/config.go +++ b/magefiles/config.go @@ -73,6 +73,8 @@ type gotosocialConfig struct { AccountsRegistrationOpen bool `json:"accountsRegistrationOpen"` AccountsAllowCustomCss bool `json:"accountsAllowCustomCss"` LandingPageUser string `json:"landingPageUser"` + WebBaseDirectory string `json:"webBaseDirectory"` + TZ string `json:"tz"` } type woodpeckerConfig struct { diff --git a/templates/compose/docker-compose.yaml.gotmpl b/templates/compose/docker-compose.yaml.gotmpl index 0c48ac0..2b09f11 100644 --- a/templates/compose/docker-compose.yaml.gotmpl +++ b/templates/compose/docker-compose.yaml.gotmpl @@ -86,6 +86,8 @@ services: image: "localhost/flow/gotosocial:{{ .GoToSocial.Version }}" build: context: "../gotosocial" + environment: + TZ: {{ .GoToSocial.TZ }} expose: - "{{ .GoToSocial.Port }}" networks: diff --git a/templates/gotosocial/Dockerfile.gotmpl b/templates/gotosocial/Dockerfile.gotmpl index 9d18216..ea37724 100644 --- a/templates/gotosocial/Dockerfile.gotmpl +++ b/templates/gotosocial/Dockerfile.gotmpl @@ -11,11 +11,11 @@ RUN --mount=type=bind,source=.,target=/packages \ && tar xzvf /packages/gotosocial_{{ .GoToSocial.Version }}_linux_amd64.tar.gz \ && tar xzvf /packages/gotosocial_{{ .GoToSocial.Version }}_web-assets.tar.gz \ && mv /tmp/gotosocial /usr/local/bin/gotosocial \ - && mv /tmp/web /flow/gts \ + && mv /tmp/web {{ .GoToSocial.WebBaseDirectory }} \ && cp /packages/entrypoint.sh /usr/local/bin/entrypoint \ && cp /packages/config.yaml /flow/gts/config/config.yaml \ - && cp /packages/assets/images/background.jpg /flow/gts/web/assets/background.jpg \ - && cp /packages/assets/fonts/* /flow/gts/web/assets/fonts/ \ + && cp /packages/assets/images/background.jpg {{ .GoToSocial.WebBaseDirectory }}/assets/background.jpg \ + && cp /packages/assets/fonts/* {{ .GoToSocial.WebBaseDirectory }}/assets/fonts/ \ && chown -R {{ .GoToSocial.LinuxUID }}:{{ .FlowGID }} /flow/gts \ && chmod a+x /usr/local/bin/entrypoint \ && rm -rf /tmp/* diff --git a/templates/gotosocial/config.yaml.gotmpl b/templates/gotosocial/config.yaml.gotmpl index 06cf092..f178f45 100644 --- a/templates/gotosocial/config.yaml.gotmpl +++ b/templates/gotosocial/config.yaml.gotmpl @@ -193,10 +193,6 @@ db-tls-ca-cert: "" # # If you set the multiplier to less than 1, only one open connection will be used regardless of cpu count. # -# PLEASE NOTE!!: This setting currently only applies for Postgres. SQLite will always use 1 connection regardless -# of what is set here. This behavior will change in future when we implement better SQLITE_BUSY handling. -# See https://github.com/superseriousbusiness/gotosocial/issues/1407 for more details. -# # Examples: [16, 8, 10, 2] # Default: 8 db-max-open-conns-multiplier: 8 @@ -234,107 +230,13 @@ db-sqlite-cache-size: "8MiB" db-sqlite-busy-timeout: "30m" cache: - # Cache configuration options: - # - # max-size = maximum cached objects count - # ttl = cached object lifetime - # sweep-freq = frequency to look for stale cache objects - # (zero will disable cache sweeping) - - ############################# - #### VISIBILITY CACHES ###### - ############################# - # - # Configure Status and account - # visibility cache. - - visibility-max-size: 2000 - visibility-ttl: "30m" - visibility-sweep-freq: "1m" - - gts: - ########################### - #### DATABASE CACHES ###### - ########################### - # - # Configure GTS database - # model caches. - - account-max-size: 2000 - account-ttl: "30m" - account-sweep-freq: "1m" - - block-max-size: 1000 - block-ttl: "30m" - block-sweep-freq: "1m" - - domain-block-max-size: 2000 - domain-block-ttl: "24h" - domain-block-sweep-freq: "1m" - - emoji-max-size: 2000 - emoji-ttl: "30m" - emoji-sweep-freq: "1m" - - emoji-category-max-size: 100 - emoji-category-ttl: "30m" - emoji-category-sweep-freq: "1m" - - follow-max-size: 2000 - follow-ttl: "30m" - follow-sweep-freq: "1m" - - follow-request-max-size: 2000 - 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" - - list-entry-max-size: 2000 - list-entry-ttl: "30m" - list-entry-sweep-freq: "1m" - - media-max-size: 1000 - media-ttl: "30m" - media-sweep-freq: "1m" - - mention-max-size: 2000 - mention-ttl: "30m" - mention-sweep-freq: "1m" - - notification-max-size: 1000 - notification-ttl: "30m" - notification-sweep-freq: "1m" - - report-max-size: 100 - report-ttl: "30m" - report-sweep-freq: "1m" - - status-max-size: 2000 - status-ttl: "30m" - status-sweep-freq: "1m" - - status-fave-max-size: 2000 - status-fave-ttl: "30m" - status-fave-sweep-freq: "1m" - - tombstone-max-size: 500 - tombstone-ttl: "30m" - tombstone-sweep-freq: "1m" - - user-max-size: 500 - user-ttl: "30m" - user-sweep-freq: "1m" - - webfinger-max-size: 250 - webfinger-ttl: "24h" - webfinger-sweep-freq: "15m" + # cache.memory-target sets a target limit that + # the application will try to keep it's caches + # within. This is based on estimated sizes of + # in-memory objects, and so NOT AT ALL EXACT. + # Examples: ["100MiB", "200MiB", "500MiB", "1GiB"] + # Default: "100MiB" + memory-target: "100MiB" ###################### ##### WEB CONFIG ##### @@ -345,12 +247,12 @@ cache: # String. Directory from which gotosocial will attempt to load html templates (.tmpl files). # Examples: ["/some/absolute/path/", "./relative/path/", "../../some/weird/path/"] # Default: "./web/template/" -web-template-base-dir: "/flow/gts/web/template/" +web-template-base-dir: "{{ .GoToSocial.WebBaseDirectory }}/template/" # String. Directory from which gotosocial will attempt to serve static web assets (images, scripts). # Examples: ["/some/absolute/path/", "./relative/path/", "../../some/weird/path/"] # Default: "./web/assets/" -web-asset-base-dir: "/flow/gts/web/assets/" +web-asset-base-dir: "{{ .GoToSocial.WebBaseDirectory }}/assets/" ########################### ##### INSTANCE CONFIG ##### @@ -399,6 +301,15 @@ instance-expose-public-timeline: false # Default: true instance-deliver-to-shared-inboxes: true +# Bool. This flag will inject a Mastodon version into the version field that +# is included in /api/v1/instance. This version is often used by Mastodon clients +# to do API feature detection. By injecting a Mastodon compatible version, it is +# possible to cajole those clients to behave correctly with GoToSocial. +# +# Options: [true, false] +# Default: false +instance-inject-mastodon-version: false + ########################### ##### ACCOUNTS CONFIG ##### ########################### @@ -477,8 +388,8 @@ media-description-max-chars: 500 # # If this is set to 0, then media from remote instances will be cached indefinitely. # Examples: [30, 60, 7, 0] -# Default: 30 -media-remote-cache-days: 30 +# Default: 7 +media-remote-cache-days: 7 # Int. Max size in bytes of emojis uploaded to this instance via the admin API. # The default is the same as the Mastodon size limit for emojis (50kb), which allows @@ -870,6 +781,18 @@ http-client: allow-ips: [] block-ips: [] + # Bool. Disable verification of TLS certificates of remote servers. + # With this set to 'true', GoToSocial will not error when a remote + # server presents an invalid or self-signed certificate. + # + # THIS SETTING SHOULD BE USED FOR TESTING ONLY! IF YOU TURN THIS + # ON WHILE RUNNING IN PRODUCTION YOU ARE LEAVING YOUR SERVER WIDE + # OPEN TO MAN IN THE MIDDLE ATTACKS! DO NOT CHANGE THIS SETTING + # UNLESS YOU KNOW EXACTLY WHAT YOU'RE DOING AND WHY YOU'RE DOING IT. + # + # Default: false + tls-insecure-skip-verify: false + ############################# ##### ADVANCED SETTINGS ##### #############################