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_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/processing/processor_test.go') diff --git a/internal/processing/processor_test.go b/internal/processing/processor_test.go index c60ff5c97..54271cc86 100644 --- a/internal/processing/processor_test.go +++ b/internal/processing/processor_test.go @@ -19,7 +19,6 @@ package processing_test import ( - "codeberg.org/gruf/go-store/kv" "github.com/stretchr/testify/suite" "github.com/superseriousbusiness/gotosocial/internal/concurrency" "github.com/superseriousbusiness/gotosocial/internal/db" @@ -30,6 +29,7 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/messages" "github.com/superseriousbusiness/gotosocial/internal/oauth" "github.com/superseriousbusiness/gotosocial/internal/processing" + "github.com/superseriousbusiness/gotosocial/internal/storage" "github.com/superseriousbusiness/gotosocial/internal/transport" "github.com/superseriousbusiness/gotosocial/internal/typeutils" "github.com/superseriousbusiness/gotosocial/testrig" @@ -39,7 +39,7 @@ type ProcessingStandardTestSuite struct { // standard suite interfaces suite.Suite db db.DB - storage *kv.KVStore + storage storage.Driver mediaManager media.Manager typeconverter typeutils.TypeConverter httpClient *testrig.MockHTTPClient @@ -91,7 +91,7 @@ func (suite *ProcessingStandardTestSuite) SetupTest() { suite.db = testrig.NewTestDB() suite.testActivities = testrig.NewTestActivities(suite.testAccounts) - suite.storage = testrig.NewTestStorage() + suite.storage = testrig.NewInMemoryStorage() suite.typeconverter = testrig.NewTestTypeConverter(suite.db) suite.httpClient = testrig.NewMockHTTPClient(nil, "../../testrig/media") -- cgit v1.2.3