fix: support virtual-hosted S3 URLs for avatar storage (#330)
Avatar images failed to load with 403 on Tigris and newer AWS S3 buckets because getAvatarUrl only constructed path-style URLs. Modern S3-compatible providers require virtual-hosted URLs (bucket.domain/key). Add NEXT_PUBLIC_STORAGE_DOMAIN env var to signal URL style: - If set: virtual-hosted URL (Tigris, AWS S3) - If not set: path-style URL (MinIO, LocalStack) - backward compatible Add vitest and tests for getAvatarUrl behavior. Co-authored-by: Sachin Divekar <sachin.divekar@remiges.tech>
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"lint": "eslint",
|
||||
"start": "pnpm with-env next start",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"with-env": "dotenv -e ../../.env --",
|
||||
"lingui:extract": "lingui extract",
|
||||
@@ -86,7 +88,8 @@
|
||||
"jiti": "^1.21.6",
|
||||
"prettier": "catalog:",
|
||||
"tailwindcss": "catalog:",
|
||||
"typescript": "catalog:"
|
||||
"typescript": "catalog:",
|
||||
"vitest": "^3.0.0"
|
||||
},
|
||||
"prettier": "@kan/prettier-config"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user