Skip to content
Snippets Groups Projects
Commit bca9c555 authored by Travis Ralston's avatar Travis Ralston
Browse files

Remove storagePaths support

parent 8d97a38b
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Changed
* Deprecated support for restricting uploads to certain mime types, due to inability to make it work correctly with encrypted media.
* Removed deprecated `storagePaths` config option. Please use datastores.
### Fixed
......
......@@ -23,7 +23,6 @@ func NewDefaultMinimumRepoConfig() MinimumRepoConfig {
MaxSizeBytes: 104857600, // 100mb
MinSizeBytes: 100,
ReportedMaxSizeBytes: 0,
StoragePaths: []string{},
AllowedTypes: []string{"*/*"},
},
Identicons: IdenticonsConfig{
......
......@@ -7,7 +7,6 @@ type ArchivingConfig struct {
}
type UploadsConfig struct {
StoragePaths []string `yaml:"storagePaths,flow"` // deprecated
MaxSizeBytes int64 `yaml:"maxBytes"`
MinSizeBytes int64 `yaml:"minBytes"`
AllowedTypes []string `yaml:"allowedTypes,flow"`
......
......@@ -4,7 +4,6 @@ import (
"fmt"
"github.com/sirupsen/logrus"
"github.com/turt2live/matrix-media-repo/common"
"github.com/turt2live/matrix-media-repo/common/config"
"github.com/turt2live/matrix-media-repo/common/rcontext"
"github.com/turt2live/matrix-media-repo/common/version"
......@@ -31,25 +30,6 @@ func LoadDatabase() {
}
func LoadDatastores() {
if len(config.Get().Uploads.StoragePaths) > 0 {
logrus.Warn("storagePaths usage is deprecated - please use datastores instead")
for _, p := range config.Get().Uploads.StoragePaths {
ctx := rcontext.Initial().LogWithFields(logrus.Fields{"path": p})
ds, err := storage.GetOrCreateDatastoreOfType(ctx, "file", p)
if err != nil {
logrus.Fatal(err)
}
fakeConfig := config.DatastoreConfig{
Type: "file",
Enabled: true,
MediaKinds: common.AllKinds,
Options: map[string]string{"path": ds.Uri},
}
config.Get().DataStores = append(config.Get().DataStores, fakeConfig)
}
}
mediaStore := storage.GetDatabase().GetMediaStore(rcontext.Initial())
logrus.Info("Initializing datastores...")
......@@ -97,8 +77,4 @@ func LoadDatastores() {
}
}
}
if len(config.Get().Uploads.StoragePaths) > 0 {
logrus.Warn("You are using `storagePaths` in your configuration - in a future update, this will be removed. Please use datastores instead (see sample config).")
}
}
......@@ -208,13 +208,6 @@ uploads:
# Set this to -1 to indicate that there is no limit. Zero will force the use of maxBytes.
#reportedMaxBytes: 104857600
# This is intended for larger deployments where media should be distributed among other
# directories, drives, servers, etc. For smaller deployments, a single entry in this list
# is recommended.
# DEPRECATED: Use datastores instead.
#storagePaths:
# - /var/matrix/media
# An optional list of file types that are allowed to be uploaded. If */* or nothing is
# supplied here, then all file types are allowed. Asterisks (*) are wildcards and can be
# placed anywhere to match everything (eg: "image/*" matches all images). This will also
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment