mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-22 13:16:15 -06:00
Remove unnecessary storage config variables (#344)
* rewire config to not use extraneous serve vars * rename 'file' to 'local' for consistency * use Type and Size again
This commit is contained in:
parent
2582515b4d
commit
cb8688f429
51 changed files with 310 additions and 408 deletions
|
|
@ -98,7 +98,7 @@ var Start action.GTSAction = func(ctx context.Context) error {
|
|||
timelineManager := timelineprocessing.NewManager(dbService, typeConverter)
|
||||
|
||||
// Open the storage backend
|
||||
storageBasePath := viper.GetString(config.Keys.StorageBasePath)
|
||||
storageBasePath := viper.GetString(config.Keys.StorageLocalBasePath)
|
||||
storage, err := kv.OpenFile(storageBasePath, nil)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error creating storage backend: %s", err)
|
||||
|
|
|
|||
|
|
@ -68,10 +68,7 @@ func Media(cmd *cobra.Command, values config.Values) {
|
|||
// Storage attaches flags pertaining to storage config.
|
||||
func Storage(cmd *cobra.Command, values config.Values) {
|
||||
cmd.Flags().String(config.Keys.StorageBackend, values.StorageBackend, usage.StorageBackend)
|
||||
cmd.Flags().String(config.Keys.StorageBasePath, values.StorageBasePath, usage.StorageBasePath)
|
||||
cmd.Flags().String(config.Keys.StorageServeProtocol, values.StorageServeProtocol, usage.StorageServeProtocol)
|
||||
cmd.Flags().String(config.Keys.StorageServeHost, values.StorageServeHost, usage.StorageServeHost)
|
||||
cmd.Flags().String(config.Keys.StorageServeBasePath, values.StorageServeBasePath, usage.StorageServeBasePath)
|
||||
cmd.Flags().String(config.Keys.StorageLocalBasePath, values.StorageLocalBasePath, usage.StorageLocalBasePath)
|
||||
}
|
||||
|
||||
// Statuses attaches flags pertaining to statuses config.
|
||||
|
|
|
|||
|
|
@ -48,10 +48,7 @@ var usage = config.KeyNames{
|
|||
MediaDescriptionMinChars: "Min required chars for an image description",
|
||||
MediaDescriptionMaxChars: "Max permitted chars for an image description",
|
||||
StorageBackend: "Storage backend to use for media attachments",
|
||||
StorageBasePath: "Full path to an already-created directory where gts should store/retrieve media files. Subfolders will be created within this dir.",
|
||||
StorageServeProtocol: "Protocol to use for serving media attachments (use https if storage is local)",
|
||||
StorageServeHost: "Hostname to serve media attachments from (use the same value as host if storage is local)",
|
||||
StorageServeBasePath: "Path to append to protocol and hostname to create the base path from which media files will be served (default will mostly be fine)",
|
||||
StorageLocalBasePath: "Full path to an already-created directory where gts should store/retrieve media files. Subfolders will be created within this dir.",
|
||||
StatusesMaxChars: "Max permitted characters for posted statuses",
|
||||
StatusesCWMaxChars: "Max permitted characters for content/spoiler warnings on statuses",
|
||||
StatusesPollMaxOptions: "Max amount of options permitted on a poll",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue