-
Notifications
You must be signed in to change notification settings - Fork 25
feat(backup): route all backup traffic through rclone-gateway #1175
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
Open
DavidePrincipi
wants to merge
26
commits into
main
Choose a base branch
from
feat-7814
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
5b2259e
chore(deps): rebase on Alpine 3.23.4
DavidePrincipi 5338ee2
feat(rclone-gateway): Restic Rest & WebDAV server
DavidePrincipi 614594e
feat(backup): store rclone config in private Redis
DavidePrincipi 307d0d4
feat(backup): event backup-destination-changed
DavidePrincipi 9e41872
feat: migration of node Redis ACLs and backup keys
DavidePrincipi a307f4b
feat(api-server,agent): obfuscate *key/*pass
DavidePrincipi 56ad90d
feat(backup): add schedule-backup command
DavidePrincipi fbdffcb
refactor(backup): module-backup output and locking
DavidePrincipi 2c323b6
feat(backup): add run-backup node orchestrator
DavidePrincipi 1aeb3b6
refactor(list-backups): read status from node keys
DavidePrincipi 6acb611
feat(backup): write per-backup prom files
DavidePrincipi 48e35d3
refactor(backup): remove configure-backup action
DavidePrincipi 2bd582d
refactor(backup): simplify cluster backup actions
DavidePrincipi 44a518b
feat(backup): upload cluster backup from run-backup
DavidePrincipi d056da9
fix(list-backups): repository_path value
DavidePrincipi 87da3ba
chore: fix example of backup repo path
DavidePrincipi 6f9cbd4
feat(backup): persist secrets and UUIDs in dump
DavidePrincipi 9924689
feat: route restic through rclone-gateway REST endpoint
DavidePrincipi a66aa85
fix(backup): import destinations properly
DavidePrincipi e5eb815
refactor(backup): use destination_ids list in event
DavidePrincipi a92b33a
refactor(backup): clean up read-backup-snapshots
DavidePrincipi 345f4ca
fix(rclone-gateway): missing haproxy dir on first setup
DavidePrincipi 4f9a862
feat(backup): add rclone provider, hide secrets
DavidePrincipi 8c191b2
feat(backup): use WebDAV for metadata uploads
DavidePrincipi 1082e2a
fix(restore-module): never remove Traefik
DavidePrincipi 1e7c66c
feat(read-backup-snapshots): return size and dates
DavidePrincipi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| [Unit] | ||
| Description=Backup timers (from Redis state) | ||
| After=redis.service | ||
| Requires=redis.service | ||
| ConditionPathExists=/var/lib/nethserver/node/state/rclone | ||
|
|
||
| [Service] | ||
| Type=oneshot | ||
| RemainAfterExit=yes | ||
| ExecStart=runagent -m node schedule-backup start-timers | ||
| ExecStop=runagent -m node schedule-backup stop-timers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| [Unit] | ||
| Description=Rclone Gateway server | ||
| After=redis.service | ||
| Wants=redis.service backup-timers.service | ||
| StartLimitIntervalSec=10s | ||
| StartLimitBurst=3 | ||
| ConditionPathExists=/etc/wireguard/wg0.conf | ||
|
|
||
| [Service] | ||
| Type=forking | ||
| WorkingDirectory=/var/lib/nethserver/node/state | ||
| PIDFile=%t/%N.pid | ||
| Environment=PODMAN_SYSTEMD_UNIT=%n | ||
| Environment=BACKUP_VOLUME=rclone-webdav | ||
| EnvironmentFile=/etc/nethserver/core.env | ||
| EnvironmentFile=-/var/lib/nethserver/node/state/rclone-webdav.env | ||
| Restart=always | ||
| TimeoutStopSec=120 | ||
| TimeoutStartSec=120 | ||
| SuccessExitStatus=143 | ||
| ExecStartPre=/bin/rm -f %t/%N.pid %t/%N.cid | ||
| ExecStartPre=mkdir -vp rclone haproxy | ||
| ExecStartPre=-runagent -m node rclonegwctl write-configuration --rclonedir=rclone --haproxydir=haproxy | ||
| ExecStart=/usr/bin/podman run \ | ||
| --conmon-pidfile=%t/%N.pid \ | ||
| --cidfile=%t/%N.cid \ | ||
| --cgroups=no-conmon \ | ||
| --detach \ | ||
| --init \ | ||
| --log-opt=tag=%N \ | ||
| --replace --name=%N \ | ||
| --network=host \ | ||
| --volume=./rclone:/etc/rclone:ro,Z \ | ||
| --volume=./haproxy:/etc/haproxy:ro,Z \ | ||
| --volume=${BACKUP_VOLUME}:/srv/repo:z \ | ||
| --mount=type=tmpfs,tmpfs-size=10M,destination=/var/lib/rclone,chown=true \ | ||
| --volume=/dev/log:/dev/log \ | ||
| --volume=rclone-cache:/var/cache/rclone:Z \ | ||
| --entrypoint=rclone-gateway-entrypoint.sh \ | ||
| --env-file=rclone-webdav.env \ | ||
| ${RCLONE_IMAGE} | ||
| ExecStartPost=bash -c '{ while ! exec 3<>/dev/tcp/127.0.0.1/4694; do sleep 5 ; done } &>/dev/null' | ||
| ExecReload=runagent -m node rclonegwctl write-configuration --rclonedir=rclone --haproxydir=haproxy | ||
| ExecReload=runagent -m node podman exec %N reload-config | ||
| ExecStop=/usr/bin/podman stop --ignore --cidfile %t/%N.cid -t 115 | ||
| ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/%N.cid | ||
|
|
||
| [Install] | ||
| WantedBy=default.target | ||
| Alias=rclone-webdav.service | ||
This file was deleted.
Oops, something went wrong.
79 changes: 0 additions & 79 deletions
79
core/imageroot/usr/local/agent/actions/configure-backup/50write_systemd_units
This file was deleted.
Oops, something went wrong.
69 changes: 0 additions & 69 deletions
69
core/imageroot/usr/local/agent/actions/configure-backup/validate-input.json
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this special option really needed?