mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[PR #1656] [MERGED] S3 attachment storage #1680
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#1680
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/binwiederhier/ntfy/pull/1656
Author: @binwiederhier
Created: 3/15/2026
Status: ✅ Merged
Merged: 3/23/2026
Merged by: @binwiederhier
Base:
main← Head:attachment-s3📝 Commits (10+)
d517ce4WIP: S3b4ec6faAWS deps..4487299Merge branch 'main' into attachment-s3790ba24S3 WIP458fbadMerge branch 'main' into attachment-s386015e1Multipart upload6b11bc7Merge branch 'main' into attachment-s3a47d692Fix bugcffa579Logsef31496Refactor📊 Changes
38 files changed (+3089 additions, -502 deletions)
View changed files
📝
.github/workflows/build.yaml(+4 -1)📝
.github/workflows/release.yaml(+1 -0)📝
.github/workflows/test.yaml(+5 -1)📝
.gitignore(+1 -0)➕
attachment/backend.go(+23 -0)➕
attachment/backend_file.go(+94 -0)➕
attachment/backend_s3.go(+51 -0)➕
attachment/store.go(+232 -0)➕
attachment/store_file_test.go(+16 -0)➕
attachment/store_s3_test.go(+120 -0)➕
attachment/store_test.go(+352 -0)📝
cmd/serve.go(+1 -1)📝
docs/config.md(+159 -86)📝
docs/releases.md(+4 -0)📝
go.mod(+1 -1)📝
go.sum(+2 -2)📝
message/cache.go(+31 -45)📝
message/cache_postgres.go(+3 -0)📝
message/cache_sqlite.go(+3 -0)➕
s3/client.go(+302 -0)...and 18 more files
📄 Description
Summary
Adds S3-compatible object storage as a backend for attachment caching, as an alternative to local filesystem storage.
s3/package): implements PutObject (with automatic multipart upload for large files), GetObject, DeleteObjects, and ListObjectsV2 using AWS Signature V4 signing — no AWS SDK dependencyattachment/package): unifiedStorewith pluggable backend interface (fileBackend/s3Backend), shared size tracking, rate limiting, and background syncattachment-cache-diraccepts an S3 URL (s3://ACCESS_KEY:SECRET_KEY@BUCKET[/PREFIX]?region=REGION[&endpoint=ENDPOINT]), auto-detecting path-style addressing when a custom endpoint is setdocs/config.mdwith S3 configuration examples and cleanup behaviorS3 client features
Test plan
go test ./s3/...— S3 client unit tests (signing, URL construction, prefix handling) and integration tests (mock S3 server)go test ./attachment/...— attachment store tests for both file and S3 backendsgo test ./server/...— server tests passgo test ./util/...— LimitReader, CountingReader, and LimitWriter tests🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.