From 9d0df426da59275f7aeaf46004befe5a778da274 Mon Sep 17 00:00:00 2001 From: Dominik Süß Date: Sun, 3 Jul 2022 12:08:30 +0200 Subject: [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 --- internal/processing/processor.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/processing/processor.go') diff --git a/internal/processing/processor.go b/internal/processing/processor.go index 8572b583c..b8d0daf99 100644 --- a/internal/processing/processor.go +++ b/internal/processing/processor.go @@ -23,7 +23,6 @@ import ( "net/http" "net/url" - "codeberg.org/gruf/go-store/kv" apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model" "github.com/superseriousbusiness/gotosocial/internal/concurrency" "github.com/superseriousbusiness/gotosocial/internal/db" @@ -41,6 +40,7 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/processing/status" "github.com/superseriousbusiness/gotosocial/internal/processing/streaming" "github.com/superseriousbusiness/gotosocial/internal/processing/user" + "github.com/superseriousbusiness/gotosocial/internal/storage" "github.com/superseriousbusiness/gotosocial/internal/stream" "github.com/superseriousbusiness/gotosocial/internal/timeline" "github.com/superseriousbusiness/gotosocial/internal/typeutils" @@ -251,7 +251,7 @@ type processor struct { tc typeutils.TypeConverter oauthServer oauth.Server mediaManager media.Manager - storage *kv.KVStore + storage storage.Driver statusTimelines timeline.Manager db db.DB filter visibility.Filter @@ -275,7 +275,7 @@ func NewProcessor( federator federation.Federator, oauthServer oauth.Server, mediaManager media.Manager, - storage *kv.KVStore, + storage storage.Driver, db db.DB, emailSender email.Sender, clientWorker *concurrency.WorkerPool[messages.FromClientAPI], -- cgit v1.2.3