2 Commits

Author SHA1 Message Date
userAdityaa 732f9b6209 feat(blossom): optional S3-compatible blob storage 2026-05-12 16:50:09 +05:45
Jon Staab 9e56d47fc0 Add blossom.authenticated_read config setting 2026-05-06 16:45:46 -07:00
3 changed files with 7 additions and 1 deletions
+1
View File
@@ -95,6 +95,7 @@ Configures NIP 86 support.
Configures blossom support.
- `enabled` - whether blossom is enabled.
- `authenticated_read` - whether users must perform NIP 98 AUTH in order to fetch a file.
### `[push]`
+4
View File
@@ -165,6 +165,10 @@ func (bl *BlossomStore) Enable(instance *Instance) {
}
backend.RejectGet = func(ctx context.Context, auth *nostr.Event, sha256 string, ext string) (bool, string, int) {
if !bl.Config.Blossom.AuthenticatedRead {
return false, "", 200
}
if auth == nil || !instance.Management.IsMember(auth.PubKey) {
return true, "unauthorized", 403
}
+2 -1
View File
@@ -46,7 +46,8 @@ type Config struct {
} `toml:"management" json:"management"`
Blossom struct {
Enabled bool `toml:"enabled" json:"enabled"`
Enabled bool `toml:"enabled" json:"enabled"`
AuthenticatedRead bool `toml:"authenticated_read" json:"authenticated_read"`
Backend string `toml:"backend" json:"backend"`
S3 BlossomS3Settings `toml:"s3" json:"s3"`
} `toml:"blossom" json:"blossom"`