ident
All repositories: gitoria
1.3 KB
// tools/dump-store.hl — every row of every ident table as ONE JSON object on stdout// ({ accounts: [...], identities: [...], ... }). hl:mpackdb rewrites a table's files when// it opens them (hybriel #40): ONLY EVER RUN IT ON A COPY —// cp -a storage/mpackdb /tmp/x && IDENT_STORAGE=/tmp/x bin/hybriel tools/dump-store.hl// The output holds apps' secret HASHES and API keys: keep it in .scratch, don't paste it.import { env } from 'hl:proc'import { dir, accountsTable, identitiesTable, otpTable, sendsTable, ipSendsTable, countOf } from '../store.hl'import { appsTable, connectionsTable, requestsTable, grantsTable } from '../apps.hl'import { kindsTable, settingsTable, notificationsTable } from '../notify.hl'if (env('IDENT_STORAGE') == null || !env('IDENT_STORAGE').startsWith('/')) { hlError('set IDENT_STORAGE to an ABSOLUTE copy of storage/mpackdb') }static rows = (t) => {let out = []let f = t.find(null, null)if (countOf(f) > 0) { for (r of f) { out.push(r) } }return out}console.log(JSON.stringify({ accounts = rows(accountsTable) identities = rows(identitiesTable) otp = rows(otpTable) sends = rows(sendsTable) ipsends = rows(ipSendsTable) apps = rows(appsTable) connections = rows(connectionsTable) requests = rows(requestsTable) grants = rows(grantsTable) kinds = rows(kindsTable) settings = rows(settingsTable) notifications = rows(notificationsTable) }))
Branches
- mainmain branch
Latest commits
- 81b15b7bState of 2026-09-27, before the move to gitoriamre