diff options
author | 2022-07-03 12:08:30 +0200 | |
---|---|---|
committer | 2022-07-03 12:08:30 +0200 | |
commit | 9d0df426da59275f7aeaf46004befe5a778da274 (patch) | |
tree | 82c6bb98597e44c4f70b731336dcdfc839412c1c /internal/processing/media/media.go | |
parent | [chore] Re-enable source tar but name it clearly as source (#683) (diff) | |
download | gotosocial-9d0df426da59275f7aeaf46004befe5a778da274.tar.xz |
[feature] S3 support (#674)
* feat: vendor minio client
* feat: introduce storage package with s3 support
* feat: serve s3 files directly
this saves a lot of bandwith as the files are fetched from the object
store directly
* fix: use explicit local storage in tests
* feat: integrate s3 storage with the main server
* fix: add s3 config to cli tests
* docs: explicitly set values in example config
also adds license header to the storage package
* fix: use better http status code on s3 redirect
HTTP 302 Found is the best fit, as it signifies that the resource
requested was found but not under its presumed URL
307/TemporaryRedirect would mean that this resource is usually located
here, not in this case
303/SeeOther indicates that the redirection does not link to the
requested resource but to another page
* refactor: use context in storage driver interface
Diffstat (limited to 'internal/processing/media/media.go')
-rw-r--r-- | internal/processing/media/media.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/processing/media/media.go b/internal/processing/media/media.go index 50cbc1b3c..66575facc 100644 --- a/internal/processing/media/media.go +++ b/internal/processing/media/media.go @@ -21,12 +21,12 @@ package media import ( "context" - "codeberg.org/gruf/go-store/kv" apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model" "github.com/superseriousbusiness/gotosocial/internal/db" "github.com/superseriousbusiness/gotosocial/internal/gtserror" "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" "github.com/superseriousbusiness/gotosocial/internal/media" + "github.com/superseriousbusiness/gotosocial/internal/storage" "github.com/superseriousbusiness/gotosocial/internal/transport" "github.com/superseriousbusiness/gotosocial/internal/typeutils" ) @@ -51,12 +51,12 @@ type processor struct { tc typeutils.TypeConverter mediaManager media.Manager transportController transport.Controller - storage *kv.KVStore + storage storage.Driver db db.DB } // New returns a new media processor. -func New(db db.DB, tc typeutils.TypeConverter, mediaManager media.Manager, transportController transport.Controller, storage *kv.KVStore) Processor { +func New(db db.DB, tc typeutils.TypeConverter, mediaManager media.Manager, transportController transport.Controller, storage storage.Driver) Processor { return &processor{ tc: tc, mediaManager: mediaManager, |