feat: add private r2 bucket
This commit is contained in:
@@ -37,6 +37,13 @@ type Config struct {
|
||||
R2Bucket string
|
||||
R2PublicURL string // Public base URL for objects, e.g. https://cdn.example.com or the R2 public bucket URL
|
||||
|
||||
// R2PrivateBucket is a SEPARATE bucket with no public access, used for
|
||||
// objects that must never be fetchable by URL alone (DM attachments).
|
||||
// A prefix inside R2Bucket would not do: R2 public access is per-bucket,
|
||||
// so anything in that bucket is world-readable. Empty disables the
|
||||
// private-media endpoints (they return 503) — the BFF still boots.
|
||||
R2PrivateBucket string
|
||||
|
||||
// SMTP — used for password-reset, email-verification, and
|
||||
// /feedback admin-notification mails.
|
||||
SMTPHost string
|
||||
@@ -136,6 +143,7 @@ func Load() (*Config, error) {
|
||||
R2SecretAccessKey: getEnv("R2_SECRET_ACCESS_KEY", ""),
|
||||
R2Bucket: getEnv("R2_BUCKET", ""),
|
||||
R2PublicURL: getEnv("R2_PUBLIC_URL", ""),
|
||||
R2PrivateBucket: getEnv("R2_PRIVATE_BUCKET", ""),
|
||||
|
||||
SMTPHost: getEnv("SMTP_HOST", ""),
|
||||
SMTPPort: getEnvInt("SMTP_PORT", 587),
|
||||
|
||||
Reference in New Issue
Block a user