Consider a three-tier configuration system #3

Closed
opened 2018-01-05 05:33:25 +00:00 by import_bot · 5 comments
Collaborator

It would be useful if borgmatic supported (3) tiers of configuration files.

  1. the defaults, hard coded into the program
  2. /etc/borgmatic/config (system wide settings)
  3. ~/.borgmatic.conf (user specific settings)

That would provide a bit of flexibility so that the "postgres" user can do it's own "borgmatic" backups, without needing to be configured by the root user.

Down the road, maybe there are "job-specific" settings files under ~/.borgmatic.d/*.job

That way you could backup different parts of the system with different borgmatic settings.


Imported from Taiga issue 2 (to do). Created on 2015-07-26T14:08:10+0000 by Thomas Harold.

It would be useful if borgmatic supported (3) tiers of configuration files. 1. the defaults, hard coded into the program 2. /etc/borgmatic/config (system wide settings) 3. ~/.borgmatic.conf (user specific settings) That would provide a bit of flexibility so that the "postgres" user can do it's own "borgmatic" backups, without needing to be configured by the root user. Down the road, maybe there are "job-specific" settings files under ~/.borgmatic.d/*.job That way you could backup different parts of the system with different borgmatic settings. --- Imported from Taiga issue 2 (to do). Created on 2015-07-26T14:08:10+0000 by Thomas Harold.
Author
Collaborator

This would require some config file merging/overriding logic, but that shouldn't be too hard given the current approach with treating parsed config file contents as data blobs.


Comment on 2015-07-26T15:11:55+0000 by Dan Helfman.

This would require some config file merging/overriding logic, but that shouldn't be too hard given the current approach with treating parsed config file contents as data blobs. --- Comment on 2015-07-26T15:11:55+0000 by Dan Helfman.
Author
Collaborator

Actually, thinking about this a little more, config value merging/overriding may not be necessary or desirable. It may be better to have overriding work at the whole-config-file granularity. So for instance if a ~/.borgmatic.conf exists, then that file would be used for all settings and /etc/borgmatic/config wouldn't be read at all.

Thoughts? How do most other programs do it?


Comment on 2015-07-30T02:52:28+0000 by Dan Helfman.

Actually, thinking about this a little more, config value merging/overriding may not be necessary or desirable. It may be better to have overriding work at the whole-config-file granularity. So for instance if a ~/.borgmatic.conf exists, then that file would be used for all settings and /etc/borgmatic/config wouldn't be read at all. Thoughts? How do most other programs do it? --- Comment on 2015-07-30T02:52:28+0000 by Dan Helfman.
Author
Collaborator

Speaking as a sys-admin:

There are definitely some settings that would be best to be defined at a
global level such as the following. That way I could set them once at the
server level and not have to re-specify them at the per-user or per-job
level.

  • mail server
  • mail server port
  • alert mailing list
  • sender address
  • sender account name
  • sender password
  • email alert prefix string (if something other then the hostname is
    desired)
  • last-N setting for borg
  • what verifications to do

Any or all of those could then be overridden at the user level (i.e. the
'postgres' user which backups the postgresql databases). i.e. issues with
backing up using the postgres user might want to alert a different set of
admins that the backups failed. And for a personal user like 'jsmith', who
is running personal borgmatic backups, those alerts should go to
jsmith@somewhereelse.

I might define a global Last-N of 10, but then decide that the backups done
while logged in as the postgres user should be checked with a Last-N of 25.

Or a specific backup which is really critical, might need a Last-N of 50.

Mostly it gives flexibility. But if Cronmatic will handle all the email
issues, then that just leaves smaller (and much fewer) settings like Last-N
and which verifications to do. So it does become less important because
I'm only re-defining a handful (no more then 4) variables at the per-user
or per-job level instead of a dozen or more.


Comment on 2015-08-03T10:44:18+0000 by Thomas Harold.

Speaking as a sys-admin: There are definitely some settings that would be best to be defined at a global level such as the following. That way I could set them once at the server level and not have to re-specify them at the per-user or per-job level. - mail server - mail server port - alert mailing list - sender address - sender account name - sender password - email alert prefix string (if something other then the hostname is desired) - last-N setting for borg - what verifications to do Any or all of those could then be overridden at the user level (i.e. the 'postgres' user which backups the postgresql databases). i.e. issues with backing up using the postgres user might want to alert a different set of admins that the backups failed. And for a personal user like 'jsmith', who is running personal borgmatic backups, those alerts should go to jsmith@somewhereelse. I might define a global Last-N of 10, but then decide that the backups done while logged in as the postgres user should be checked with a Last-N of 25. Or a specific backup which is really critical, might need a Last-N of 50. Mostly it gives flexibility. But if Cronmatic will handle all the email issues, then that just leaves smaller (and much fewer) settings like Last-N and which verifications to do. So it does become less important because I'm only re-defining a handful (no more then 4) variables at the per-user or per-job level instead of a dozen or more. --- Comment on 2015-08-03T10:44:18+0000 by Thomas Harold.
Author
Collaborator

While this ticket isn't implemented, I'll note that /etc/borgmatic.d/ is now supported. Additionally, you can provide a list of configuration files or directories on the borgmatic command-line, and they'll all be run in succession.


Comment on 2017-07-30T18:24:38+0000 by Dan Helfman.

While this ticket isn't implemented, I'll note that /etc/borgmatic.d/ is now supported. Additionally, you can provide a list of configuration files or directories on the borgmatic command-line, and they'll all be run in succession. --- Comment on 2017-07-30T18:24:38+0000 by Dan Helfman.
Owner

I'm closing this in favor of #148. Once implemented, that would allow you to set up your own means of configuration file merging and reuse.

I'm closing this in favor of #148. Once implemented, that would allow you to set up your own means of configuration file merging and reuse.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#3
No description provided.