-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Save custom certificates and custom routes in the backup for restoration. - Save also acme.json and traefik.yaml for reference: when restored, they will be removed on the next backup run.
- Loading branch information
1 parent
4f6932c
commit 99f0c84
Showing
4 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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,28 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# Copyright (C) 2025 Nethesis S.r.l. | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
|
||
set -e | ||
|
||
shopt -s nullglob | ||
|
||
# Restore HTTP routes created from the UI: | ||
for froute in state-backup/manual_flags/* ; do | ||
route=$(basename "${froute}") | ||
if [[ -f "state-backup/configs/${route}.yml" ]]; then | ||
cp -vfT "state-backup/configs/${route}.yml" "configs/${route}.yml" | ||
touch "manual_flags/${route}" | ||
fi | ||
done | ||
|
||
# Restore uploaded certificates (dynamic config): | ||
find state-backup/configs -type f -name 'cert_*.yml' -0 | \ | ||
xargs -0 -r -- cp -pvt configs/ | ||
|
||
# Restore uploaded certificates (certificates and private keys): | ||
find state-backup/custom_certificates -type f -0 | \ | ||
xargs -0 -r -- cp -pvt custom_certificates/ | ||
|
This file contains 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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#!/usr/bin/env sh | ||
#!/bin/bash | ||
|
||
# | ||
# Copyright (C) 2023 Nethesis S.r.l. | ||
# Copyright (C) 2025 Nethesis S.r.l. | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
|
||
rm -fv backup-custom-routes.json | ||
rm -rf state.backup |
This file contains 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,17 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# Copyright (C) 2025 Nethesis S.r.l. | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
|
||
set -e | ||
|
||
rm -rf state-backup | ||
mkdir -vp state-backup | ||
|
||
cp -pvT traefik.yaml state-backup/ | ||
cp -prvT configs state-backup/configs/ | ||
cp -prvT manual_flags state-backup/manual_flags/ | ||
cp -prvT custom_certificates state-backup/custom_certificates/ | ||
cp -prvT acme/ state-backup/acme/ |
This file contains 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,6 @@ | ||
# | ||
# Restic include patterns for Traefik state | ||
# Syntax reference: https://pkg.go.dev/path/filepath#Glob | ||
# Restic --files-from: https://restic.readthedocs.io/en/stable/040_backup.html#including-files | ||
# | ||
state/state-backup |