Persistent storage volume + remove debug route + validate logo file exists
- Coolify persistent volume mounted at /app/storage/app (covers public uploads,
private files, backups). Configured via API:
POST /api/v1/applications/{uuid}/storages with type=persistent
- getLogoUrl() / getFaviconUrl() now validate file_exists($m->getPath()) before
returning URL — guards against stale DB rows from pre-volume era
- Removed /debug-storage diagnostic route (used to find the symlink+volume bug)
This commit is contained in:
@@ -98,12 +98,18 @@ class Company extends BaseTenant implements HasMedia
|
||||
public function getLogoUrl(): ?string
|
||||
{
|
||||
$m = $this->getFirstMedia('logo');
|
||||
return $m ? $m->getUrl() : null;
|
||||
if (! $m) return null;
|
||||
// Validate file actually exists on disk (storage may be ephemeral
|
||||
// and DB row may point to lost file from previous deploy).
|
||||
if (! @file_exists($m->getPath())) return null;
|
||||
return $m->getUrl();
|
||||
}
|
||||
|
||||
public function getFaviconUrl(): ?string
|
||||
{
|
||||
$m = $this->getFirstMedia('favicon');
|
||||
return $m ? $m->getUrl() : null;
|
||||
if (! $m) return null;
|
||||
if (! @file_exists($m->getPath())) return null;
|
||||
return $m->getUrl();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user