benbjohnson / litestream

Streaming replication for SQLite.
https://litestream.io
Apache License 2.0
11.12k stars 256 forks source link

feat: add config param SessionToken #575

Open zhaoyii opened 8 months ago

zhaoyii commented 8 months ago

I use Litestream as my desktop software synchronization tool to synchronize sqlite to S3.

For security reasons, clients usually use Security Token Service(STS) to upload directly to S3. STS must include the access-key-id, secret-access-key, and session-token, so I added the session-token to the yaml configuration file and environment variables. and source code.

Note that when using session-token, you must set force-path-style: false, otherwise you will encounter an error:

SecondLevelDomainForbidden: Please use virtual hosted style to access.
status code: 403

It appears to be a permissions error caused by virtual hosted style.

I have tested the replicate and restore commands using the Alibaba Cloud Object Storage S3 API, and it works well. I do not have access to AWS S3, please help test with AWS. Thank you.

Other similar requirements: #407