diff --git a/webui/plugins/podman/Podman.page b/webui/plugins/podman/Podman.page index 1ee7649..b9f009f 100644 --- a/webui/plugins/podman/Podman.page +++ b/webui/plugins/podman/Podman.page @@ -23,14 +23,28 @@ Icon="podman" * Cache-busts every static asset with its own on-disk mtime. Unraid's * webserver sends no explicit no-cache headers for /plugins/ static * files, so without this, browsers can keep serving a stale app.js/ - * podman.css for a long time after a plugin update — verified live: a - * bugfix to app.js's CSRF handling silently kept failing in a real - * browser after redeploy until this was added, even though the deployed - * file on disk was byte-for-byte correct. + * podman.css for a long time after a plugin update. + * + * Deliberately a hardcoded absolute path, NOT __DIR__ — Unraid's own + * PageBuilder runs every .page file's PHP through eval() (see + * webGui/include/DefaultPageLayout/evalContent.php: "eval($evalContent)"), + * and __DIR__/__FILE__ inside eval()'d code resolve to the eval() CALL + * SITE (that file's own directory), not to Podman.page's real location — + * a standard PHP eval() gotcha. Confirmed live: this made + * podman_asset_version() return '0' for every single asset, always, + * completely independent of any browser or PHP-FPM caching (ruled both + * out first: neither a hard-reload nor a php-fpm restart changed the + * result) — the version query string was never actually cache-busting + * anything all session; every "hard refresh fixed it" moment was the + * browser's own Ctrl+Shift+R bypass, not this mechanism. The rest of + * this codebase already hardcodes this same install path elsewhere + * (e.g. include/Config.php's $bootDir, plugin/podman.plg's event hook + * paths) — Unraid plugins always install to /usr/local/emhttp/plugins/ + * , so this isn't a new class of fragility. */ function podman_asset_version(string $relPath): string { - $full = __DIR__ . $relPath; + $full = '/usr/local/emhttp/plugins/podman' . $relPath; return is_file($full) ? (string) filemtime($full) : '0'; } ?>