mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2026-05-03 16:10:40 +00:00
4963385bf9
The update was failing with 'mv: cannot stat /opt/2fauth-backup/.env:
No such file or directory' on a system where a previous run had left
/opt/2fauth-backup behind. mv would then nest /opt/2fauth inside the
existing backup directory (as /opt/2fauth-backup/2fauth/), so the
restore step looked at the wrong path.
After fixing that, the app returned a 500 ('Key path
file:///opt/2fauth/storage/oauth-public.key does not exist or is not
readable') because chown/chmod ran before composer install and
php artisan 2fauth:install, leaving vendor/, bootstrap/cache/* and
the regenerated oauth keys owned by root and unreadable by www-data.
- Remove any stale /opt/2fauth-backup before creating the backup, and
remove it again at the end so the next run starts clean
- Use cp instead of mv when restoring .env/storage so the backup is
preserved until the update completes
- Move chown/chmod to AFTER composer + artisan, matching the order in
install/2fauth-install.sh
- Restart php8.4-fpm in addition to nginx so opcache picks up the new
cached config
- Drop redundant quotes around literal paths to match the rest of the
codebase