feat: add managed database capture and operator restore
PostgreSQL and MySQL backups run through paired outposts, with operator sign-in, off-site copies, and legacy import. Retention stays on each orbit, so the unused retention console is removed. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
150
docs/DATABASE-CAPTURE.md
Normal file
150
docs/DATABASE-CAPTURE.md
Normal file
@@ -0,0 +1,150 @@
|
||||
# Managed database backups
|
||||
|
||||
A capture profile maps one application and Wormhole orbit to a paired outpost. The hub stores the assignment, format, schedule, and retention policy. The agent reads connection settings and password references from its local profile file. Each application has one active capture lease. An agent can serve several applications in parallel.
|
||||
|
||||
## Pair an agent
|
||||
|
||||
Build the hub, CLI and agent with `cargo build --workspace`. Put Restic on the hub and the database client for the source server version on the agent. SSH profiles also use OpenSSH on the agent. MySQL remote capture runs the server-compatible `mysqldump` on the SSH host.
|
||||
|
||||
Generate a pairing code in **Outposts** or call `POST /api/v1/wormhole/pairing` with operator credentials. On the agent, create the credential file once.
|
||||
|
||||
```sh
|
||||
tessera-agent --hub-url https://backup.example.org --credentials /etc/tessera/wormhole.json pair CODE --name database-outpost
|
||||
tessera-agent --credentials /etc/tessera/wormhole.json --capture-profiles /etc/tessera/capture.json run
|
||||
```
|
||||
|
||||
The credentials file is owner-only and contains the hub URL, outpost UUID and upload token. Keep it outside the repository. TLS uses the system trust store. Set `TESSERA_WORMHOLE_CA` for a private CA and configure both `TESSERA_WORMHOLE_CLIENT_CERT` and `TESSERA_WORMHOLE_CLIENT_KEY` for a hub that requires mTLS. Plain HTTP capture is available on loopback for local testing.
|
||||
|
||||
## Register an application
|
||||
|
||||
In **Orbits**, choose **Database** or **Filesystem / Folder**, then **Via Outpost**. Save the orbit and register its Outpost backup profile. Pick the paired Outpost, application UUID, and optional daily UTC schedule. Database profiles also need an engine.
|
||||
|
||||
For **Via Hub**, give the hub a readable folder path or a reachable PostgreSQL/MySQL endpoint and an absolute password-file path. Mount these files into the container when applicable. TLS verifies the server identity by default. Provide a CA file for a private CA. The hub needs a matching database client on its PATH. The bundled hub image includes `pg_dump` and `mysqldump`. Use a compatible client for the source server version.
|
||||
|
||||
For CLI setup, create an orbit using `tessera orbit billing --provider wormhole` and save its returned UUID. Use the UUID of the paired outpost shown in **Outposts**. Choose a stable application UUID and submit the following object to `POST /api/v1/capture-profiles` using the hub's admin API token or authenticated operator session.
|
||||
|
||||
```json
|
||||
{
|
||||
"application_id": "e1656c14-0d87-4572-a548-b66cc283e61f",
|
||||
"orbit_id": "393e5c00-65b8-4084-a521-099732948a6c",
|
||||
"outpost_id": "c7072265-89ab-493a-8dbe-948c1e9aa24c",
|
||||
"format": "postgres_custom",
|
||||
"schedule": { "hour": 2, "timezone": "Asia/Jakarta" }
|
||||
}
|
||||
```
|
||||
|
||||
A schedule is optional. Scheduled jobs catch up from the time the profile was registered and stay queued while the outpost is offline. Retention defaults to 14 days and keeps the newest archive. Use `"retention": {"mode": "count"}` for five archives or set its `keep` value explicitly. An orbit's custom GFS policy applies when the profile has no explicit retention override. The offline CLI decay command only processes legacy snapshots.
|
||||
|
||||
Set the same application UUID in the agent's local JSON file. Each entry has a `source` and an optional `timeout_seconds` (default 3600). The password file contains one line and should be readable only by the service account.
|
||||
|
||||
```json
|
||||
{
|
||||
"e1656c14-0d87-4572-a548-b66cc283e61f": {
|
||||
"source": {
|
||||
"engine": "postgres",
|
||||
"host": "billing.internal",
|
||||
"database": "billing",
|
||||
"user": "backup",
|
||||
"password_file": "/etc/tessera/billing.password",
|
||||
"tls": { "mode": "verify_full_with_ca", "ca_file": "/etc/tessera/database-ca.pem" }
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| Case | Format | Agent source |
|
||||
| --- | --- | --- |
|
||||
| Direct PostgreSQL | `postgres_custom` or `postgres_sql` | Example above. Port defaults to 5432. TLS defaults to `verify_full`. |
|
||||
| PostgreSQL through SSH | `postgres_custom` or `postgres_sql` | Add a `bastion` object. Keep the PostgreSQL hostname that the server certificate covers. |
|
||||
| Direct MySQL | `mysql_sql` | Use `"engine": "mysql", "transport": "direct"`, host, database, user, password file and MySQL TLS policy. Port defaults to 3306. TLS modes include `verify_identity_with_ca` with a CA file and `required`. |
|
||||
| MySQL through SSH | `mysql_sql` | Use `"engine": "mysql", "transport": "ssh"`, `bastion`, `database` and `defaults_file`. The latter is an absolute path to a private MySQL client options file on the SSH host. |
|
||||
|
||||
The `bastion` object has `host`, `user`, `identity_file`, `known_hosts_file` and an optional `port` (default 22). Use an absolute path for each file. Record the authorized SSH server host key in the pinned known-hosts file. The SSH login needs forwarding permission for PostgreSQL or permission to run the MySQL client and read its options file for remote MySQL.
|
||||
|
||||
## Run and inspect a backup
|
||||
|
||||
Open **Orbits → Outpost backup jobs**, select an application, and queue a backup. In the API, use `POST /api/v1/capture-profiles/{application-id}/jobs`. Poll `GET /api/v1/capture-jobs/{job-id}` for status and its `/events` endpoint for phase history. The list endpoint supports `application_id`, `status`, and `limit` filters. Successful captures expose their engine, format, and job ID in the snapshot catalog.
|
||||
|
||||
New Outpost orbits require the current agent and an incremental Restic repository. Follow the Rest Server and repository setup in [the README](../README.md#incremental-wormhole-transfers-for-filesystem-archives) for each orbit. Use the same repository password in the hub's orbit key and the agent's password file. Add these fields to the application's agent profile:
|
||||
|
||||
```json
|
||||
{
|
||||
"restic_repository": "rest:https://backup.example.org/<orbit-id>/",
|
||||
"restic_password_file": "/etc/tessera/keys/repository-password",
|
||||
"rest_server_password_file": "/etc/tessera/keys/rest-server-password"
|
||||
}
|
||||
```
|
||||
|
||||
The Rest Server login is the orbit ID when `rest_server_password_file` is set. For a private Rest Server CA, configure `RESTIC_CACERT` on the agent. A filesystem profile uses `"paths": ["/path/to/folder"]` in place of `source` and `"format": "filesystem"` on the hub.
|
||||
|
||||
The agent sends new Restic chunks and snapshot metadata. The hub registers the snapshot after checking the lease and repository. One capture job produces one catalog ID across retries. A logical database backup needs room on the executor for one private temporary dump per concurrent capture. A database can run with its normal logging settings. The dump is read in full at the source, and Restic performs deduplication before transfer to the repository.
|
||||
|
||||
Existing database orbits keep the legacy full-upload path until their Restic repository is configured. That path validates length and SHA-256 at ingest, stages on both sides, and has a 100 GiB upload limit.
|
||||
|
||||
Use the snapshot detail to download or remove an archive. Database snapshots can also be exported to a file on the hub. Use **Database recovery options** to apply a verified database archive to a registered target.
|
||||
|
||||
## Operator sign-in
|
||||
|
||||
Generate an Argon2id hash and set `TESSERA_OPERATOR_PASSWORD_HASH` to the result. The hub reads the password from stdin in hash mode. For example, from an interactive Bash shell:
|
||||
|
||||
```bash
|
||||
read -rs -p 'Operator password: ' tessera_operator_password; printf '\n'
|
||||
export TESSERA_OPERATOR_PASSWORD_HASH="$(printf '%s\n' "$tessera_operator_password" | tessera-hub --hash-operator-password)"
|
||||
unset tessera_operator_password
|
||||
```
|
||||
|
||||
Set `TESSERA_OPERATOR_NAME` for the audited identity, or use the default `operator`. Serve the browser over HTTPS outside loopback. Sessions expire after eight hours or a hub restart. Browser mutations require the session's CSRF token. API and CLI callers use the separate `TESSERA_ADMIN_TOKEN`. Use the bundled HTTP CLI on the hub's loopback listener when sending the token.
|
||||
|
||||
## Optional S3 copy
|
||||
|
||||
Configure `TESSERA_OFFSITE_REPOSITORY=s3:https://s3.example.org/tessera-backups/managed` with a dedicated prefix and point `TESSERA_OFFSITE_PASSWORD_FILE` to the independent Restic password. Supply AWS credentials via the hub service environment or the provider's credential chain. In Docker, mount the password file at the container path using a read-only mount.
|
||||
|
||||
The hub retries failed copies and reports their state on the capture job. Local retention and deletion protect pending copies. Off-site archives remain available independently after local catalog removal. To recover without the hub or its primary repository, use the off-site Restic password and S3 credentials with these commands:
|
||||
|
||||
```sh
|
||||
restic -r "$TESSERA_OFFSITE_REPOSITORY" --password-file "$TESSERA_OFFSITE_PASSWORD_FILE" snapshots --tag "tessera-<snapshot-uuid>"
|
||||
restic -r "$TESSERA_OFFSITE_REPOSITORY" --password-file "$TESSERA_OFFSITE_PASSWORD_FILE" dump <restic-id-from-first-command> /payload > recovered.dump
|
||||
```
|
||||
|
||||
## Register a restore target
|
||||
|
||||
Configure target credentials on the assigned agent. A target can use a different outpost from its source. PostgreSQL identifies a logical database by cluster system identifier and database name. MySQL uses the server UUID and database name. PostgreSQL source and target roles need read access to `pg_catalog.pg_control_system()` to verify identity. A capture with an unavailable source identity remains available for export.
|
||||
|
||||
From a restorable snapshot, open **Database recovery options** and select **Register restore target**. For API setup, call `POST /api/v1/restore-targets` with `id`, `application_id`, `outpost_id`, `name`, `engine` and `identity`. The identity has `instance` and `database`. Query the values on the target.
|
||||
|
||||
- PostgreSQL uses `SELECT system_identifier, current_database() FROM pg_catalog.pg_control_system()`.
|
||||
- MySQL uses `SELECT LOWER(@@server_uuid), DATABASE()`.
|
||||
|
||||
On the target agent, add a `targets` map under the application UUID, keyed by the registered target UUID. A target-only outpost can omit the application's `source`. An example PostgreSQL entry follows.
|
||||
|
||||
```json
|
||||
{
|
||||
"engine": "postgres",
|
||||
"connection": {
|
||||
"host": "staging-db.internal",
|
||||
"database": "billing_staging",
|
||||
"user": "restore",
|
||||
"password_file": "/etc/tessera/staging.password",
|
||||
"tls": { "mode": "verify_full_with_ca", "ca_file": "/etc/tessera/database-ca.pem" }
|
||||
},
|
||||
"mode": { "reset": "schema", "schema": "public" }
|
||||
}
|
||||
```
|
||||
|
||||
Use `{"reset":"recreate_database"}` to recreate the registered PostgreSQL database. It requires access to the `postgres` maintenance database and permission to drop and create the target database. Schema mode resets the named schema and applies the dump in a transaction. Supply a local `post_restore_sql` file for target-specific SQL. PostgreSQL can read custom archives and plain or gzip-compressed SQL. The agent requires a psql client with restricted mode for restore. `omit_transaction_timeout` and `omit_pg_stat_statements` enable specific compatibility rules.
|
||||
|
||||
A MySQL target uses `"engine":"mysql"` and the same `connection` fields as a direct or SSH MySQL source. `recreate_database` drops and recreates the registered database before applying SQL. `use_target_definer` rewrites supported dump DEFINER clauses to the connected MySQL user.
|
||||
|
||||
Choose the snapshot and target in **Restore**. The required confirmation includes both UUIDs. The hub verifies the safety archive before issuing the single-use apply permit. If the job reports `recovery_required`, stop any old apply process and verify its database session has ended. Recover the target with the linked safety archive, verify data and permissions, then confirm reconciliation to release the lock. Session-authenticated file exports use a filename in the hub's private `exports` directory.
|
||||
|
||||
## Import legacy archives
|
||||
|
||||
Run the CLI against the staging vault. Use an AWS CLI profile with `s3:ListBucket` scoped to the legacy prefix and `s3:GetObject` on the objects in that prefix.
|
||||
|
||||
```sh
|
||||
tessera legacy-import --bucket legacy-bucket --prefix billing/ --orbit-id ORBIT_UUID --application billing --engine postgres --inventory-only
|
||||
```
|
||||
|
||||
Repeat without `--inventory-only` to import. The JSON report includes the source key, ETag, size, last-modified timestamp, and Tessera snapshot ID. Conditional reads reject changed objects between listing and download. A persistent receipt prevents reimport after local retention and GC. [AWS S3 CLI inventory](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-objects-v2.html), [AWS S3 conditional download](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html).
|
||||
|
||||
Add `--history /path/to/consistent-history.sqlite` to archive a consistent SQLite export of the old job history. Save the reported history ID and retrieve it with `tessera legacy-history HISTORY_UUID history.sqlite` on the vault host. Inspect the retrieved copy read-only. Legacy SQL archives retain their original bytes and can be applied to a temporary database with the matching engine client.
|
||||
50
docs/MBU-BACKUP-PARITY.md
Normal file
50
docs/MBU-BACKUP-PARITY.md
Normal file
@@ -0,0 +1,50 @@
|
||||
# Paritas Backup & Restore Center MBU
|
||||
|
||||
Inventaris 10 November 2026. Targetnya adalah Tessera dapat mengambil alih backup dan restore database di backup.mbugroup.id, termasuk pemulihan dari arsip lama. Uji awal memakai topologi yang ditemukan di deployment dan data sintetis di lingkungan terisolasi.
|
||||
|
||||
## Deployment yang diperiksa
|
||||
|
||||
- Teleport `mbu-backup-jumphost` memiliki IP publik yang cocok dengan DNS situs. Nginx meneruskan trafik ke port lokal 8088. Docker Compose menjalankan container `backup-restore-center` dari `/opt/apps-backup`, dengan source dan data dipasang dari host.
|
||||
- Situs mengarahkan pengguna ke login. Source yang terpasang menunjukkan sesi browser, dashboard per aplikasi, riwayat dengan filter aplikasi dan status, pembaruan otomatis selama job aktif, log job, serta audit login dan tindakan.
|
||||
- Cron host mengantrekan backup semua aplikasi pada 19.00 UTC atau 02.00 WIB hari berikutnya. Worker menjalankan antrean FIFO per aplikasi dan memulihkan status job yang tertinggal saat restart. Batas satu perintah adalah 1.800 detik.
|
||||
- Inventaris S3 berisi 228 objek `.sql.gz` dengan total 7.486.456.004 byte. Dump terbesar sekitar 66 MB. Konfigurasi aktif menghapus dump yang lebih tua dari 14 hari dan mempertahankan minimal satu per aplikasi. Lima backup adalah fallback berbasis jumlah. Dashboard mendukung unduh lewat URL bertanda tangan dan hapus per backup. File staging lokal dibersihkan setelah job.
|
||||
- Snapshot read-only SQLite berisi 968 baris job, termasuk backup dan restore gagal. Tiga timer retensi systemd pada host menunjuk ke direktori set terpisah di bawah `/var/lib`. Inventaris 228 objek mencakup katalog aplikasi web.
|
||||
|
||||
## Kasus penerimaan dari deployment
|
||||
|
||||
| Kasus | Aplikasi | Yang harus dibuktikan |
|
||||
| --- | --- | --- |
|
||||
| PostgreSQL langsung | `lti`, `presensi`, `sso`, `helpdesk`, `manbu` | Capture dengan TLS, restore ke target terdaftar, verifikasi skema dan isi. Sertakan target bernama `manbu_development`. |
|
||||
| PostgreSQL dengan penyesuaian restore | `daily_checklist` | Reset schema, jalankan SQL pascarestore, serta bedakan error kompatibilitas yang ditoleransi dari kegagalan yang harus terlihat. |
|
||||
| PostgreSQL lewat bastion | `odoo_mas`, `odoo_fta` | Gunakan host key yang dipin. Uji reset berupa pembuatan ulang database pada target sementara untuk MAS. FTA harus bisa capture dengan target restore kosong. |
|
||||
| MySQL lewat SSH | `boiler` | Gunakan fixture MySQL dengan routine, event, view, dan DEFINER. Verifikasi dump konsisten, kompatibilitas restore, dan rollback dengan backup pengaman pada target seperti staging. |
|
||||
| Backup tanpa target | `dashboard_management`, `odoo_fta` | Backup manual dan terjadwal tetap tersedia. Permintaan restore ke database ditolak sampai ada target terdaftar. |
|
||||
| Arsip lama | Kesepuluh aplikasi | Rekonsiliasi per aplikasi, waktu, ukuran, format, dan identitas objek. Uji migrasi ulang tanpa duplikasi serta restore sampel dari PostgreSQL dan MySQL. |
|
||||
|
||||
Untuk restore database, operator memilih snapshot dan target, lalu mengetik konfirmasi. Backup pengaman target harus selesai dan tersimpan sebelum perubahan pertama. Uji target salah, sumber produksi sebagai target, kegagalan backup pengaman, kegagalan di tengah restore, dan pemulihan dari backup pengaman. PostgreSQL lama menggunakan SQL polos terkompresi tanpa owner dan ACL. Restore lama memiliki penanganan kompatibilitas untuk `transaction_timeout` dan `pg_stat_statements`.
|
||||
|
||||
## Peta kapabilitas untuk ditinjau
|
||||
|
||||
| Modul | Tanggung jawab dan selisih Tessera | Bergantung pada |
|
||||
| --- | --- | --- |
|
||||
| `operator-access` | Sesi browser dan audit operator. Tessera punya token admin untuk API. Canvas belum dapat beroperasi dengan token itu. Uji juga membuktikan respons daftar orbit mengandung kredensial provider. | — |
|
||||
| `database-capture` | Profil aplikasi dengan secret reference, PostgreSQL langsung atau melalui bastion, dan MySQL lewat SSH. Tessera sudah dapat dump PostgreSQL langsung, tetapi parser membuang parameter query URL seperti `sslmode`. | — |
|
||||
| `backup-catalog` | Penyimpanan off-host S3, metadata, daftar, unduh, hapus, dan retensi 14 hari atau fallback jumlah. Tessera sudah memakai Restic lokal serta retensi GFS. | — |
|
||||
| `database-recovery` | Target yang diizinkan, konfirmasi, backup pengaman, restore database, dan SQL pascarestore. Reconstitute saat ini mengekspor payload ke path di hub. | `database-capture`, `backup-catalog` |
|
||||
| `job-operations` | Jadwal WIB, antrean persisten per aplikasi, batas waktu, status dan log per fase, serta pemulihan setelah restart. Tessera sudah memiliki orbit manual dan cron UTC. Jadwal sekarang menunggu capture satu per satu dalam satu tick dan mengecek waktu eksekusi berikutnya tanpa catatan eksekusi per slot. | `operator-access`, `database-capture`, `backup-catalog`, `database-recovery` |
|
||||
| `legacy-transition` | Impor atau akses arsip lama, rekonsiliasi riwayat operasional, uji paralel dan peralihan. | `backup-catalog`, `database-recovery`, `job-operations` |
|
||||
|
||||
Urutan usulan dimulai dengan akses operator dan kontrak rahasia, lalu capture dan katalog, restore database, operasi job, dan transisi. Fitur Tessera yang melampaui layanan lama dan masuk uji regresi mencakup enkripsi dan deduplikasi Restic, retensi GFS, serta capture filesystem dan outpost Wormhole.
|
||||
|
||||
## Bukti uji awal
|
||||
|
||||
- PostgreSQL 14 sementara dengan data sintetis berhasil melewati pembuatan orbit, capture manual, penyegelan Restic, ekspor lewat Reconstitute, dan `pg_restore` manual ke database kedua. Isi baris diverifikasi di target. Ini menguji jalur ekspor yang ada.
|
||||
- API tanpa autentikasi pada hub bertoken mengembalikan 401. Daftar orbit dengan token mengembalikan URL koneksi yang mengandung password sintetis.
|
||||
- Rust workspace lulus 22 tes dan tes Restic yang biasanya diabaikan juga lulus ketika dijalankan terpisah. Sepuluh tes web, typecheck, dan build lulus.
|
||||
- Pemeriksaan produksi membaca source, metadata agregat job, dan inventaris objek. Validasi koneksi dan restore terhadap data produksi, uji paralel, serta peralihan belum dijalankan.
|
||||
|
||||
## Implementasi dan bukti fixture
|
||||
|
||||
Lihat [panduan capture database](DATABASE-CAPTURE.md) dan [matriks fixture](../tests/mbu/README.md). Jalur lokal mencakup PostgreSQL langsung dan lewat bastion, MySQL langsung dan lewat SSH, antrean per aplikasi, jadwal zona waktu, histori fase, katalog Restic, dan salinan S3. Fixture juga mencakup restore PostgreSQL/MySQL ke target terdaftar, verifikasi safety backup, rekonsiliasi gangguan, serta impor arsip SQL dan histori SQLite. [Runbook peralihan](MBU-CUTOVER.md) memisahkan bukti fixture dari penerimaan staging MBU.
|
||||
|
||||
Inventaris Teleport bisa dibaca lewat Machine ID. Verifikasi placement dan versi pada host produksi menunggu akun OS yang diizinkan pada node terkait. Angka inventaris arsip lama di atas tetap merupakan hasil pemeriksaan awal.
|
||||
56
docs/MBU-CUTOVER.md
Normal file
56
docs/MBU-CUTOVER.md
Normal file
@@ -0,0 +1,56 @@
|
||||
# Runbook peralihan Tessera MBU
|
||||
|
||||
Status per 10 November 2026. Rehearsal lokal memakai data sintetis dan endpoint loopback. Akses staging MBU, sampel arsip lama, dan window produksi memerlukan persetujuan operator.
|
||||
|
||||
## Siapkan staging
|
||||
|
||||
1. Konfirmasi node dan akun OS yang disetujui untuk MAS, FTA, dan Boiler. Catat versi server dan client, jalur direct atau SSH, host key, dan hak backup/restore. Letakkan secret di agent atau host SSH yang menjalankan client.
|
||||
2. Sediakan data dir Tessera, operator HTTPS, kredensial API terpisah, dan prefix Restic S3 staging. Gunakan akses baca pada bucket arsip lama. Catat pemilik tiga timer retensi host dan integrasi di luar dashboard lama.
|
||||
3. Daftarkan sepuluh aplikasi dengan UUID stabil, jadwal 02.00 WIB, dan target uji yang disetujui. Pakai [peta paritas](MBU-BACKUP-PARITY.md). FTA dan Dashboard Management cukup menjalankan capture.
|
||||
4. Jalankan [fixture lokal](../tests/mbu/README.md), lalu ulangi manual dan jadwal per aplikasi pada staging. Catat ID job, waktu slot, usia snapshot terbaru, durasi, ukuran, hasil checksum dan pemulihan, ID safety backup, serta status salinan S3.
|
||||
|
||||
## Rekonsiliasi arsip
|
||||
|
||||
1. Jalankan `tessera legacy-import --inventory-only` per prefix. Bandingkan key, ETag, waktu sumber, ukuran, dan total dengan inventaris lama. Simpan laporan JSON bersama bukti staging.
|
||||
2. Impor ke vault staging dan ulangi untuk memeriksa idempotensi. Pulihkan sampel PostgreSQL dan MySQL yang disetujui ke target sementara. Impor salinan SQLite lama yang konsisten dan simpan ID arsip histori untuk `tessera legacy-history`.
|
||||
3. Bandingkan delta objek setelah uji paralel. Ulangi inventaris dan impor sebelum peralihan. Simpan jumlah, byte, dan daftar selisih per aplikasi.
|
||||
|
||||
## Simulasikan rollback
|
||||
|
||||
1. Jalankan restore ke target sementara. Putuskan agent setelah reset pada kasus recreate. Restart hub, tunggu lease berakhir, dan pastikan status `recovery_required` menahan target dan kedua snapshot.
|
||||
2. Hentikan proses apply sebelumnya dan verifikasi sesi database sudah berhenti. Unduh safety backup dari job. Pulihkan ke target sementara yang sama dengan client engine, verifikasi schema, isi, dan izin, lalu masukkan konfirmasi `RECONCILE <job-id>`. Catat hasil verifikasi dan audit.
|
||||
3. Simulasikan repo primer tidak tersedia. Pulihkan arsip dari prefix S3 memakai UUID snapshot. Bandingkan checksum dan isi database dengan baseline. Catat apakah salinan dan password recovery tersedia dari host lain.
|
||||
4. Uji peralihan trafik di staging. Kembalikan routing ke layanan lama dan pastikan operator dapat menjalankan backup serta membuka histori. Cocokkan jadwal dan integrasi eksternal setelah rollback.
|
||||
|
||||
## Keputusan operator
|
||||
|
||||
Penuhi bukti per aplikasi sebelum operator menyetujui perubahan domain. Catat window, pemilik keputusan, target yang diuji, periode paralel, batas freshness dan durasi, serta perubahan Nginx atau DNS yang dibutuhkan. Tahan peralihan bila ada arsip yang belum terekonsiliasi, salinan S3 tidak dapat dipulihkan, jadwal terlewat, restore menghasilkan isi berbeda, atau target masih terkunci.
|
||||
|
||||
Pada window yang disetujui, ambil inventaris delta terakhir, verifikasi backup terbaru tiap aplikasi, lalu alihkan trafik. Cek sign-in, histori, backup manual, dan download. Pantau siklus 02.00 WIB. Pertahankan layanan dan artefak lama selama periode rollback yang disepakati.
|
||||
|
||||
Jika kriteria rollback tercapai, kembalikan routing, aktifkan jadwal lama sesuai keputusan operator, dan catat job atau objek Tessera sejak peralihan untuk rekonsiliasi. Tunda restore pada target yang statusnya belum diketahui sampai safety backup dan hasil verifikasi tersedia.
|
||||
|
||||
## Hasil rehearsal lokal
|
||||
|
||||
Ketiga outpost memproses 10 backup manual dan 10 backup dari scheduler. Semua 20 snapshot tersalin ke S3 fixture. Delapan target dipulihkan dan diperiksa isinya. Dua aplikasi capture-only tetap dapat backup. Download arsip LTI berhasil setelah repo primer dipindahkan sementara.
|
||||
|
||||
| Aplikasi | Manual (detik) | Terjadwal (detik) | Freshness (detik) | Ukuran (byte) | Restore |
|
||||
| --- | ---: | ---: | ---: | ---: | --- |
|
||||
| lti | 3 | 5 | 39 | 1391 | Lulus |
|
||||
| presensi | 3 | 5 | 39 | 1416 | Lulus |
|
||||
| sso | 4 | 5 | 39 | 1391 | Lulus |
|
||||
| helpdesk | 3 | 5 | 39 | 1416 | Lulus |
|
||||
| manbu | 4 | 6 | 38 | 1401 | Lulus |
|
||||
| daily_checklist | 2 | 10 | 34 | 1071 | Lulus |
|
||||
| odoo_mas | 3 | 6 | 38 | 1416 | Lulus |
|
||||
| odoo_fta | 2 | 6 | 38 | 1416 | Capture-only |
|
||||
| dashboard_management | 2 | 5 | 39 | 1476 | Capture-only |
|
||||
| boiler | 3 | 6 | 38 | 3132 | Lulus |
|
||||
|
||||
Freshness diukur setelah semua salinan selesai. Fixture PostgreSQL terpisah menguji putus agent setelah reset, restart hub, penolakan permit lama, pemulihan safety dump, dan audit rekonsiliasi.
|
||||
|
||||
## Bukti yang menunggu staging MBU
|
||||
|
||||
- Akun OS yang disetujui, versi client/server, dan jalur sebenarnya pada MAS, FTA, dan Boiler.
|
||||
- Rekonsiliasi arsip asli serta restore sampel yang telah disetujui.
|
||||
- Metrik uji paralel, kepemilikan integrasi eksternal, drill routing, dan persetujuan operator untuk window produksi.
|
||||
20
docs/UI.md
20
docs/UI.md
@@ -4,14 +4,15 @@ The persistent viewport maps backup jobs and recovery points. The black hole rep
|
||||
|
||||
## Viewport and consoles
|
||||
|
||||
- **Flowing** animates the projected orbits and the black hole's accretion disk. Pause or resume from the map toolbar. The map eases to a stop before showing labels and moons in **Locked** mode. Selecting an orbit also locks the map. Reduced motion locks it immediately.
|
||||
- **Flowing** animates the projected orbits and the black hole's accretion disk. Pause or resume from the map toolbar. The map coasts to a visual stop, then reveals labels and moons in **Locked** mode, starting with the selected orbit. Resuming reverses that reveal. Selecting an orbit also locks the map. Reduced motion locks it immediately.
|
||||
- Select a star or use the orbit register. The register prioritizes failed and active jobs and supports the up/down arrow keys. The inspector includes the capture action and full snapshot history.
|
||||
- The first three recovery points of the selected orbit appear as moons when the map has room. Select a moon or history entry to review the snapshot and start a restore. Escape closes the console. Restore countdown and polling continue if the console closes.
|
||||
- Hub connectivity is separate from backup health. Capture targets the named orbit. An incoming meteor represents a confirmed new snapshot. Failures and rehearsals show text feedback.
|
||||
- Hub connectivity is separate from backup health. Capture targets the named orbit. An incoming meteor represents a confirmed new snapshot. The source flares, the meteor spirals inward, and the core brightens and spins up before the new recovery point flashes. A failed capture pulses its source marker and shows text feedback. Rehearsals show text feedback.
|
||||
- The map shows up to 55 overview orbits and reserves one slot for inspecting an orbit beyond that limit. The register provides access to every orbit. On narrow screens the map, register, and inspector stack vertically.
|
||||
- **Big Screen** expands the map and keeps summary counts, motion controls, and a floating navigation dock. The browser can show it in native fullscreen. Use **Exit big screen** or Escape to return to the workspace.
|
||||
- **Big Screen** expands the map and keeps summary counts, motion controls, and a floating navigation dock. The map and dock spring into position within the current browser viewport. Use **Exit big screen** or Escape to return to the workspace.
|
||||
- Drag the active navbar item sideways and release to open the destination. The regular navbar uses text and a sliding underline. The Big Screen dock uses labeled icons and a liquid highlight.
|
||||
- The navbar stays available above the side panel so you can switch directly between consoles. In the regular workspace it becomes a floating text dock in the same top position. Big Screen keeps its icon dock at the bottom.
|
||||
- Use **Search**, **⌘K**, or **Ctrl+K** from the vault, a console, or Big Screen. An empty field shows navigation shortcuts. Type to find destinations, orbits by name, ID, or provider, and snapshots by orbit name, ID, or displayed capture date. Search uses the summaries already loaded by the vault. Use the arrow keys and Enter, or select a result with a pointer. Escape closes search and returns focus to its button.
|
||||
|
||||
## Data and rendering
|
||||
|
||||
@@ -22,10 +23,12 @@ The persistent viewport maps backup jobs and recovery points. The black hole rep
|
||||
|
||||
## Animation guideline
|
||||
|
||||
- Use the installed Framer Motion API from `motion/react`. Declarative `motion` components inherit the physics spring from `MotionConfig` in `web/src/main.tsx`. Imperative animations share `uiSpring` from `web/src/lib/motion.ts`. Tune stiffness, damping, and mass for the interaction.
|
||||
- Use the installed Framer Motion API from `motion/react`. Declarative `motion` components inherit the physics spring from `MotionConfig` in `web/src/main.tsx`. Use `uiSpring` for direct controls, `gentleSpring` for reveal and layout travel, and `ambientSpring` for scene effects. The tokens in `web/src/lib/motion.ts` define stiffness, damping, mass, and rest thresholds.
|
||||
- Keep the element, its React key, and its MotionValues stable while a target can change. Update the scalar `animate` target, call `animate(value, nextTarget, uiSpring)` on the same MotionValue, or call `.set(nextTarget)` on a `useSpring` value. Motion automatically replaces the active animation and inherits the live value and velocity. Leave `from`, `velocity`, and fixed timing options unset for these retargets. For colors and other compound styles, spring a numeric mix amount or progress value and derive the visual property from it.
|
||||
- Keep `AnimatePresence` mounted and use a stable child key so a reopening element can reverse its exit. Make an exiting overlay inert and release its hit area immediately. Track direct manipulation one-to-one and seed the spring with release velocity when handing control over from an external gesture.
|
||||
- Keep CSS state changes immediate. Use Motion springs for visual transitions, including hover and loading feedback. Reserve repeating springs for ambient indicators and give them a static state under reduced motion. For continuous simulation, keep the path on its existing clock and spring its speed or progress. A new event can start a distinct path at its own origin.
|
||||
- Use a single progress value for a staged effect. Derive the capture flare, flight, absorption, and recovery-point flash from the scene clock. If the snapshot list is still refreshing, let the impact finish and hold the flash until its confirmed snapshot arrives.
|
||||
- Measure the destination frame on a mode change or resize. Spring the map's center and size from its current visual rectangle, and recompute the collision layout once the frame settles.
|
||||
- Honor live changes to `prefers-reduced-motion`. The app applies declarative targets immediately. Imperative effects must stop and jump to the appropriate static state themselves. Verify reversals before settling, the final target, and reduced motion in a browser.
|
||||
|
||||
## Local verification
|
||||
@@ -45,4 +48,11 @@ cargo build --locked -p tessera-hub
|
||||
|
||||
To preview a populated scene, start the hub with `TESSERA_SEED_DEMO=1` and a fresh temporary `TESSERA_DATA_DIR`. Open the vault and select an orbit with snapshots to review the locked layout.
|
||||
|
||||
The optional `web/scripts/capture-galaxy.mjs` screenshot helper uses a local Playwright and Chromium installation. It captures Flowing and Locked into the system temporary directory by default.
|
||||
The optional `web/scripts/capture-galaxy.mjs` helper uses a local Playwright and Chromium installation. It saves Flowing and Locked screenshots in the system temporary directory by default. To exercise 55 orbits and simulated successful and failed captures against a running web build, use the browser fixture. It measures median and p95 frame intervals with Chromium CPU throttling and checks reversal, capture feedback, resizing, and reduced motion.
|
||||
|
||||
```sh
|
||||
TESSERA_GALAXY_FIXTURE=1 CPU_THROTTLE=4 FRAME_P95_MAX_MS=33.4 \
|
||||
TESSERA_URL=http://127.0.0.1:5173 node web/scripts/capture-galaxy.mjs
|
||||
```
|
||||
|
||||
Set `VIEWPORT_WIDTH=3840 VIEWPORT_HEIGHT=2160` for a 4K viewport. Set `VERIFY_ANIMATION=0` to record a fixture baseline on older builds. If Playwright or Chromium is installed outside the web workspace, point `PLAYWRIGHT_MODULE` and `CHROMIUM_PATH` at those installations.
|
||||
|
||||
Reference in New Issue
Block a user