{"id":21296855,"url":"https://github.com/reddec/auto-restic","last_synced_at":"2025-07-11T17:31:59.244Z","repository":{"id":81702455,"uuid":"597947165","full_name":"reddec/auto-restic","owner":"reddec","description":"A tiny wrapper around restic with automatic initialization, restoring, and backup.","archived":false,"fork":false,"pushed_at":"2025-03-28T00:15:10.000Z","size":23,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-02T11:01:56.626Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reddec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-06T03:47:50.000Z","updated_at":"2025-04-11T13:15:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"b0cc339b-57e7-4265-b799-8c37bb8786fa","html_url":"https://github.com/reddec/auto-restic","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/reddec/auto-restic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fauto-restic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fauto-restic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fauto-restic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fauto-restic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reddec","download_url":"https://codeload.github.com/reddec/auto-restic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fauto-restic/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264862464,"owners_count":23674978,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T14:30:07.181Z","updated_at":"2025-07-11T17:31:58.978Z","avatar_url":"https://github.com/reddec.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# auto-restic\n\nAutomatic backup \u0026 restore. Extension of [Portable Stacks](https://reddec.net/articles/portable-stack/) ideas.\n\nA tiny wrapper around [restic](https://github.com/restic/restic) with automatic initialization, restoring, and\nbackup.\n\nOriginally it was just bunch of shell scripts. But eventually, it logic became too complicated to fit bash.\n\nFeatures\n\n- Read-Only file system. No writing to file (except `/data`)\n- Automatic **init \u0026 backup \u0026 restore**.\n    - Container will be marked healthy only if repository initialized and data restored\n- Separate cron-like tasks for pruning and backup with mutual lock\n- Logs to stderr\n- Supports readiness probe (healthcheck)\n- Supports webhook notification\n\nExample with S3:\n\n```yaml\nservices:\n  db:\n    image: postgres:14\n    environment:\n      POSTGRES_PASSWORD: postgres\n    volumes:\n      - postgres:/var/lib/postgresql/data\n    depends_on:\n      backup:\n        condition: service_healthy\n\n  backup:\n    build: ghcr.io/reddec/auto-restic:0.16.0\n    environment:\n      BACKUP_SCHEDULE: \"@daily\"\n      RESTIC_PASSWORD: \"backup-encryption-p@ssw0rd\"\n      RESTIC_REPOSITORY: \"s3:https://s3.example.com/backups/${COMPOSE_PROJECT_NAME}\"\n      AWS_ACCESS_KEY_ID: \"my-secret-key-id\"\n      AWS_SECRET_ACCESS_KEY: \"my-secret-access-key\"\n      AWS_DEFAULT_REGION: us-west-000\n    volumes:\n      - postgres:/data/postgres\n\nvolumes:\n  postgres: { }\n\n```\n\n\u003e Note! It's designed to work as part of docker and never designed to be run as standalone application (however, it's\n\u003e still possible - just change all paths in configuration).\n\n## Auto-build\n\nAutomatically builds \u0026 tests each restic releases.\n\nTests cover:\n\n- auto initialization\n- double initialization\n- backup\n- restore\n- for local and S3-like repository\n\n\n## Configuration\n\nConfiguration has reasonable defaults. Minimal required parameters:\n\n- `RESTIC_REPOSITORY` - where to store backups\n- `RESTIC_PASSWORD` - encryption password\n\nEverything else is OPTIONAL. See [Dockerfile](./Dockerfile) for details.\n\n## Shared volume\n\nIt uses `/data/.restored` marker file. Please keep user data (volumes) mounted under sub folders (usually by service\nname) - see tests.\n\n## Notification\n\nSuccessful payload\n\n```json\n{\n  \"operation\": \"backup\",\n  \"started\": \"2023-01-20T11:10:39.44006+08:00\",\n  \"finished\": \"2023-01-20T11:10:39.751879+08:00\",\n  \"failed\": false\n}\n```\n\n- operation could be: `backup` or `prune`\n\nFailed payload (same as for success, but with `failed: true` and error message)\n\n```json\n{\n  \"operation\": \"backup\",\n  \"started\": \"2023-01-20T11:10:39.44006+08:00\",\n  \"finished\": \"2023-01-20T11:10:39.751879+08:00\",\n  \"failed\": true,\n  \"error\": \"something went wrong\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freddec%2Fauto-restic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freddec%2Fauto-restic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freddec%2Fauto-restic/lists"}