+ {new Date(post.date).toLocaleDateString("en-US", { + year: "numeric", + month: "long", + day: "numeric", + })}{" "} + Β· {post.author} +
+diff --git a/.dockerignore b/.dockerignore index afbca534..4ca97726 100644 --- a/.dockerignore +++ b/.dockerignore @@ -47,8 +47,10 @@ pnpm-debug.log* docs tests scripts +!scripts/decrypt_backup.js coverage wiki api-docs +website README.md LICENSE diff --git a/.gitignore b/.gitignore index 07f1e151..39bbcc17 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,9 @@ storage/avatars/* # Jetbrains .idea +# Claude Code local config +.claude + # VSCode .vscode diff --git a/Dockerfile b/Dockerfile index 084a1585..a2217bd0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,6 +55,49 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ rm /tmp/mongo-tools.deb && \ rm -rf /var/lib/apt/lists/* +# Step 5: Firebird 5.x client tools (gbak, isql) for the Firebird adapter. +# Debian 12's apt repos only carry a 3.0 client, not 5.x, and the 5.x gbak/isql +# can talk to 3.x/4.x servers over the wire protocol - so download the official +# Firebird release tarball and extract just the client binaries + shared library. +# +# Verified against the actual GitHub release assets (2026-07-04): +# - Release tag (v${FIREBIRD_RELEASE_TAG}) and asset filename version +# (${FIREBIRD_ASSET_VERSION}) differ - assets embed a build number, e.g. +# "Firebird-5.0.3.1683-0-linux-x64.tar.gz" for tag "v5.0.3". Bump both when +# upgrading. +# - The top-level tarball only contains an install.sh + a nested +# buildroot.tar.gz - the actual bin/lib payload lives at +# buildroot.tar.gz:./opt/firebird/{bin,lib}, not at the tarball root. +# - gbak/isql depend on libtommath.so.1 and gbak also needs libz.so.1, neither +# of which ship inside buildroot.tar.gz - installed via apt below. +# libicuuc/libicui18n are dlopen'd at runtime for extended collations only +# (soft dependency) - omitted here since backup/restore doesn't need them. +ARG FIREBIRD_RELEASE_TAG=5.0.3 +ARG FIREBIRD_ASSET_VERSION=5.0.3.1683-0 +RUN apt-get update && apt-get install -y --no-install-recommends \ + libtommath1 \ + zlib1g && \ + rm -rf /var/lib/apt/lists/* && \ + case "${TARGETARCH:-amd64}" in \ + amd64) FB_ARCH="x64" ;; \ + arm64) FB_ARCH="arm64" ;; \ + *) echo "Unsupported architecture: ${TARGETARCH}"; exit 1 ;; \ + esac && \ + curl -fsSL "https://github.com/FirebirdSQL/firebird/releases/download/v${FIREBIRD_RELEASE_TAG}/Firebird-${FIREBIRD_ASSET_VERSION}-linux-${FB_ARCH}.tar.gz" -o /tmp/firebird.tar.gz && \ + mkdir -p /tmp/firebird-extract && \ + tar -xzf /tmp/firebird.tar.gz -C /tmp/firebird-extract --strip-components=1 && \ + tar -xzf /tmp/firebird-extract/buildroot.tar.gz -C /tmp/firebird-extract && \ + mkdir -p /opt/firebird/bin /opt/firebird/lib && \ + cp /tmp/firebird-extract/opt/firebird/bin/gbak /opt/firebird/bin/ && \ + cp /tmp/firebird-extract/opt/firebird/bin/isql /opt/firebird/bin/ && \ + cp -a /tmp/firebird-extract/opt/firebird/lib/. /opt/firebird/lib/ && \ + cp /tmp/firebird-extract/opt/firebird/firebird.msg /opt/firebird/ && \ + ln -sf /opt/firebird/bin/gbak /usr/local/bin/gbak && \ + ln -sf /opt/firebird/bin/isql /usr/local/bin/isql && \ + echo "/opt/firebird/lib" > /etc/ld.so.conf.d/firebird.conf && \ + ldconfig && \ + rm -rf /tmp/firebird.tar.gz /tmp/firebird-extract + # Enable corepack for pnpm support and symlink PostgreSQL 18 binaries # On Debian with PGDG, pg binaries live under /usr/lib/postgresql/18/bin/ RUN corepack enable && corepack prepare pnpm@10.29.3 --activate && \ @@ -94,6 +137,8 @@ RUN --mount=type=cache,id=next-cache,target=/app/.next/cache \ FROM base AS runner WORKDIR /app +COPY --from=builder --link --chown=1001:1001 /app/scripts/decrypt_backup.js ./scripts/decrypt_backup.js + ENV NODE_ENV=production ENV NEXT_TELEMETRY_DISABLED=1 ENV PNPM_HOME="/pnpm" diff --git a/README.md b/README.md index 90d04170..1497bc7d 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Quick Start β’ API Reference β’ Changelog β’ - Roadmap + Roadmap
@@ -211,7 +211,7 @@ Full documentation is available at **[docs.dbackup.app](https://docs.dbackup.app - [API Reference](https://api.dbackup.app) - Interactive REST API documentation - [Developer Guide](https://docs.dbackup.app/developer-guide/) - Architecture, adapters, contributing - [Changelog](https://docs.dbackup.app/changelog) - Release history -- [Roadmap](https://docs.dbackup.app/roadmap) - Planned features +- [Roadmap](https://dbackup.app/roadmap) - Planned features ## π οΈ Development diff --git a/api-docs/openapi.yaml b/api-docs/openapi.yaml index 596b5e6f..d4f8f9b7 100644 --- a/api-docs/openapi.yaml +++ b/api-docs/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.1.0 info: title: DBackup API - version: 2.9.0 + version: 2.10.0 description: | REST API for DBackup - a self-hosted database backup automation platform with encryption, compression, and smart retention. diff --git a/docker-compose.test.yml b/docker-compose.test.yml index c495ff73..0b074e85 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -401,3 +401,67 @@ services: interval: 5s timeout: 5s retries: 5 + + # ========================================== + # Firebird Family + # ========================================== + # Image: official firebirdsql/firebird (https://github.com/FirebirdSQL/firebird-docker) + # Verified against the project's README (2026-07-04): FIREBIRD_ROOT_PASSWORD sets + # SYSDBA's password, FIREBIRD_DATABASE creates the file under FIREBIRD_DATA + # (/var/lib/firebird/data), and the client binaries on PATH are named plain + # "isql"/"gbak" (not "isql-fb"). Firebird only ships official arm64 images from + # 5.x onward - 3.x/4.x are linux/amd64 only, hence the `platform:` overrides below. + + # Firebird 3.0 + # Platform: linux/amd64 required - Firebird only ships official arm64 images from 5.x onward, + # so 3.x/4.x run under Rosetta/QEMU emulation on Apple Silicon (slower, but fine for testing). + firebird-30: + image: firebirdsql/firebird:3.0.11 + platform: linux/amd64 + container_name: dbm-test-firebird-30 + environment: + FIREBIRD_ROOT_PASSWORD: masterkey + FIREBIRD_DATABASE: testdb.fdb + FIREBIRD_USE_LEGACY_AUTH: "true" + ports: + - "31530:3050" + healthcheck: + test: ["CMD-SHELL", "isql -user sysdba -password masterkey /var/lib/firebird/data/testdb.fdb -i /dev/null || exit 1"] + interval: 10s + timeout: 5s + retries: 10 + start_period: 20s + + # Firebird 4.0 + # Platform: linux/amd64 required for Apple Silicon (see note on firebird-30) + firebird-40: + image: firebirdsql/firebird:4.0.7 + platform: linux/amd64 + container_name: dbm-test-firebird-40 + environment: + FIREBIRD_ROOT_PASSWORD: masterkey + FIREBIRD_DATABASE: testdb.fdb + ports: + - "31540:3050" + healthcheck: + test: ["CMD-SHELL", "isql -user sysdba -password masterkey /var/lib/firebird/data/testdb.fdb -i /dev/null || exit 1"] + interval: 10s + timeout: 5s + retries: 10 + start_period: 20s + + # Firebird 5.0 (Current) + firebird-50: + image: firebirdsql/firebird:5.0.3 + container_name: dbm-test-firebird-50 + environment: + FIREBIRD_ROOT_PASSWORD: masterkey + FIREBIRD_DATABASE: testdb.fdb + ports: + - "31550:3050" + healthcheck: + test: ["CMD-SHELL", "isql -user sysdba -password masterkey /var/lib/firebird/data/testdb.fdb -i /dev/null || exit 1"] + interval: 10s + timeout: 5s + retries: 10 + start_period: 20s diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index e90e44fd..60f5d725 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -108,7 +108,8 @@ export default defineConfig({ { text: 'Redis', link: '/user-guide/sources/redis' }, { text: 'Valkey', link: '/user-guide/sources/valkey' }, { text: 'SQLite', link: '/user-guide/sources/sqlite' }, - { text: 'Microsoft SQL Server', link: '/user-guide/sources/mssql' } + { text: 'Microsoft SQL Server', link: '/user-guide/sources/mssql' }, + { text: 'Firebird', link: '/user-guide/sources/firebird' } ] }, { diff --git a/docs/changelog.md b/docs/changelog.md index 77fefc6c..0a4952f6 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,35 @@ All notable changes to DBackup are documented here. +## v2.10.0 - Firebird Support, New Website, and Multiple Bug Fixes +*Released: July 12, 2026* + +### β¨ Features + +- **Firebird**: Added Firebird (3.x/4.x/5.x) as a supported database source, with direct and SSH connection modes. Marked as Beta in the source type picker. +- **website**: Launched a new website at dbackup.app with a blog, roadmap page, and product tour. + +### π Bug Fixes + +- **Redis**: Database Explorer now shows a key count per database instead of always blank. +- **rsync**: Fixed SSH private-key destinations failing with "Too many authentication failures" when the local SSH agent has other keys loaded. +- **vault**: Recovery Kit downloads now include `decrypt_backup.js` instead of a missing-script warning. Thanks @jpb0418 ([#120](https://github.com/Skyfay/DBackup/issues/120)) + +### π§ CI/CD + +- **scripts**: `generate-stress-data.sh` now also populates Redis and Firebird test containers. +- **scripts**: Added `test-vm-up.sh` / `test-vm-down.sh` / `seed-ssh-test-config.ts` and a `test:vm:delete` shortcut to test SSH-mode adapters against a real remote host via a Multipass VM. +- **scripts**: `test-vm-up.sh` now starts one container per database family instead of the full test matrix, to reduce VM memory usage. +- **scripts**: `test-vm-up.sh`/`seed-ssh-test-config.ts` now install MongoDB's client tools and seed MongoDB and Firebird SSH sources, MSSQL is left out for now as the heaviest container. + +### π³ Docker + +- **Image**: `skyfay/dbackup:v2.10.0` +- **Also tagged as**: `latest`, `v2` +- **CI Image**: `skyfay/dbackup:ci` +- **Platforms**: linux/amd64, linux/arm64 + + ## v2.9.0 - Valkey Support, Storage Alert Fix, and Multiple Improvements *Released: July 4, 2026* diff --git a/docs/developer-guide/adapters/database.md b/docs/developer-guide/adapters/database.md index b1337e6b..3e76986b 100644 --- a/docs/developer-guide/adapters/database.md +++ b/docs/developer-guide/adapters/database.md @@ -13,6 +13,7 @@ Database adapters handle the dump and restore operations for different database | SQLite | `sqlite` | None (file copy) | β | `.db` | | MSSQL | `mssql` | None (TDS protocol) | β (uses SFTP) | `.bak` | | Redis | `redis` | `redis-cli` | β | `.rdb` | +| Firebird | `firebird` | `gbak`, `isql` | β | `.fbk` | ## Backup File Extensions @@ -27,6 +28,7 @@ getBackupFileExtension("redis"); // "rdb" getBackupFileExtension("mongodb"); // "archive" getBackupFileExtension("sqlite"); // "db" getBackupFileExtension("mssql"); // "bak" +getBackupFileExtension("firebird"); // "fbk" ``` ### Extension Mapping @@ -39,6 +41,7 @@ getBackupFileExtension("mssql"); // "bak" | MongoDB | `.archive` | mongodump `--archive` format | | Redis | `.rdb` | Redis Database snapshot format | | SQLite | `.db` | Direct database file copy | +| Firebird | `.fbk` | Native `gbak` backup format | ### Final Filename Examples diff --git a/docs/developer-guide/adapters/notification.md b/docs/developer-guide/adapters/notification.md index ab1c7c02..83153c35 100644 --- a/docs/developer-guide/adapters/notification.md +++ b/docs/developer-guide/adapters/notification.md @@ -943,7 +943,6 @@ docs/ βββ .vitepress/config.mts β Sidebar entry βββ changelog.md β Release notes βββ index.md β Feature card + table -βββ roadmap.md β Mark as implemented (if listed) βββ developer-guide/ βββ adapters/ βββ notification.md β Available Adapters table (this file) diff --git a/docs/developer-guide/setup.md b/docs/developer-guide/setup.md index dd21c552..baa8b401 100644 --- a/docs/developer-guide/setup.md +++ b/docs/developer-guide/setup.md @@ -17,6 +17,7 @@ Complete guide to setting up DBackup for development. - `mysql` / `mysqldump` (MySQL/MariaDB) - `psql` / `pg_dump` (PostgreSQL) - `mongodump` / `mongorestore` (MongoDB) + - `gbak` / `isql` (Firebird) - see [`scripts/setup-dev-macos.sh`](https://github.com/Skyfay/DBackup/blob/main/scripts/setup-dev-macos.sh) for a scripted macOS install (no Homebrew formula exists) ### macOS Installation diff --git a/docs/package.json b/docs/package.json index 15ede725..6c0817d2 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "dbackup-docs", - "version": "2.9.0", + "version": "2.10.0", "private": true, "scripts": { "dev": "vitepress dev", diff --git a/docs/roadmap.md b/docs/roadmap.md deleted file mode 100644 index f600ceef..00000000 --- a/docs/roadmap.md +++ /dev/null @@ -1,185 +0,0 @@ -# Roadmap - -This page outlines planned features and improvements for DBackup. Features are subject to change based on community feedback and priorities. - - - -## π Planned Features - -### Restic Storage Backend -- Support Restic as a storage destination for database backups -- Leverage Restic's block-level deduplication to minimize storage consumption (e.g. a 10 GB database growing by 100 MB/day needs ~10.9 GB instead of 104.5 GB with full dumps) -- Combined with `--rsyncable` gzip compression for even better deduplication ratios -- Requires a different backup and restore architecture compared to file-based storage adapters: separate repository management, backup browsing, and retention handling via Restic's own policies -- ([#68](https://github.com/Skyfay/DBackup/issues/68)) - -### Runner Resilience -- **Retry Logic**: Exponential backoff for transient errors (network timeouts, storage hiccups) -- **Dead Letter Queue**: Move repeatedly failing jobs to a separate status for investigation - -### Encryption Key Rotation -- Mechanism to rotate the `ENCRYPTION_KEY` without downtime -- Re-encrypt all stored secrets (DB passwords, SSO client secrets) with the new key -- Rotation guide in documentation - -### User Invite Flow -- Email-based user invitations -- Force password change on first login -- Integration with SMTP notification adapter - -### Backup Tags & Annotations -- Manually tag backups (e.g., "pre-migration", "before-upgrade") -- Pin backups to protect them from automatic retention policy deletion -- Filter and search by tags in Storage Explorer - -### Backup Anomaly Detection -- Alert if backup size deviates significantly from previous runs -- Periodic "test restore" as a scheduled task - -### Stream-based Backup Pipeline (Large DB Mode) -- Opt-in mode that pipes the database dump directly to storage without writing to `/tmp` first -- Eliminates local disk space requirements for large databases (100 GB+) -- Parallel upload to multiple destinations via "Tee" stream logic -- Inline checksum and metadata computation via Transform streams -- Primarily aimed at environments with limited local storage (small VMs, Raspberry Pi, low-disk VPS) -- ([#76](https://github.com/Skyfay/DBackup/issues/76)) - - - -## π Dashboard & Monitoring - -### Backup Calendar View -- Visual overview of when backups ran (similar to GitHub contribution graph) -- Color-coded status (success, failed, skipped) - -### Prometheus Metrics Endpoint -- Expose `/metrics` endpoint for Prometheus scraping -- Metrics: backup count, duration, size, success rate, queue depth -- Grafana dashboard template - - - -## π§ͺ Testing & Quality - -### End-to-End Test Suite -- Playwright or Cypress tests for critical user flows -- Login β Create job β Run backup β Restore β Verify -- Run in CI pipeline - - - -## π Database Management & Playground - -### Backup Drift Detection -- Compare current database state with last backup timestamp -- Show changes since last backup (new tables, size growth, dropped objects) -- Alert when databases have drifted significantly from their last backup - -### Server Health Dashboard -- Display server uptime, active connections, running queries, replication status -- Per-adapter health metrics (MySQL: `SHOW STATUS`, PostgreSQL: `pg_stat_activity`) -- Pre-backup health check indicator - -### Direct SQL Execution -- Connect directly to configured database sources -- Execute custom SQL queries from the web UI (read-only by default) -- Query result visualization with export to CSV/JSON -- Write mode behind separate permission (`SOURCES.QUERY_WRITE`) - -### Query Library -- Pre-built templates for common tasks (user management, table maintenance) -- Quick-action buttons in the UI - -### User & Privileges Viewer -- Read-only view of database users and their permissions -- Verify backup user has sufficient privileges -- Security audit helper - -### Storage Trend Graph -- Historical database size over time (derived from backup metadata) -- Growth rate visualization for capacity planning - - - -## π¨ Nice-to-Have - -### Internationalization (i18n) -- Multi-language UI support -- Community-contributed translations - -### Mobile Responsive UI -- Optimized layouts for tablet and mobile devices -- Status monitoring on the go - -### Backup Size Limits & Alerts -- Warning when backups are unexpectedly large or small -- Configurable thresholds per job - -### Dark Mode Refinement -- Systematic review of all components for dark mode consistency -- High-contrast accessibility mode - - - -## β Completed - -For a full list of completed features, see the [Changelog](/changelog). - -### v2.4.0 -- β Database Explorer with table browser, schema inspection, row counts, and drill-down data viewer (server-side pagination, full-text search, deep-link URLs) - -### v1.0.1 -- β Full OpenAPI 3.1 spec with interactive Scalar API reference at `/docs/api` and [api.dbackup.app](https://api.dbackup.app) - -### v1.0.0 -- β Automatic database migrations (Prisma migrate on startup) -- β Startup recovery (stale execution detection, temp file cleanup, queue re-init) -- β Partial failure handling for multi-DB backups -- β Configurable rate limiting (per-category, adjustable via Settings UI) -- β Quick Setup Wizard (guided first-run experience) -- β Self-service profile editing -- β Backup integrity checks (SHA-256 checksums, scheduled verification) -- β Disaster recovery documentation (Recovery Kit) -- β Upgrade guide for v1.0.0 (config backup/restore) -- β Audit log pagination with database indices -- β Stress testing scripts for MySQL, PostgreSQL, MongoDB, MSSQL - -### v0.9.5 β v0.9.9 -- β Interactive dashboard with charts and analytics (v0.9.5) -- β SHA-256 checksum verification with integrity check system (v0.9.5) -- β Storage usage analytics and per-destination breakdown (v0.9.5) -- β Smart type filters for sources, destinations, and notifications (v0.9.5) -- β Rsync, Google Drive, Dropbox & OneDrive storage adapters (v0.9.6) -- β Notification system overhaul with event-based routing (v0.9.6) -- β API keys with webhook triggers (v0.9.7) -- β Graceful shutdown with backup-safe SIGTERM handling (v0.9.7) -- β Robust health check endpoint (v0.9.7) -- β Notification adapters: Slack, Teams, Gotify, ntfy, Telegram, Twilio SMS, Generic Webhook (v0.9.8) -- β Storage alerts and notification logs (v0.9.9) - -### Earlier Versions -- β Multi-database support (MySQL, PostgreSQL, MongoDB, SQLite, MSSQL, Redis) -- β AES-256-GCM backup encryption with Vault -- β GZIP and Brotli compression -- β S3, SFTP, Local, WebDAV, SMB, FTP/FTPS storage adapters -- β Discord and Email notifications -- β Cron-based scheduling with GFS retention -- β RBAC permission system -- β SSO/OIDC authentication (Authentik, PocketID, Generic) -- β TOTP and Passkey 2FA -- β Live backup progress monitoring -- β System configuration backup & restore -- β Audit logging -- β Centralized logging system with custom error classes -- β wget/curl download links & token-based public downloads -- β Redis database support with restore wizard -- β Type-safe adapter configurations -- β User preferences system -- β PostgreSQL TAR architecture with per-DB custom format dumps -- β Microsoft SQL Server support with Azure SQL Edge compatibility - - - -## π‘ Feature Requests - -Have an idea for a new feature? Open an issue on [GitHub](https://github.com/Skyfay/DBackup/issues). diff --git a/docs/user-guide/sources/firebird.md b/docs/user-guide/sources/firebird.md new file mode 100644 index 00000000..606d2e2a --- /dev/null +++ b/docs/user-guide/sources/firebird.md @@ -0,0 +1,157 @@ +# Firebird + +Firebird is an open-source relational database. DBackup supports Firebird backups using the native `gbak` backup/restore utility. + +## Supported Versions + +| Versions | +| :--- | +| 3.x, 4.x, 5.x | + +::: info Legacy versions +Firebird 2.5 and the legacy `.gdb` file format are not supported. +::: + +## Connection Modes + +| Mode | Description | +| :--- | :--- | +| **Direct** | DBackup runs `gbak`/`isql` locally and connects to the remote Firebird server over its wire protocol (port 3050) | +| **SSH** | DBackup connects via SSH and runs `gbak`/`isql` on the remote host, reading the local `.fdb` path directly | + +## Architecture + +Firebird has no server-side "list all databases" command - every `.fdb` file is a standalone database with no central registry to query. Because of this, a Firebird source works differently from other adapters in one respect: + +- **You enter a list of database aliases once**, when creating the source: an alias name (shown everywhere else in DBackup) mapped to the actual file path on the Firebird server. +- **Everywhere else is unchanged** - the job form's database picker, the backup pipeline, and the restore UI all work with these alias names exactly like they would with any other adapter's database list. +- If a new database is added to the Firebird server later, it won't appear automatically - add its alias and path to the source configuration. + +## Configuration + +::: info Credential Profiles +A `USERNAME_PASSWORD` credential profile is required for the SYSDBA (or equivalent) user. SSH mode additionally requires an `SSH_KEY` profile. +::: + +| Field | Description | Default | Required | +| :--- | :--- | :--- | :--- | +| **Connection Mode** | Direct (TCP) or SSH | `Direct` | β | +| **Host** | Firebird server hostname or IP | `localhost` | β | +| **Port** | Firebird server port | `3050` | β | +| **Primary Credential** | `USERNAME_PASSWORD` credential profile | - | β | +| **Database Aliases** | List of `{ name, path }` entries - the alias shown in DBackup and the `.fdb` path on the Firebird server | - | β (at least one) | +| **Additional Options** | Extra `gbak` flags | - | β | + +### SSH Mode Fields + +These fields appear when **Connection Mode** is set to **SSH**: + +| Field | Description | Default | Required | +| :--- | :--- | :--- | :--- | +| **SSH Host** | SSH server hostname or IP | - | β | +| **SSH Port** | SSH server port | `22` | β | +| **SSH Credential** | `SSH_KEY` credential profile (username + key or password) | - | β | + +::: tip Paths in SSH Mode +In SSH mode, database paths are local paths **on the SSH target**, since `gbak` runs there directly - not paths as seen from the Firebird server's own network. In Direct mode, paths are as seen from the Firebird server (aliases the server itself resolves). +::: + +## Example Configuration + +### Direct Mode + +``` +Host: firebird.example.com +Port: 3050 +Primary Credential: my-firebird-sysdba (USERNAME_PASSWORD profile) +Database Aliases: + erp -> /data/erp.fdb + crm -> /data/crm.fdb +``` + +### SSH Mode + +``` +SSH Host: firebird.example.com +SSH Credential: my-firebird-ssh-key (SSH_KEY profile) +Database Aliases: + erp -> /var/lib/firebird/data/erp.fdb +``` + +## Backup File Format + +- **Single alias selected**: stored directly as a `.fbk` file (gbak's native backup format) - no archive wrapper +- **Multiple aliases selected**: packed into a TAR archive containing one `.fbk` file per database plus a manifest + +With compression and encryption enabled: +- Single database: `backup_2026-02-02.fbk.gz.enc` +- Multiple databases: `backup_2026-02-02.tar.gz.enc` + +## Restore Limitations + +::: warning Restore is scoped to pre-configured aliases +Because a Firebird alias has no meaning without a matching file path, restore only lets you pick among the **aliases already configured** on the target source (shown as a dropdown) - you cannot restore into an arbitrary new database name. To restore into a new location, add its alias and path to the target source first, then restore into it. +::: + +Restoring always replaces the target file's contents (`gbak -rep`) - there's no separate "create only" step, so make sure you're restoring into the intended alias. + +DBackup also blocks restoring a backup taken on a newer Firebird version onto an older target server, consistent with the version guard used by other adapters. + +## Required CLI Tools + +The Firebird adapter requires `gbak` (backup/restore) and `isql` (connection test/version check). + +### Direct Mode + +Already included in the DBackup Docker image. + +**Manual Installation**: install the Firebird client tools matching your distribution, or download the official release from the [Firebird project](https://github.com/FirebirdSQL/firebird/releases). + +### SSH Mode + +`gbak` and `isql` must be installed on the **remote SSH server**: + +```bash +# Debian/Ubuntu (client package version may lag behind the latest server release) +apt-get install firebird3.0-utils +``` + +::: danger Important +In SSH mode, `gbak`/`isql` must be installed on the remote server. DBackup executes them remotely via SSH and streams the backup output back. +::: + +## Troubleshooting + +### Unknown Database Alias + +``` +Unknown Firebird database alias "accounting". Configured aliases: erp, crm. +``` + +**Solution:** Add the missing alias and its `.fdb` path to the source configuration, or pick one of the listed aliases. + +### Connection Refused + +Ensure the Firebird server is listening on the configured port and accepts remote connections (check `firebird.conf` / `RemoteBindAddress`). + +### SSH: Binary Not Found + +``` +Required binary not found on remote server. Tried: gbak +``` + +**Solution:** Install the Firebird client tools on the remote server (see above). + +### Restore Blocked by Version Guard + +``` +Running restore of a newer database version on an older server is not recommended... +``` + +**Solution:** Restore onto a Firebird server running the same or a newer version than the one the backup was taken on. + +## See Also + +- [Storage Explorer](/user-guide/features/storage-explorer) - Browse and download backups +- [Restore Guide](/user-guide/features/restore) - General restore documentation +- [Encryption](/user-guide/security/encryption) - Encrypting your backups diff --git a/docs/user-guide/sources/index.md b/docs/user-guide/sources/index.md index 0510a797..3a469c37 100644 --- a/docs/user-guide/sources/index.md +++ b/docs/user-guide/sources/index.md @@ -14,6 +14,7 @@ DBackup supports a wide variety of database engines. | [Valkey](/user-guide/sources/valkey) | 7.2+ | `redis-cli --rdb` | Manual | | [SQLite](/user-guide/sources/sqlite) | 3.x | `.dump` command | β | | [MSSQL](/user-guide/sources/mssql) | 2017, 2019, 2022 | `BACKUP DATABASE` | β | +| [Firebird](/user-guide/sources/firebird) | 3.x, 4.x, 5.x | `gbak` | β (pre-configured aliases) | ## Database Explorer diff --git a/eslint.config.mjs b/eslint.config.mjs index cc529e52..ee957997 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -33,6 +33,8 @@ const eslintConfig = defineConfig([ "docs/.vitepress/theme/**", // API docs build artifacts - bundled third-party code "api-docs/dist/**", + // Website - own independent Next.js project, own eslint config, own tooling + "website/**", // Coverage reports - auto-generated by vitest "coverage/**", ]), diff --git a/package.json b/package.json index 9a23c64c..421b89bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dbackup", - "version": "2.9.0", + "version": "2.10.0", "private": true, "scripts": { "dev": "prisma migrate deploy && prisma generate && next dev", @@ -18,6 +18,10 @@ "test:seed": "npx tsx scripts/seed-test-sources.ts", "test:seed:snapshots": "npx tsx scripts/seed-storage-snapshots.ts", "test:ui": "pnpm run test:env:up && sleep 30 && pnpm run test:seed", + "test:vm:up": "./scripts/test-vm-up.sh", + "test:vm:down": "./scripts/test-vm-down.sh", + "test:vm:delete": "./scripts/test-vm-down.sh --delete", + "test:vm:seed": "npx tsx scripts/seed-ssh-test-config.ts", "test:stress:generate": "./scripts/generate-stress-data.sh", "test:stress": "pnpm run test:env:up && sleep 45 && pnpm run test:stress:generate", "version:sync": "./scripts/sync-version.sh --sync-only", @@ -29,6 +33,10 @@ "docs:dev": "cd docs && pnpm dev", "docs:build": "cd docs && pnpm build", "docs:preview": "cd docs && pnpm preview", + "website:install": "cd website && pnpm install", + "website:dev": "cd website && pnpm dev", + "website:build": "cd website && pnpm build", + "website:preview": "cd website && pnpm preview", "update:check": "pnpm outdated --recursive 2>&1" }, "dependencies": { diff --git a/public/openapi.yaml b/public/openapi.yaml index 6cb79c02..28535885 100644 --- a/public/openapi.yaml +++ b/public/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.1.0 info: title: DBackup API - version: 2.9.0 + version: 2.10.0 description: | REST API for DBackup - a self-hosted database backup automation platform with encryption, compression, and smart retention. diff --git a/scripts/generate-stress-data.sh b/scripts/generate-stress-data.sh index c03213c6..8c03716c 100755 --- a/scripts/generate-stress-data.sh +++ b/scripts/generate-stress-data.sh @@ -11,6 +11,8 @@ # pnpm run test:stress:generate postgres # Only PostgreSQL # pnpm run test:stress:generate mongodb # Only MongoDB # pnpm run test:stress:generate mssql # Only MSSQL +# pnpm run test:stress:generate redis # Only Redis +# pnpm run test:stress:generate firebird # Only Firebird # # Environment: # TARGET_SIZE_MB=1500 # Target size per database (default: 1500) @@ -320,6 +322,112 @@ WHERE t.name = 'stress_data'; echo -e " ${GREEN}β Done! Table size: ${SIZE} MB${NC}" } +# ==================== Redis ==================== +populate_redis() { + local CONTAINER=$1 + local NAME=$2 + local PASSWORD="testpassword" + # 4x the target keyspace so random SET keys land close to TOTAL_ROWS unique entries + # (redis-benchmark's -r picks random keys with replacement, so some collisions are expected). + local KEYSPACE=$((TOTAL_ROWS * 4)) + + echo -e "\n${YELLOW}π Populating ${NAME}...${NC}" + + docker exec ${CONTAINER} redis-cli -a ${PASSWORD} --no-auth-warning FLUSHALL >/dev/null 2>&1 + + # redis-benchmark's own SET test generates ~1KB random-keyed values much faster + # than a scripted loop of individual SET commands. + docker exec ${CONTAINER} redis-benchmark -a ${PASSWORD} \ + -t set -n ${TOTAL_ROWS} -r ${KEYSPACE} -d 1000 -P 50 -q 2>/dev/null + + # Show size + KEYS=$(docker exec ${CONTAINER} redis-cli -a ${PASSWORD} --no-auth-warning DBSIZE 2>/dev/null) + SIZE_BYTES=$(docker exec ${CONTAINER} redis-cli -a ${PASSWORD} --no-auth-warning INFO memory 2>/dev/null | grep "^used_memory:" | tr -d '\r' | cut -d: -f2) + SIZE_MB=$(( ${SIZE_BYTES:-0} / 1024 / 1024 )) + echo -e " ${GREEN}β Done! ${KEYS} keys, used memory: ${SIZE_MB} MB${NC}" +} + +# ==================== Firebird ==================== +populate_firebird() { + local CONTAINER=$1 + local NAME=$2 + local DB_PATH="/var/lib/firebird/data/testdb.fdb" + local ISQL_CMD="ISC_PASSWORD=masterkey isql -user sysdba ${DB_PATH}" + local BATCH=50000 + + echo -e "\n${YELLOW}π Populating ${NAME}...${NC}" + + # Drop (if present) and recreate the table. Firebird's client binaries live inside + # the container itself (see docker-compose.test.yml), so isql runs via docker exec + # rather than a host-installed client. + docker exec -i ${CONTAINER} bash -c "${ISQL_CMD}" <DBackup cannot check whether a database already exists at this path - Firebird has no way to list databases. Existing files at this path will be overwritten.
+- The database names in this backup could not be determined automatically. - Leave empty to restore into the original database, or specify a target name. + {isFirebird + ? "The database alias in this backup could not be determined automatically. Leave empty to restore into the original database, or specify a target path." + : "The database names in this backup could not be determined automatically. Leave empty to restore into the original database, or specify a target name."}
- If empty, the backup will be restored into its original database. Existing data will be overwritten. + {isFirebird + ? "If empty, the backup is restored into its original database. If you enter a path, DBackup cannot verify whether a database already exists there - existing files at that path will be overwritten." + : "If empty, the backup will be restored into its original database. Existing data will be overwritten."}
+ Firebird cannot list databases automatically - enter the alias and path (as seen by the Firebird server) for each database to back up. +
++ {new Date(post.date).toLocaleDateString("en-US", { + year: "numeric", + month: "long", + day: "numeric", + })}{" "} + Β· {post.author} +
++ {point.description} +
+
+ {children}
+
+ + Self-hosted, multi-database backups with Direct or SSH connection + modes, a full REST API, and a Recovery Kit that works with or + without DBackup. +
+ ++ {point.description} +
++ {new Date(post.date).toLocaleDateString("en-US", { + year: "numeric", + month: "long", + day: "numeric", + })} +
+{post.excerpt}
+ {post.tags?.length > 0 && ( ++ + Read the full installation guide + +
+{milestone.title}
+{milestone.description}
+{item.description}
+ {item.issueNumber && ( + + #{item.issueNumber} ++ Nothing in this category right now. +
+ )} ++ {item.description} +
+ + View in changelog ++ {eyebrow} +
+ )} ++ {description} +
+ )} +{stat.value}
+{stat.label}
+
+ {highlightedHtml ? (
+
+ ) : (
+ {code}
+ )}
+
+