- GDRIVE_MIRROR_BOOT.md med staleness-varsel (12t terskel) og connector-prioritet - sync-gdrive-mirror.sh: auto-tidsstempel, prosjektindeks, .gdrive-mirror-state - osvauco-opax-boot.sh: alias auto-inject ~/.bashrc, GitHub vs lokal HEAD, PROMPT_COMMAND terminal-logging - opax-logg-slutt.sh standalone - .github/workflows/backup-gdrive-nightly.yml: nattlig git bundle + nøkkelfiler til GDrive - docs/GDRIVE_SETUP.md: ett-gangs oppsett-guide for rclone + IAM - docs/TODO.md: IAM/secrets-oppsett + gemini TUI-logging som neste oppgaver
115 lines
2.7 KiB
Markdown
115 lines
2.7 KiB
Markdown
# VAUCO OS — GDRIVE BACKUP SETUP
|
|
|
|
> Eier: OPS-Computer-Hub · Opprettet: 2026-05-25
|
|
|
|
Ett-gangs oppsett for å aktivere nattlig GDrive-backup og `sync-gdrive-mirror.sh`.
|
|
|
|
---
|
|
|
|
## Forutsetninger
|
|
|
|
- GCP service account med `roles/drive.file` på GDrive-mappen
|
|
- GitHub Secrets satt (se under)
|
|
- `rclone` installert lokalt for manuell bruk
|
|
|
|
---
|
|
|
|
## Steg 1 — Opprett GDrive-mapper
|
|
|
|
Opprett to mapper i Google Drive (under `chris.christiansen@vauco.no`):
|
|
|
|
| Mappe | Formål |
|
|
|---|---|
|
|
| `vauco-mirror/` | Nøkkelfiler (MD, indeks) — agent-lesbar |
|
|
| `vauco-backup/` | git bundle — disaster recovery |
|
|
|
|
Kopier mappe-ID fra URL: `https://drive.google.com/drive/folders/**<ID>**`
|
|
|
|
---
|
|
|
|
## Steg 2 — Service account (HITL: IAM_GODKJENT)
|
|
|
|
```bash
|
|
# Opprett service account
|
|
gcloud iam service-accounts create vauco-gdrive-backup \
|
|
--display-name="Vauco GDrive Backup" \
|
|
--project=propane-will-491900-m5
|
|
|
|
# Last ned nøkkel
|
|
gcloud iam service-accounts keys create /tmp/vauco-gdrive-sa.json \
|
|
--iam-account=vauco-gdrive-backup@propane-will-491900-m5.iam.gserviceaccount.com
|
|
```
|
|
|
|
Del `vauco-backup/`- og `vauco-mirror/`-mappene med service account-e-posten:
|
|
`vauco-gdrive-backup@propane-will-491900-m5.iam.gserviceaccount.com` (Editor)
|
|
|
|
---
|
|
|
|
## Steg 3 — GitHub Secrets
|
|
|
|
Gå til: `https://github.com/chrischristiansen-glitch/OSVauco/settings/secrets/actions`
|
|
|
|
Legg til:
|
|
|
|
| Secret | Verdi |
|
|
|---|---|
|
|
| `RCLONE_GDRIVE_SA_JSON` | Innhold av `/tmp/vauco-gdrive-sa.json` (hele JSON-strengen) |
|
|
| `GDRIVE_BACKUP_FOLDER_ID` | Mappe-ID for `vauco-backup/` fra GDrive URL |
|
|
|
|
---
|
|
|
|
## Steg 4 — Test manuelt
|
|
|
|
```bash
|
|
# Installer rclone lokalt
|
|
curl https://rclone.org/install.sh | sudo bash
|
|
|
|
# Konfigurer
|
|
rclone config # velg Google Drive, bruk service account JSON
|
|
|
|
# Test sync
|
|
bash scripts/sync-gdrive-mirror.sh
|
|
```
|
|
|
|
---
|
|
|
|
## Steg 5 — Aktiver workflow
|
|
|
|
Etter merge av PR #1:
|
|
- Workflow kjører automatisk neste natt kl 03:00 UTC
|
|
- Manuell trigger: GitHub → Actions → "Nightly GDrive Backup" → Run workflow
|
|
|
|
---
|
|
|
|
## Hva som synkroniseres
|
|
|
|
### `vauco-mirror/` (nøkkelfiler — agent-lesbar)
|
|
- `AGENT_RULEBOOK.md`
|
|
- `GDRIVE_MIRROR_BOOT.md` (auto-generert med tidsstempel)
|
|
- `LEARNINGS.md`
|
|
- `VAUCO_OS_ROADMAP.md`
|
|
- `TODO.md`
|
|
- `MASTERPLAN.md`
|
|
- `sessions/index.md`
|
|
|
|
### `vauco-backup/` (git bundle — disaster recovery)
|
|
- `OSVauco-backup-<timestamp>.bundle` — full repo med all historikk
|
|
- Beholder siste 7 bundles (ca. 1 uke)
|
|
|
|
---
|
|
|
|
## Gjenoppretting fra bundle
|
|
|
|
```bash
|
|
# Last ned bundle fra GDrive
|
|
# Klon fra bundle
|
|
git clone OSVauco-backup-2026-05-25T0300.bundle OSVauco-restored
|
|
cd OSVauco-restored
|
|
git remote set-url origin https://github.com/chrischristiansen-glitch/OSVauco.git
|
|
git push --mirror origin # MERGE APPROVED kreves
|
|
```
|
|
|
|
---
|
|
|
|
**EOF · GDRIVE_SETUP v1.0 · 2026-05-25 · OPS-Computer-Hub**
|