Skip to content

XDRIVE transport: Add "s3" storage backend - #7231

Merged
RPRX merged 1 commit into
XTLS:mainfrom
Katze-942:xdrive-s3
Oct 29, 2026
Merged

RPRX merged 1 commit into
XTLS:mainfrom
Katze-942:xdrive-s3

Conversation

@Katze-942

Copy link
Copy Markdown
Contributor

Adds an s3 backend to XDRIVE for transferring data through S3-compatible storage. Requests are signed using AWS Signature V4. The implementation is based on the existing drive.go, so there may be some code duplication.
Tested with Yandex Cloud and VK Cloud S3 storage. Example configuration:

"xdriveSettings": {
  "service": "s3",
  "remoteFolder": "xdrive",
  "secrets": [
    "ACCESS_KEY_ID",
    "SECRET_ACCESS_KEY"
  ],
  "s3": {
    "endpoint": "https://storage.yandexcloud.net",
    "region": "ru-central1",
    "bucket": "example-bucket",
    "pathStyle": true
  }
}

remoteFolder sets the object prefix within the bucket.

pathStyle is enabled by default and adds the bucket name to the URL path. When set to false, the bucket name is added to the hostname instead.

@FunLay123

Copy link
Copy Markdown
Contributor

Would be so interesting to watch speed results 👀

@Katze-942

Copy link
Copy Markdown
Contributor Author

Would be so interesting to watch speed results 👀

Yandex Cloud was the most stable. Telegram stayed connected, messages were delivered quickly, and media loaded without issues. Speedtest showed speeds of up to 40 Mbps. Speed tests against my own server averaged 20-30 Mbps.

VK Cloud sometimes worked very reliably without reconnecting, but at other times it became very slow to process requests. During quieter periods, download speeds were around 5-9 Mbps, with upload speeds of about 2-3 Mbps.

@FunLay123

Copy link
Copy Markdown
Contributor

@Katze-942 А что насчёт цены? Видел там в яндексе вроде 100 гигов бесплатно, но дорогой листинг, а вк подешевле, но нету бесплатных гб.

What about the cost?

@Katze-942

Copy link
Copy Markdown
Contributor Author

@Katze-942 А что насчёт цены? Видел там в яндексе вроде 100 гигов бесплатно, но дорогой листинг, а вк подешевле, но нету бесплатных гб.

What about the cost?

Да, там 100 гигов бесплатно. DELETE бесплатен. Остальное тарифицируется как:

  • PUT/LIST: 0,57 ₽ за 1 000 операций
  • GET: 0,46₽ за 10 000 операций
  • Если больше 100 гб исходящего трафика, то 1,67994 ₽ рублей за ГБ (до терабайта. Если больше терабайта, то цена чуть ниже)

У VK Cloud где-то цены пишут, но я запутался в их кабинете. Как я понял, там 2,28 ₽/ГБ хранения в месяц и 1,31 ₽/ГБ исходящего трафика.

@RPRX

RPRX commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

不确定 "template" #7188 是否覆盖 S3 stores,不过既然 #5645 一开始就提到了它那就加吧,毕竟用起来方便很多,测了 CF 没

当初还提到了 OpenList、rclone,看看要不要参考它们的代码或者直接 import,你可以 PR

简单看了下 PR 代码应该是同样基于 #7181 #7187 的逻辑,另外请确认是否符合我在 #6748 内提的 domain fronting 相关要求

至于 #7182 肯定是有的,话说你有没有对比“直接从 S3 下载大文件”的速度?#7217 有一些优化以后改成共用,终于 link 完了

@RPRX RPRX changed the title XDRIVE: Add S3 storage backend XDRIVE transport: Add "s3" storage backend Oct 29, 2026
@RPRX
RPRX merged commit b4123b5 into XTLS:main Oct 29, 2026
40 checks passed
@Katze-942

Copy link
Copy Markdown
Contributor Author

简单看了下 PR 代码应该是同样基于 #7181 #7187 的逻辑,另外请确认是否符合我在 #6748 内提的 domain fronting 相关要求

Yea, the domain fronting requirements are also met here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants