feat(drivers/mongodb): add MongoDB driver, docs, packaging, and tests - #2
Open
SakuraIsayeki wants to merge 1 commit into
Open
feat(drivers/mongodb): add MongoDB driver, docs, packaging, and tests#2SakuraIsayeki wants to merge 1 commit into
SakuraIsayeki wants to merge 1 commit into
Conversation
Add a bundled MongoDB driver that discovers authorized databases and produces filtered per-database mongodump archives or directory dumps. Include the driver executable (prepare/connectivity/health verbs), canonical driver reference, restore runbook, example instance and secret files, and guidance in README and guides. Add Debian packaging for backmaster-driver-mongodb, require mongodb-mongosh and mongodb-database-tools, and update the metapackage and package tests. Add CI and unit tests (tests/mongodb-driver.bash) and run the new tests in the workflow.
There was a problem hiding this comment.
Pull request overview
Adds a bundled MongoDB backup driver with packaging, configuration examples, restore guidance, and automated tests.
Changes:
- Implements filtered per-database archive and directory dumps.
- Adds Debian packaging and CI coverage.
- Documents installation, operation, security, and restoration.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/ci.yml |
Runs MongoDB driver tests. |
.github/workflows/deb.yml |
Validates the additional package. |
README.md |
Introduces MongoDB support. |
config/drivers/mongodb.env.example |
Provides driver configuration. |
config/drivers/mongodb.secrets.env.example |
Provides credential examples. |
config/instances/nsys-mongodb.env.example |
Defines an example instance. |
docs/drivers/index.md |
Lists the MongoDB driver. |
docs/drivers/mongodb.md |
Documents driver behavior and setup. |
docs/guides/configuration.md |
Covers MongoDB configuration. |
docs/guides/index.md |
Links the restore guide. |
docs/guides/installation.md |
Adds MongoDB installation steps. |
docs/guides/mongodb-restore.md |
Adds the restore runbook. |
docs/guides/operations.md |
Adds verification and MongoDB operations. |
docs/guides/secrets.md |
Documents MongoDB credentials. |
docs/guides/systemd.md |
Covers MongoDB service ordering. |
docs/guides/troubleshooting.md |
Adds MongoDB diagnostics. |
drivers/mongodb/driver |
Implements discovery and dumps. |
packaging/build-deb.sh |
Builds the MongoDB driver package. |
tests/debian-packages.bash |
Tests package metadata and contents. |
tests/mongodb-driver.bash |
Tests driver filtering and output. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+50
to
+51
| if [[ -n "${MONGODB_PASSWORD:-}" ]]; then | ||
| CONNECTION_ARGUMENTS+=(--password="$MONGODB_PASSWORD") |
Comment on lines
+68
to
+69
| if [[ "${MONGODB_TLS_INSECURE:-false}" == true ]]; then | ||
| CONNECTION_ARGUMENTS+=(--tls --tlsInsecure) |
Comment on lines
+163
to
+165
| sudo install -m 0640 -o root -g backmaster \ | ||
| "$docs/config/drivers/mongodb.secrets.env.example" \ | ||
| /etc/backmaster/secrets/production-mongodb-driver.env |
Comment on lines
+226
to
+233
| case "$(jq -er '.artifact.format' manifest.json)" in | ||
| zip) unzip "$archive" ;; | ||
| tar.gz) tar -xzf "$archive" ;; | ||
| tar.xz) tar -xJf "$archive" ;; | ||
| tar.zst) tar --zstd -xf "$archive" ;; | ||
| esac | ||
|
|
||
| sha256sum --check checksums.sha256 |
Comment on lines
+57
to
+58
| restore_args+=(--nsFrom="${source_database}.*" \ | ||
| --nsTo="${target_database}.*") |
| install -d -m 0755 "$meta_root/DEBIAN" | ||
| write_control "$META_PACKAGE" \ | ||
| "$CORE_PACKAGE (= $VERSION), $DRIVER_PACKAGE (= $VERSION), $RCLONE_EXPORTER_PACKAGE (= $VERSION)" \ | ||
| "$CORE_PACKAGE (= $VERSION), $POSTGRES_DRIVER_PACKAGE (= $VERSION), $RCLONE_EXPORTER_PACKAGE (= $VERSION)" \ |
| sudo install -d -m 0755 \ | ||
| /etc/backmaster/instances.d \ | ||
| /etc/backmaster/drivers/postgres \ | ||
| /etc/backmaster/drivers/mongodb \ |
Comment on lines
+193
to
+194
| instances. Replace `backmaster-driver-postgres` with | ||
| `backmaster-driver-mongodb` on MongoDB instances. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a bundled MongoDB driver that discovers authorized databases and produces filtered per-database mongodump archives or directory dumps. Include the driver executable (prepare/connectivity/health verbs), canonical driver reference, restore runbook, example instance and secret files, and guidance in README and guides.
Add Debian packaging for backmaster-driver-mongodb, require mongodb-mongosh and mongodb-database-tools, and update the metapackage and package tests. Add CI and unit tests (tests/mongodb-driver.bash) and run the new tests in the workflow.