Skip to content

Add support for custom S3-compatible endpoints in S3CloudStorage #3293

Open

Description

@iampopal

Problem to Solve

Description:

Currently, the serverpod_cloud_storage_s3 package doesn't support configuring custom endpoints for S3-compatible storage providers like Tigris, DigitalOcean Spaces, MinIO, etc. Even when copying and modifying the package, users encounter connection issues due to hardcoded AWS-specific endpoint formatting.

Current behavior:

  • The S3 endpoint URL is constructed using a fixed format: https://$bucket.s3-$region.amazonaws.com
  • No way to specify a custom endpoint host
  • When attempting to use a custom host by modifying the code, connection handshake errors occur

Proposal

Proposed solution:

Add an optional endpoint parameter to the S3CloudStorage constructor that allows specifying a custom S3-compatible endpoint URL format. This would make the package more flexible for use with various S3-compatible storage providers.

pod.addCloudStorage(s3.S3CloudStorage(
  serverpod: pod,
  storageId: 'public',
  public: true,
  region: 'us-west-2',
  bucket: 'my-bucket-name',
  endpoint: 'fly.storage.tigris.dev', // New parameter for custom endpoints
));

Error encountered:

When attempting to implement a custom solution:

calling 2
Failed to upload to AWS, with exception:
e: HandshakeException: Connection terminated during handshake

This suggests SSL/TLS negotiation issues with the custom endpoint.

Use Case

-----

Alternatives

This feature would align with the community's needs as discussed in:

Additional context

No response

How experienced are you with this library?

None

Are you interested in working on a PR for this?

  • I want to work on this

Activity

  1. added
    enhancement
    on Mar 11, 2025
  2. Isakdl commented on Mar 11, 2025

    @Isakdl
    Collaborator

    Good idea, should be included with #3128

  3. iampopal commented on Mar 11, 2025

    @iampopal
    Author

    Thank you @Isakdl

    I am currently using minio https://pub.dev/packages/minio which is a great package and has the ability to custom url and works all great.

    final minio = Minio(
      endPoint: 'play.min.io',
      accessKey: '#################',
      secretKey: '#################################',
    );
    

    Is there is a way to include upload and download of these calls with serverpod?

  4. iampopal commented on Mar 11, 2025

    @iampopal
    Author

    Or can you suggest how to upload a file from client side now using milio or how to fix the serverpod by my self?

  5. added
    area: storage
    on Mar 12, 2025
  6. Disregard-Therest commented on Aug 27, 2025

    @Disregard-Therest

    Hi, guys, we have the same problem, because we use Yandex Cloud.

    We made a local copy of serverpod package and added their an additional parameter - for custom endpoint. And then we changed all method calls to use this parameter instead of standard endpoint string.

    So, it's about 6-8 lines of code. However, I am not sure, that our approach is completely fine for a wider range of hosts.
    I could help with implementing this.

  7. Disregard-Therest commented on Aug 27, 2025

    @Disregard-Therest

    @Isakdl can I help with this issue? we have local patch for this, which works fine for Yandex. If somebody will help to test with other providers, it should be fine for everyone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: storageenhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions