Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 1 addition & 110 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,114 +60,5 @@ jobs:
- name: Run e2e (docker + postgres recipe)
run: agent/e2e/run-docker.sh

- name: Run e2e (S3 / MinIO backend)
- name: Run e2e (S3 backend via SeaweedFS)
run: agent/e2e/run-s3.sh

control-plane-e2e:
name: Control plane e2e (supabase + agent)
runs-on: ubuntu-latest
env:
RESTIC_VERSION: 0.18.0
steps:
- uses: actions/checkout@v7

- uses: actions/setup-go@v6
with:
go-version-file: agent/go.mod
cache-dependency-path: agent/go.sum

- uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
cache-dependency-path: web/package-lock.json

- uses: supabase/setup-cli@v2
with:
# Pinned, not "latest". Resolving "latest" costs an unauthenticated
# GitHub API call that is rate limited per runner IP, and it failed
# exactly that way on a busy day. Pinning also stops a new CLI
# release from breaking CI with no commit to blame.
version: 2.117.0

- name: Install restic
run: |
curl -fsSL -o restic.bz2 \
"https://github.com/restic/restic/releases/download/v${RESTIC_VERSION}/restic_${RESTIC_VERSION}_linux_amd64.bz2"
bunzip2 restic.bz2 && chmod +x restic && sudo mv restic /usr/local/bin/restic

- name: Start local Supabase
working-directory: web
run: supabase start

- name: Build and start web
working-directory: web
run: |
npm ci
cp .env.example .env.local
npm run build
PORT=3100 \
TELEGRAM_BOT_TOKEN=e2e-token \
TELEGRAM_BOT_USERNAME=restorable_alerts_dev_bot \
TELEGRAM_WEBHOOK_SECRET=local-dev-tg-webhook \
TELEGRAM_API_BASE=http://127.0.0.1:8181 \
CRON_SECRET=local-dev-cron-secret \
BETA_MODE=1 \
STRIPE_SECRET_KEY=sk_test_dummy_signature_only \
npm run start &
for i in $(seq 1 30); do
curl -sf -o /dev/null http://localhost:3100/login && break
sleep 1
done

- name: Run control plane e2e
run: |
export SUPABASE_ANON_KEY="$(cd web && supabase status -o json | python3 -c 'import json,sys; print(json.load(sys.stdin)["ANON_KEY"])')"
web/e2e/run.sh

- name: Run alerting e2e
run: |
export SUPABASE_ANON_KEY="$(cd web && supabase status -o json | python3 -c 'import json,sys; print(json.load(sys.stdin)["ANON_KEY"])')"
export SUPABASE_SERVICE_ROLE_KEY="$(cd web && supabase status -o json | python3 -c 'import json,sys; print(json.load(sys.stdin)["SERVICE_ROLE_KEY"])')"
web/e2e/alerts.sh

- name: Run billing e2e
run: |
export SUPABASE_ANON_KEY="$(cd web && supabase status -o json | python3 -c 'import json,sys; print(json.load(sys.stdin)["ANON_KEY"])')"
web/e2e/billing.sh

- name: Run telegram-connect e2e
run: |
export SUPABASE_ANON_KEY="$(cd web && supabase status -o json | python3 -c 'import json,sys; print(json.load(sys.stdin)["ANON_KEY"])')"
export SUPABASE_SERVICE_ROLE_KEY="$(cd web && supabase status -o json | python3 -c 'import json,sys; print(json.load(sys.stdin)["SERVICE_ROLE_KEY"])')"
web/e2e/telegram-connect.sh

web:
name: Web (Next.js)
runs-on: ubuntu-latest
defaults:
run:
working-directory: web
steps:
- uses: actions/checkout@v7

- uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
cache-dependency-path: web/package-lock.json

- name: Install
run: npm ci

- name: Lint
run: npm run lint

- name: Typecheck
run: npm run typecheck

- name: Test
run: npm test

- name: Build
run: npm run build
18 changes: 0 additions & 18 deletions .github/workflows/cron-alerts.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/db-backup.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
*.test
*.out

# Node / Next.js
node_modules/
/web/.next/
/web/out/
next-env.d.ts

# Env and secrets — never commit
.env
.env.*
Expand All @@ -22,7 +16,6 @@ next-env.d.ts
.DS_Store
.idea/
.vscode/
.vercel

# Internal docs — kept local, never published
/SPEC.md
Expand Down
50 changes: 27 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ restorable: PASS

Works fully standalone — single binary, no account, cron-friendly exit codes.
Because every test is a real restore, you also get your **measured recovery
time** — how long being back online actually takes, not a guess. An optional
cloud dashboard adds scheduling history, recovery-time tracking, stale-backup
detection, and alerts (Telegram, Discord, ntfy, email).
time** — how long being back online actually takes, not a guess. Optional
notifications push failures to your phone and catch the agent itself going
quiet.

Free and open source (MIT). There's no hosted service and no account: the
hosted dashboard from v0.1 was retired in v0.2.0, and its alerting and
dead-agent detection now run from the agent itself.

## Why

Expand Down Expand Up @@ -105,23 +109,24 @@ and `sqlite` don't.
are a compile error, not a code-review promise.
- **Sandboxes are always destroyed** — on success, failure, and panic. Disk
space is checked *before* any restore begins.
- **Your data never leaves your machine.** Standalone mode talks to nobody.
Cloud mode reports only pass/fail metadata: a repository fingerprint
(SHA-256 of the credential-scrubbed location), snapshot IDs, check
results, timings. Never file contents, never passwords. The agent is
pull-based over HTTPS and listens on no ports.
- **Your data never leaves your machine.** With no `notify:` block the agent
talks to nothing but your repository. With one, it sends a redacted run
summary only to the URLs you configured. Never file contents, never
passwords, and it listens on no ports.

## Cloud dashboard (optional)
## Notifications (optional)

The hosted dashboard adds run history across repos, alerting on failure,
stale-backup detection (fires when your *testing* silently dies — the
meta-failure).
```yaml
notify:
ntfy: https://ntfy.sh/<long-random-topic> # push on failure
webhook: https://example.com/hook # JSON summary on failure
healthcheck: https://hc-ping.com/<uuid> # pinged every run
```

**It is all free during the open beta.** Every Pro feature, no card, no
trial clock. The plans below are what it will cost when the beta ends.
Free: 1 repo, monthly tests, 1 alert channel. Pro ($8/mo or $80/yr):
unlimited repos, any schedule, all channels, 12-month history. The agent
works forever without any of it.
The healthcheck ping is the one to set up first. Failure alerts can't tell
you that tests stopped running at all; a dead-man's-switch monitor like
[Healthchecks.io](https://healthchecks.io) can. See
[notifications](docs/notifications.md).

## Docs

Expand All @@ -131,9 +136,8 @@ works forever without any of it.
[files](docs/recipes-files.md) ·
[databases](docs/recipes-databases.md) ·
[docker-app](docs/recipes-docker-app.md) ·
[Alerts](docs/alerts.md) ·
[Cloud](docs/cloud.md) ·
[Plans](docs/billing.md)
[Notifications](docs/notifications.md) ·
[Security](SECURITY.md)

## Building from source

Expand All @@ -142,9 +146,9 @@ git clone https://github.com/restorable-dev/restorable && cd restorable/agent
go build -o restorable .
```

Repo layout: [`/agent`](agent/) Go agent · [`/web`](web/) control plane
(Next.js + Supabase) · [`/recipes`](recipes/) shipped recipes ·
[`/docs`](docs/) documentation.
Repo layout: [`/agent`](agent/) Go agent · [`/recipes`](recipes/) shipped
recipes · [`/docs`](docs/) documentation. The retired dashboard (`web/`) is in
git history before v0.2.0.

## License

Expand Down
40 changes: 18 additions & 22 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ and leave the details out.

| Version | Supported |
| ------- | --------- |
| 0.1.x | Yes |
| < 0.1.1 | No |
| 0.2.x | Yes |
| 0.1.x | No: upgrade (the hosted dashboard it reported to is gone) |

Anything before v0.1.1 was built with a Go toolchain carrying known stdlib
vulnerabilities, and those releases have been pulled. There's no auto-update by
Expand All @@ -42,17 +42,19 @@ guarantee.
Free space is checked before a restore starts. An oversized snapshot fails with
a clear error rather than filling your disk.

The contents of your files never leave your machine. Connected to the hosted
control plane, the agent sends pass/fail, timings, snapshot IDs, recipe and
check names, check messages, error strings, and a label for the repository.
The contents of your files never leave your machine. There is no hosted
service: the hosted dashboard was retired in v0.2.0. The only outbound
connections are to your restic backend and to the notification URLs you put in
`notify:`, if any. To those, the agent sends pass/fail, timings, a snapshot ID,
recipe and check names, check messages, error strings, and your repository
string.

Be aware of what those last three carry, because it is more than "metadata"
suggests. The repository label is your repo string with credentials stripped,
so it still contains the host and path, and it appears in the title of every
alert sent to whatever channels you connect. Check messages can name paths from
inside the snapshot: a checksum mismatch says which file differed. If either is
more than you want reaching a third-party chat service, run the agent
standalone and skip the cloud entirely.
suggests. The repository string has credentials stripped, but it still contains
the host and path. Check messages can name paths from inside the snapshot: a
checksum mismatch says which file differed. If either is more than you want
reaching ntfy or a webhook, use only the `healthcheck` ping and keep the details
in your local logs.

Strings go through scrubbing and redaction before they're logged or
transmitted, including errors from cleanup failures. Credentials embedded in
Expand All @@ -64,14 +66,12 @@ CONTEXT, MySQL inlines them in the error itself, and both are removed. Be
aware this part is pattern matching against known shapes rather than a
guarantee. It has been wrong twice, so assume a database engine can invent a
new way to quote your data that we have not covered yet. If a database failure
must never carry row values off the machine under any circumstances, run the
agent standalone and skip the cloud. That is the only version of this promise
that does not depend on us keeping up.
must never carry row values off the machine under any circumstances, don't
configure ntfy or a webhook. That is the only version of this promise that does
not depend on us keeping up.

The agent polls outbound over HTTPS and opens no inbound ports.

Cloud is optional either way. `restorable test --config agent.yaml` runs the
whole local loop without an account.
The agent opens no inbound ports, and `restorable test --config agent.yaml`
runs the whole loop without an account or any network beyond your repository.

## Known advisories

Expand All @@ -93,10 +93,6 @@ which has published nothing but betas so far. I'm not moving this onto a beta
dependency over two advisories it doesn't exercise. When moby/moby/v2 goes
stable the agent migrates and this section goes away.

Dev dependencies of the web control plane may carry their own advisories. Those
don't ship. `npm audit --omit=dev` on the production tree is the number that
matters and it should read zero.

## Out of scope

Bugs in restic itself go to [restic](https://github.com/restic/restic). Same for
Expand Down
14 changes: 14 additions & 0 deletions agent/agent.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,17 @@ sandbox:
dir: ""
# Extra free-space requirement on top of the estimated snapshot size.
min_free_space: "1GiB"

# Optional: where to hear about results. The URLs are secrets (anyone who
# has one can post to it), which is one more reason this file is owner-only.
# See docs/notifications.md.
notify:
# Send ntfy/webhook messages on "failure" (default) or "always".
when: failure
# Push to your phone via ntfy. Pick an unguessable topic, or self-host.
ntfy: ""
# POST a JSON summary of the run to any URL.
webhook: ""
# Healthchecks.io-style ping: /start, then the URL on pass or /fail on
# failure. If pings stop arriving, the monitor alerts you.
healthcheck: ""
3 changes: 3 additions & 0 deletions agent/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ recipes: [%s]
# schedule: "0 3 * * 0" # uncomment for `+"`restorable run`"+` (weekly, Sundays 3am)
sandbox:
dir: "" # OS temp dir; point at a bigger volume if needed
# notify: # optional: hear about failures (see docs/notifications.md)
# ntfy: https://ntfy.sh/<unguessable-topic>
# healthcheck: https://hc-ping.com/<uuid>
`, repo, passwordEnv, recipeName)

if err := os.WriteFile(recipePath, []byte(sug.RecipeYAML), 0o644); err != nil {
Expand Down
Loading
Loading