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

Add basic dynamic configuration with volume labels #258

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rdelaage
Copy link
Contributor

@rdelaage rdelaage commented Nov 13, 2022

closes #256

This PR add a basic docker discovery system to autorestic. Autorestic can now connect to a docker daemon, check for volumes with a autorestic.enable set to 1 or true and backup to the backend configured in autorestic.to label. You can also specify a cron in autorestic.cron label.

This service discovery is only enabled when the --docker-discovery flag is set.

Since I am used to work with podman and autorestic use the docker command, I needed to add a --docker-host flag used to change the host used in the docker command if specified (unix:///var/run/user/1000/podman/podman.sock for me when working with the podman user socket)

The app still need a static configuration file to configure backends and global options. You can also use location both in the static configuration file and docker labels. The new behavior just append the dynamic configuration to the config variable after parsing the config file.

This PR is in draft mode because I would like your suggestions about this feature.

@vercel
Copy link

vercel bot commented Nov 13, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
autorestic ✅ Ready (Inspect) Visit Preview Nov 14, 2022 at 2:56PM (UTC)

@rdelaage
Copy link
Contributor Author

I added all the relevant options for the volume type. The list of backend is ; separated. You can specify a copy option with autorestic.copy.<fromRepo> and a ; separated list of backend. The forget option with autorestic.forget, the hooks with autorestic.hooks.dir, autorestic.hooks.before, autorestic.hooks.after, autorestic.hooks.success, autorestic.hooks.failure and finally additional flags with autorestic.options.<command|all>.<flagName> and a ; separated list of values.

@Akruidenberg
Copy link

Any progres?

@rdelaage
Copy link
Contributor Author

Hello @Akruidenberg I was supposed to do some refactoring first but I didn't found time, I am quite busy right now in my personal life. But feel free to test it and suggest things!

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.

Configuration discovery via docker daemon
2 participants