dokploy
dokploy copied to clipboard
Web server restore silently drops dotfiles in the install directory
To Reproduce
- Have files at the top level of the install directory that start with a dot, for example
/etc/dokploy/.env. - Take a web server backup, then restore it.
Current vs. Expected behavior
The restore step in restoreWebServerBackup clears the install directory and copies the archive back with shell globs:
rm -rf "/etc/dokploy/"*
cp -rp "<temp>/filesystem/"* "/etc/dokploy/"
A * glob does not match dotfiles, so hidden files skip both steps. After a restore:
- dotfiles from the backup are missing, because the copy never picks them up;
- dotfiles from the previous install are still there even when the backup does not contain them, because the wipe never removes them.
The backup itself does contain them, it is created with rsync -a /etc/dokploy/ .... Only the restore is affected, and nothing is logged about it.
Expected: the restore reproduces the backed up filesystem, including hidden files.
Provide environment information
Dokploy: v0.31.7
Affected area: Settings → Web Server → Backup → Restore.
Additional context
Fix is in #6186: wipe with find "${BASE_PATH}" -mindepth 1 -maxdepth 1 -exec rm -rf {} + and copy with cp -rp "<temp>/filesystem/." "${BASE_PATH}/". Added a test that checks both commands, it fails on canary.
Will you send a PR to fix it?
Yes.