summaryrefslogtreecommitdiff
path: root/testrig/storage.go
diff options
context:
space:
mode:
authorLibravatar Dominik Süß <dominik@suess.wtf>2022-12-02 19:40:49 +0100
committerLibravatar GitHub <noreply@github.com>2022-12-02 18:40:49 +0000
commitbc917a4085f8f6195e70d55b751b08cc5a93059c (patch)
tree9867d7d2bb2cc552d82a24535f8261ab1af2eb45 /testrig/storage.go
parent[bugfix] Fix `admin account confirm` on pre-confirmed account setting email a... (diff)
downloadgotosocial-bc917a4085f8f6195e70d55b751b08cc5a93059c.tar.xz
[performance]: make s3 urls cacheable (#1194)v0.6.0-rc3
Implements #864 and should speed up s3 based installations by a lot. With more static urls, we can then also implement #1026 for even better performance when used in conjunction with CDNs
Diffstat (limited to 'testrig/storage.go')
-rw-r--r--testrig/storage.go35
1 files changed, 0 insertions, 35 deletions
diff --git a/testrig/storage.go b/testrig/storage.go
index 20226089c..7d3f3be71 100644
--- a/testrig/storage.go
+++ b/testrig/storage.go
@@ -26,9 +26,6 @@ import (
"codeberg.org/gruf/go-store/v2/kv"
"codeberg.org/gruf/go-store/v2/storage"
- "github.com/minio/minio-go/v7"
- "github.com/minio/minio-go/v7/pkg/credentials"
- "github.com/superseriousbusiness/gotosocial/internal/config"
gtsstorage "github.com/superseriousbusiness/gotosocial/internal/storage"
)
@@ -41,38 +38,6 @@ func NewInMemoryStorage() *gtsstorage.Driver {
}
}
-func NewS3Storage() *gtsstorage.Driver {
- endpoint := config.GetStorageS3Endpoint()
- access := config.GetStorageS3AccessKey()
- secret := config.GetStorageS3SecretKey()
- secure := config.GetStorageS3UseSSL()
- bucket := config.GetStorageS3BucketName()
- proxy := config.GetStorageS3Proxy()
-
- s3, err := storage.OpenS3(endpoint, bucket, &storage.S3Config{
- CoreOpts: minio.Options{
- Creds: credentials.NewStaticV4(access, secret, ""),
- Secure: secure,
- },
- GetOpts: minio.GetObjectOptions{},
- PutOpts: minio.PutObjectOptions{},
- PutChunkSize: 5 * 1024 * 1024, // 2MiB
- StatOpts: minio.StatObjectOptions{},
- RemoveOpts: minio.RemoveObjectOptions{},
- ListSize: 200,
- })
- if err != nil {
- panic(fmt.Errorf("error opening s3 storage: %w", err))
- }
-
- return &gtsstorage.Driver{
- KVStore: kv.New(s3),
- Storage: s3,
- Proxy: proxy,
- Bucket: bucket,
- }
-}
-
// StandardStorageSetup populates the storage with standard test entries from the given directory.
func StandardStorageSetup(storage *gtsstorage.Driver, relativePath string) {
storedA := newTestStoredAttachments()