Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite service layout & add sftp support #24

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ekohl
Copy link

@ekohl ekohl commented Apr 7, 2023

Within the Foreman project there was a need to have backups and while writing my own module I found yours. It largely solves my need, but I prefer a different style that uses native systemd functionality. Instead of relying on concat resources, it uses drop in files.

Then I added sftp support, since that's what we use in our infra.

Currently the tests are broken because I haven't had time to look at them. I also don't use the PDK so it's been a bit painful. The acceptance tests were ran using Beaker and Vox Pupuli's acceptance setup.

For now this is mostly here so I can at least track a PR while I start using this in production.

Fixes #23

ekohl added 6 commits March 20, 2023 22:55
In Puppet the following is true:

    Array('string') == Array(['string']) == ['string']

This can be used to make sure variables are always arrays. Then it's
simple to concat these using + to avoid a call to flatten.

With this it's ensured there are no undef values, so this can be safely
dropped.
This changes the service layout to install common services:

* [email protected] and [email protected]
* [email protected] and [email protected]
* [email protected] and [email protected]

Then for every repository an instance can be configured and enabled.
The instances are configured using systemd drop in files, which means
it's easier to see which repositories actually override parameters.

It also introduces a restic system user (and group), which through the
use of the CAP_DAC_READ_SEARCH capability is still able to read all
files if needed.

The config files are read as environment files from /etc/restic, rather
than /etc/default. Using EnvironmentFile is the most secure option,
since every user can read the systemd service files. The /etc/restic
directory is better to keep everything in one place. /etc/default is
also not common on Red Hat based operating systems.
CentOS 7 is not listed because the restic package isn't in EPEL7.
This does not yet add support for passing a username, but this can be
configured via the user's SSH config.
@crazymind1337
Copy link
Collaborator

crazymind1337 commented Nov 10, 2023

@ekohl thanks for the PR and sorry for the late reply. I did not expect other to work on that repo :D

Would it be possible to split the PR into separate PRs? Like fixing examples, adding sftp, and rework service.

@crazymind1337
Copy link
Collaborator

I like the approach. Since you are doing a huge breaking change it would be nice to add a migration path for those who are currently using the module.

@tcassaert
Copy link

Is this new approach still something being considered?

@ekohl
Copy link
Author

ekohl commented Sep 28, 2024

I'll admit that I haven't had time to look at this further.

@toggetit
Copy link

Vote for this PR =)

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.

Systemd setup
4 participants