summaryrefslogtreecommitdiff
path: root/internal/config/config.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2022-09-29 21:50:43 +0100
committerLibravatar GitHub <noreply@github.com>2022-09-29 21:50:43 +0100
commit1d999712e6902414bbac30db8a5603758c5c539c (patch)
tree6d4da7aaa8c1e7fc94c5723703f13e5b6d062dfc /internal/config/config.go
parent[chore] Add ipv6 localhost to trusted proxies by default (#868) (diff)
downloadgotosocial-1d999712e6902414bbac30db8a5603758c5c539c.tar.xz
[feature] update config types to use bytesize.Size (#828)
* update config size types to use bytesize.Size * submit unchecked-out file ... :facepalm: * fix bytesize config var decoding * bump bytesize version * update kim's libraries in readme * update envparse.sh to output more useful errors * improve envparse.sh * remove reliance on jq * instead, use uint64 for bytesize flag types * remove redundant type * fix viper unmarshaling * Update envparsing.sh * fix envparsing test Signed-off-by: kim <grufwub@gmail.com> Co-authored-by: tobi <31960611+tsmethurst@users.noreply.github.com>
Diffstat (limited to 'internal/config/config.go')
-rw-r--r--internal/config/config.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index ff77bd367..79babf8bc 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -21,6 +21,7 @@ package config
import (
"reflect"
+ "codeberg.org/gruf/go-bytesize"
"github.com/mitchellh/mapstructure"
)
@@ -76,13 +77,13 @@ type Configuration struct {
AccountsReasonRequired bool `name:"accounts-reason-required" usage:"Do new account signups require a reason to be submitted on registration?"`
AccountsAllowCustomCSS bool `name:"accounts-allow-custom-css" usage:"Allow accounts to enable custom CSS for their profile pages and statuses."`
- MediaImageMaxSize int `name:"media-image-max-size" usage:"Max size of accepted images in bytes"`
- MediaVideoMaxSize int `name:"media-video-max-size" usage:"Max size of accepted videos in bytes"`
- MediaDescriptionMinChars int `name:"media-description-min-chars" usage:"Min required chars for an image description"`
- MediaDescriptionMaxChars int `name:"media-description-max-chars" usage:"Max permitted chars for an image description"`
- MediaRemoteCacheDays int `name:"media-remote-cache-days" usage:"Number of days to locally cache media from remote instances. If set to 0, remote media will be kept indefinitely."`
- MediaEmojiLocalMaxSize int `name:"media-emoji-local-max-size" usage:"Max size in bytes of emojis uploaded to this instance via the admin API."`
- MediaEmojiRemoteMaxSize int `name:"media-emoji-remote-max-size" usage:"Max size in bytes of emojis to download from other instances."`
+ MediaImageMaxSize bytesize.Size `name:"media-image-max-size" usage:"Max size of accepted images in bytes"`
+ MediaVideoMaxSize bytesize.Size `name:"media-video-max-size" usage:"Max size of accepted videos in bytes"`
+ MediaDescriptionMinChars int `name:"media-description-min-chars" usage:"Min required chars for an image description"`
+ MediaDescriptionMaxChars int `name:"media-description-max-chars" usage:"Max permitted chars for an image description"`
+ MediaRemoteCacheDays int `name:"media-remote-cache-days" usage:"Number of days to locally cache media from remote instances. If set to 0, remote media will be kept indefinitely."`
+ MediaEmojiLocalMaxSize bytesize.Size `name:"media-emoji-local-max-size" usage:"Max size in bytes of emojis uploaded to this instance via the admin API."`
+ MediaEmojiRemoteMaxSize bytesize.Size `name:"media-emoji-remote-max-size" usage:"Max size in bytes of emojis to download from other instances."`
StorageBackend string `name:"storage-backend" usage:"Storage backend to use for media attachments"`
StorageLocalBasePath string `name:"storage-local-base-path" usage:"Full path to an already-created directory where gts should store/retrieve media files. Subfolders will be created within this dir."`