mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -915,6 +915,15 @@ function s3_image_url(?int $storageId, ?string $path, int $version): ?string
|
||||
return null;
|
||||
}
|
||||
|
||||
// S3-compatible endpoints (e.g. Cloudflare R2) require authenticated requests for
|
||||
// every object, including plain GETs, so an unauthenticated direct link only works
|
||||
// when a public CDN has been configured in front of the bucket. Without one, callers
|
||||
// must fall back to the app's own authenticated proxy route.
|
||||
$cdnUrl = instanceSettings()->image_cdn_url;
|
||||
if (blank($cdnUrl)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$storage = S3Storage::query()
|
||||
->whereKey($storageId)
|
||||
->whereTeamId(0)
|
||||
@@ -925,9 +934,7 @@ function s3_image_url(?int $storageId, ?string $path, int $version): ?string
|
||||
return null;
|
||||
}
|
||||
|
||||
$baseUrl = instanceSettings()->image_cdn_url ?: $storage->awsUrl();
|
||||
|
||||
return rtrim($baseUrl, '/').'/'.ltrim($path, '/').'?v='.$version;
|
||||
return rtrim($cdnUrl, '/').'/'.ltrim($path, '/').'?v='.$version;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user