Added fluid skills support
This commit is contained in:
@@ -77,7 +77,12 @@ export const buildR2Storage = (
|
||||
// (media.klient.pl → bucket) set R2_PUBLIC_URL so Payload generates URLs
|
||||
// pointing there. Without it, uploads work but images don't display publicly.
|
||||
// See docs/storage.md.
|
||||
const publicUrl = process.env.R2_PUBLIC_URL?.replace(/\/$/, '') // strip trailing slash
|
||||
// Site-relative value ('/media', dev only — ipalEnvRules rejects it in production)
|
||||
// → prefixed with NEXT_PUBLIC_SERVER_URL so Payload still stores absolute URLs.
|
||||
const rawPublicUrl = process.env.R2_PUBLIC_URL?.trim().replace(/\/$/, '') // strip trailing slash
|
||||
const serverUrl = process.env.NEXT_PUBLIC_SERVER_URL?.trim().replace(/\/$/, '')
|
||||
const publicUrl =
|
||||
rawPublicUrl?.startsWith('/') && serverUrl ? `${serverUrl}${rawPublicUrl}` : rawPublicUrl
|
||||
|
||||
// generateFileURL is a PER-COLLECTION option in @payloadcms/storage-s3 (not a
|
||||
// top-level one) — R2 needs it to point served URLs at the custom domain
|
||||
|
||||
Reference in New Issue
Block a user