aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-07-01 09:04:19 +0200
committerDanilo M. <danix@danix.xyz>2026-07-01 09:04:19 +0200
commit470b93b786bd137bf4ba49d6cd95e43eca3fd5df (patch)
treebbf38981e9532a760a0c715b4589bff8f735f09e /README.md
downloadfirefly-update-470b93b786bd137bf4ba49d6cd95e43eca3fd5df.tar.gz
firefly-update-470b93b786bd137bf4ba49d6cd95e43eca3fd5df.zip
Initial commit: firefly-update script
Update a Firefly III instance on Debian: install latest or pinned release via Composer, carry over config/uploads/exports/SQLite DB, migrate, swap in, restart Apache. Timestamped DB backup before any change; --restore rolls back to the previous version. Licensed GPLv2-only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'README.md')
-rw-r--r--README.md47
1 files changed, 47 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..49ab6ef
--- /dev/null
+++ b/README.md
@@ -0,0 +1,47 @@
+# firefly-update
+
+Update a [Firefly III](https://www.firefly-iii.org/) instance on Debian.
+
+Installs the latest (or a pinned) release via Composer, carries over your
+`.env`, uploads, exports, and SQLite database, runs the migrations and
+upgrade steps, then swaps the new version in and restarts Apache. A
+timestamped database backup is taken before anything is touched, and
+`--restore` rolls back to the previous version.
+
+## Usage
+
+Run as root (it chowns files and restarts Apache):
+
+```bash
+sudo ./firefly-update # update to latest release
+sudo ./firefly-update -v 6.1.0 # update to a specific tag
+sudo ./firefly-update --restore # roll back to the previous version
+sudo ./firefly-update --help
+```
+
+### Configuration
+
+Override with environment variables:
+
+| Variable | Default | Meaning |
+|-------------|---------------------------|--------------------------------------------|
+| `WORKDIR` | `/var/www` | Directory holding the instance |
+| `INSTANCE` | `piggy` | Instance directory name under `$WORKDIR` |
+| `BACKUPDIR` | `$WORKDIR/firefly-backups`| Where timestamped DB backups are written |
+
+```bash
+WORKDIR=/srv INSTANCE=ff sudo -E ./firefly-update
+```
+
+## Notes
+
+- Assumes an SQLite database at `storage/database/database.sqlite`.
+- `set -euo pipefail`: any failed step aborts before the live instance is
+ swapped, so a broken build never replaces a working one.
+- The previous version is kept at `$INSTANCE-old` until the next run.
+
+## License
+
+GPLv2-only. See [LICENSE](LICENSE).
+
+Copyright (C) 2026 Danilo M. <danix@danix.xyz>