function61 / varasto

All your files in one simple, replicated, encrypted place - with built-in backups and configurable ransomware protection.
https://function61.com/varasto
Apache License 2.0
56 stars 5 forks source link

S3-compliant services (DigitalOcean spaces et al.) #243

Closed joonas-fi closed 5 months ago

joonas-fi commented 5 months ago

Current config UI:

image

joonas-fi commented 5 months ago

This boilerplate (for github.com/aws/aws-sdk-go) works for DigitalOcean Spaces:

    config := &aws.Config{
        Endpoint: Pointer("fra1.digitaloceanspaces.com"),
        Region:   Pointer("fra1"),
    }

    if accessKeyId != "" {
        config.WithCredentials(credentials.NewStaticCredentials(accessKeyId, accessKeySecret, ""))
    }

    sess, err := session.NewSession(config)
    if err != nil {
        return nil, err
    }

    return s3.New(sess), nil

Looking at above screenshot, we support already configuring Region ID so all thats' missing is the endpoint.

Summary: let's support specifying the endpoint. That should unlock DigitalOcean and other 3rd party services.

joonas-fi commented 5 months ago

The above described implementation works:

image

Instructions

You get something like from DigitalOcean as bucket endpoint https://mybucket.ams3.digitaloceanspaces.com. This means you configure to Varasto: