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:
2026-05-08 10:41:14 +00:00
parent 3ca7ceeabb
commit b4ac5451bb
2 changed files with 8 additions and 58 deletions
+8 -2
View File
@@ -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();
}
}