maxisam / mgob

MongoDB dockerized backup agent. Runs schedule backups with retention, S3 & SFTP upload, notifications, instrumentation with Prometheus and more.
https://maxisam.github.io/mgob/
MIT License
137 stars 19 forks source link

Configure target with connection string URI #81

Closed hypesystem closed 9 months ago

hypesystem commented 1 year ago

In the examples in the README for how to configure a target mongod the format is something like this:

target:
  # mongod IP or host name
  host: "172.18.7.21"
  # mongodb port
  port: 27017
  # mongodb database name, leave blank to backup all databases
  database: "test"
  # leave blank if auth is not enabled
  username: "admin"
  password: "secret"

The kubernetes MongoCommunity operator automatically creates secrets with a connection string, which means it would be nice to be able to set that directly in the config:

target:
  connectionString: mongodb://admin:secret@172.18.7.21/test

See the mongodb community operator docs here: https://github.com/mongodb/mongodb-kubernetes-operator/blob/master/docs/deploy-configure.md#deploy-a-replica-set

Is this something that could be considered as an additional option?

hypesystem commented 1 year ago

Let me know if this is something I can contribute to the project, and if there are any pointers to where I should start

maxisam commented 1 year ago

I will add this feature soon

maxisam commented 1 year ago

The feature was there already, just not being document properly.

I just reorganized the document and add e2e test for it. The doc about how to use it.

https://github.com/maxisam/mgob/blob/main/.document/BACKUP_PLAN.md#uri-usage