- JavaScript 99.4%
- Dockerfile 0.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .w3ds | ||
| src | ||
| test | ||
| .dockerignore | ||
| .gitignore | ||
| Dockerfile | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
undo
See every version of the data in your eVault, who changed it and from which platform, and roll any record back to an earlier version.
Sign in with your eID wallet. Everything is read live from your eVault; the app stores nothing.
What you can do
- Records lists the live records in your eVault by type, plus the ones recently removed.
- Activity is your eVault's operation log, newest first. For each write it shows what changed, which platform made it, and the person that platform said it acted for.
- A record's history shows every version with its field-by-field changes, the writing platform and person, and the full data at that version.
- Restore this version rolls the record back. It works on removed records too.
How a rollback works
A rollback is just a new write. The app calls the eVault's rollbackMetaEnvelope(id, version), which writes the chosen version's data back as the next version:
- The version number keeps going up.
- Nothing in the history is rewritten, so a rollback can itself be rolled back.
- The payload is restored exactly, and fields the old version didn't have are pruned.
- The record keeps the access rules it has now.
- A removed record comes back.
Every eVault call carries X-ENAME and X-ON-BEHALF-OF set to the signed-in user. The eVault therefore applies that user's access rules and records them as the author of the rollback. Records whose _acl policy doesn't grant UPDATE can be viewed but not rolled back.
This needs an eVault with version history and rollbackMetaEnvelope (MetaState prototype #1175 and #1176).
How sign-in works
GET /shows a QR code and aw3ds://authlink for a fresh session.- The wallet signs the session id and posts
{ename, session, signature}to/api/auth, or opens/deeplink-loginon the same phone. - The signature is checked against the eName's key binding certificates, read from its eVault
/whoisand verified with the Registry's JWKS. - The eVault is resolved at the Registry on every request and read with a Registry platform token.
Run locally
npm ci
PUBLIC_URL=http://<your-lan-ip>:3000 npm start
npm test
PUBLIC_URL must be reachable from your phone, because the wallet posts back to it.
| Variable | Default |
|---|---|
PORT |
3000 |
PUBLIC_URL |
$GITW3_URL, then http://localhost:3000 |
REGISTRY_URL |
https://registry.w3ds.metastate.foundation |
ONTOLOGY_URL |
https://ontology.w3ds.metastate.foundation (for type names) |
PLATFORM_NAME |
undo (must match .w3ds/platform.json) |
DISPLAY_NAME |
Undo App |
SESSION_SECRET |
random per boot (restarting signs everyone out) |
Deploy on GitW3
Managed hosting builds the Dockerfile and sets PORT and GITW3_URL. To go live:
- Set the public URL in the repository's W3DS tab.
- Publish a
vX.Y.Zrelease. - Get the release certified by the PPA.
- Press Deploy on the Deploy tab.
Built to test auto-deployment on new commits to main.