Skip to content

feat(drivers/mongodb): add MongoDB driver, docs, packaging, and tests - #2

Open
SakuraIsayeki wants to merge 1 commit into
mainfrom
feature/mongo-driver
Open

feat(drivers/mongodb): add MongoDB driver, docs, packaging, and tests#2
SakuraIsayeki wants to merge 1 commit into
mainfrom
feature/mongo-driver

Conversation

@SakuraIsayeki

Copy link
Copy Markdown
Member

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.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread drivers/mongodb/driver
Comment on lines +50 to +51
if [[ -n "${MONGODB_PASSWORD:-}" ]]; then
CONNECTION_ARGUMENTS+=(--password="$MONGODB_PASSWORD")
Comment thread drivers/mongodb/driver
Comment on lines +68 to +69
if [[ "${MONGODB_TLS_INSECURE:-false}" == true ]]; then
CONNECTION_ARGUMENTS+=(--tls --tlsInsecure)
Comment thread docs/drivers/mongodb.md
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 thread docs/guides/operations.md
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}.*")
Comment thread packaging/build-deb.sh
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 thread docs/guides/operations.md
Comment on lines +193 to +194
instances. Replace `backmaster-driver-postgres` with
`backmaster-driver-mongodb` on MongoDB instances.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants