BookStackApp / system-cli

MIGRATED TO CODEBERG -- A simple CLI to manage BookStack instances
https://codeberg.org/bookstack/system-cli
MIT License
5 stars 0 forks source link

CLI fails on common filesystem operations when target is a symlink #4

Closed ssddanbrown closed 1 year ago

ssddanbrown commented 1 year ago

Found during testing in linuxserver image, specifically during restore you'd get:

PHP Warning:  rmdir(/app/www/public/uploads): Not a directory in phar:///app/www/bookstack-system-cli/src/Commands/RestoreCommand.php on line 198
PHP Warning:  rename(/app/www/restore-temp-1683334658/public/uploads,/app/www/public/uploads): Not a directory in phar:///app/www/bookstack-system-cli/src/Commands/RestoreCommand.php on line 183

There will likely be other areas like this. Just need to resolve out the full path (realpath) before filesystem operations take place.