Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| computer:ubuntu:restic-backup-docker-hermes [2024/03/01 19:35] – [Service-Unitfile anlegen] spring | computer:ubuntu:restic-backup-docker-hermes [2024/12/15 09:13] (current) – [Restic Backup im Netzwerk] spring | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Restic Backup im Netzwerk ====== | ====== Restic Backup im Netzwerk ====== | ||
| - | Übersicht über alle Backups: '' | + | Übersicht über alle Backups: '' |
| + | |||
| + | Idee aus perplexity: | ||
| + | |||
| + | To protect access to Traefik services from the internet using basic authentication while leaving intranet access unprotected, | ||
| + | Configuration Steps | ||
| + | |||
| + | Create a BasicAuth middleware for external access: | ||
| + | |||
| + | text | ||
| + | < | ||
| + | http: | ||
| + | middlewares: | ||
| + | basic-auth: | ||
| + | basicAuth: | ||
| + | users: | ||
| + | - " | ||
| + | </ | ||
| + | Create an IPWhiteList middleware for internal access: | ||
| + | |||
| + | text | ||
| + | < | ||
| + | http: | ||
| + | middlewares: | ||
| + | internal-whitelist: | ||
| + | ipWhiteList: | ||
| + | sourceRange: | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | </ | ||
| + | Set up a middleware chain combining both: | ||
| + | |||
| + | text | ||
| + | < | ||
| + | http: | ||
| + | middlewares: | ||
| + | secure-chain: | ||
| + | chain: | ||
| + | middlewares: | ||
| + | - internal-whitelist | ||
| + | - basic-auth | ||
| + | </ | ||
| + | Apply the middleware chain to your router: | ||
| + | |||
| + | text | ||
| + | < | ||
| + | http: | ||
| + | routers: | ||
| + | my-service: | ||
| + | rule: " | ||
| + | service: " | ||
| + | middlewares: | ||
| + | - secure-chain | ||
| + | </ | ||
| + | This configuration will allow unrestricted access from the specified internal IP ranges while requiring basic authentication for external access2 | ||
| + | 4 | ||
| + | . | ||
| + | Additional Considerations | ||
| + | |||
| + | Ensure you replace the example BasicAuth credentials with your own securely hashed passwords1 | ||
| + | 5 | ||
| + | . | ||
| + | Adjust the IP ranges in the IPWhiteList middleware to match your internal network configuration4 | ||
| + | . | ||
| + | For enhanced security, consider using more robust authentication methods like Authelia or Authentik for external access6 | ||
| + | . | ||
| + | |||
| + | By implementing this setup, you can effectively protect your Traefik services from unauthorized external access while maintaining convenient internal access within your network. | ||
| + | can the name " | ||
| + | Sources | ||
| + | Answer | ||
| + | The name " | ||
| + | 2 | ||
| + | . You can choose any name you prefer for your middleware, as long as it follows Traefik' | ||
| + | 6 | ||
| + | . When defining a middleware, you typically use a structure like: | ||
| + | < | ||
| + | text | ||
| + | http: | ||
| + | middlewares: | ||
| + | your-chosen-name: | ||
| + | basicAuth: | ||
| + | # configuration details | ||
| + | </ | ||
| + | Just remember to reference the middleware using the name you've chosen when applying it to your routers or services2 | ||
| + | 5 | ||
| + | |||
| + | The general format for defining a router in Traefik labels is: | ||
| + | |||
| + | text | ||
| + | - " | ||
| + | |||
| + | Where < | ||
| + | |||
| ===== Restic Server auf hermes ===== | ===== Restic Server auf hermes ===== | ||
| Line 20: | Line 115: | ||
| After=network-online.target | After=network-online.target | ||
| Wants=network-online.service | Wants=network-online.service | ||
| + | StartLimitIntervalSec=6000 | ||
| + | StartLimitBurst=30 | ||
| [Service] | [Service] | ||
| Line 25: | Line 122: | ||
| ExecStart=/ | ExecStart=/ | ||
| EnvironmentFile=/ | EnvironmentFile=/ | ||
| + | Restart=on-failure | ||
| + | RestartSec=60 | ||
| [Install] | [Install] | ||
| Line 47: | Line 146: | ||
| ==== Timer anlegen ==== | ==== Timer anlegen ==== | ||
| - | sudo systemctl edit --force --full restic-backup.timer | + | < |
| <file bash> | <file bash> | ||
| Description=Backup with restic daily | Description=Backup with restic daily | ||
| Line 301: | Line 400: | ||
| - " | - " | ||
| - " | - " | ||
| - | - " | + | - " |
| - " | - " | ||
| - " | - " | ||
| Line 314: | Line 413: | ||
| Test auf dem netcup-Server | Test auf dem netcup-Server | ||
| - | export RESTIC_REPOSITORY=" | + | export RESTIC_REPOSITORY=" |
| restic -v snapshots | restic -v snapshots | ||
| restic -v --exclude-file=/ | restic -v --exclude-file=/ | ||