Dan Brown [Sun, 9 Mar 2025 16:00:51 +0000 (16:00 +0000)]
Added some CLI change handling to prevent errors
Added proper detection of CLI changes, with early quite and output to
tell user to re-run, instead of erroring with a stack trace.
Used in scenario where the CLI will change itself as part of BookStack
updates.
Toyed with the idea of pre-compiling CLI PHP files, or handling the
scenario to switch to the new CLI version, but those are a lot more
complex and potentially error prone.
Dan Brown [Sat, 8 Mar 2025 17:19:58 +0000 (17:19 +0000)]
Range of changes to MySQL execution
- Changes mysql usage to use options files, removes used of env options
used for password.
- Updated to use mariadb specific programs if existing, otherwise mysql.
- Adds common xampp bin path for searching for mysql.
Dan Brown [Mon, 22 May 2023 09:20:38 +0000 (10:20 +0100)]
Addressed further symlink issues
Specifically updating recursive deletion/copy handling to ignore symlink
directories. This is so symlinks remain so that content is stored in the
actual desired symlinked locations upon restore, rather than new
non-sym-link equivilents (Which could loose data in scenarios like
within docker containers where data is symlinked to volume locations).
Tested on a dev linuxserver docker environment, which specific checking
of file handling before/after restore of backup.
Dan Brown [Mon, 22 May 2023 08:03:59 +0000 (09:03 +0100)]
Improved symlink support for backup/restore
Updates filesystem iteration to specifically handle symlinks when
iterating through files, and uses the file's real path when fetching
their contents.
Fixes #10
Adds test to cover backup case.
Dan Brown [Mon, 22 May 2023 07:30:44 +0000 (08:30 +0100)]
Fixed script-relative app locator when running as phar
Was previously doubling up on the dirname usage leading the locator to
look at the parent dir when running as a phar, likely due to the CLI
being previously nested in an app dir.
Fixes #9
Dan Brown [Sun, 7 May 2023 12:26:44 +0000 (13:26 +0100)]
Addressed restore issues
- Actually added force option to update-url artisan command, after missed
in last commit.
- Fixed lack of updating APP_URL in .env due to bad preg_replace.
- Added new test to cover different case of using the backup env URL.
- Updated existing test with correct expectations.
Dan Brown [Sun, 7 May 2023 11:27:46 +0000 (12:27 +0100)]
Fixed update-url command not ran, Fixed wrong env contents
- Adds --force command to the update-url run so that it's actually ran
during a restore. Option recently added on BookStack side to support.
- Updates env handling so that the old env contents are actually used as
part of the merge. Updated existing test to cover.
Dan Brown [Sat, 6 May 2023 15:01:24 +0000 (16:01 +0100)]
Updated move to be a recursive copy+delete
Added via new Directory helper class, which the existing recursive
delete function has been added to.
Done since rename would not work across filesystem boundaries.
Tested via a linuxserver BS setup.
Dan Brown [Mon, 1 May 2023 15:02:32 +0000 (16:02 +0100)]
Added improvements from testing on bsdemo
- Updated default info text to be cyan instead of blue for readability.
- Added "ZIP" in backup command details to make the file type clear.
- Updated some really low MySQL timeouts.
Dan Brown [Sat, 29 Apr 2023 13:02:00 +0000 (14:02 +0100)]
Made changes based upon freebsd/openbsd testing
- Added better generally output formatting with warnings and blue info.
- Addressed deprecation warning when opening empty zip from temp file.
- Updated mysqldump so warnings did not stop dump, but are shown to
users.
- Massively increased timeouts where needed.
- Fixed a few typos.
- Logged extra mysql known issues.
- Added protocol to mysql commands since that's what's expected in
BookStack's usage.
- Updated required extensions list to be more comprehensive, based upon
actual need on FreeBSD (Where php defaults were minimal) and extracted
requirements to static class vars for easier editing.
Dan Brown [Fri, 28 Apr 2023 17:36:40 +0000 (18:36 +0100)]
Made a range of tweaks from testing
- Fixed some relative paths issues when ran in phar.
- Added helper class for doing path work.
- Updated composer runner timeout.
- Updated checks for paths more thorough.
- Removed default completion command.
Dan Brown [Wed, 5 Apr 2023 20:07:33 +0000 (21:07 +0100)]
Added main-path restore command testing
Addressed some issues in the process including:
- Added dropping of existing db tables before restore.
- Changed how passwords are used in MySQL CLI actions to prevent
warnings.
- Updated docker setup for proper healthcheck/cleanup actions since was
previously misled by existing running container instances.
Dan Brown [Mon, 3 Apr 2023 16:26:09 +0000 (17:26 +0100)]
Started testing of backup command
Came across a couple of issues during build:
1. DB needed init SQL query to fix user permissions to allow backup,
added detail to readme in new "known issues".
2. App container work needed to wait for database to be alive.