Document today's restructures, and give data/ a README that ships with it

This commit is contained in:
Gmer4Lfe
2026-08-09 00:01:05 -04:00
parent 38cd3edf99
commit 3a45c18555
12 changed files with 243 additions and 29 deletions
@@ -80,7 +80,7 @@ and the continuous scripts (start_webhook_listener, fallback), which are the fir
steps that actually touch containers.
Why conf_cache_save is FIRST in ARRAY_STOP_SCRIPTS: the RAM cache at
`/tmp/.cache/vv/d/` is wiped on reboot. Saving it must happen before anything
`/tmp/varaverk/conf/` is wiped on reboot. Saving it must happen before anything
else shuts down or changes state.
---
@@ -100,10 +100,10 @@ conf_sync.sh --log Verbose output
### What It Syncs
- **Pull**: reads the partner's `Configurations/${partner_id}.conf` from their disk
via SCP → writes to local `/tmp/.cache/vv/d/${partner_id}.conf`
via SCP → writes to local `/tmp/varaverk/conf/${partner_id}.conf`
- **Push**: sends own `Configurations/${my_id}.conf` to partner's
`/tmp/.cache/vv/d/${my_id}.conf` via SCP
- **Own conf in local cache**: copies own conf to `/tmp/.cache/vv/d/${my_id}.conf`
`/tmp/varaverk/conf/${my_id}.conf` via SCP
- **Own conf in local cache**: copies own conf to `/tmp/varaverk/conf/${my_id}.conf`
on full sync (so the cache has a complete snapshot of all confs)
Only partner confs are sourced from cache — `load_config.sh` always reads own conf
@@ -136,7 +136,7 @@ A notification fires if any partner fails — check partner reachability via Tai
### What It Does
At array stop, copies all partner confs from `/tmp/.cache/vv/d/` to
At array stop, copies all partner confs from `/tmp/varaverk/conf/` to
`$PERSISTENT_CONF_CACHE`. Own conf is skipped (always on disk). The backup survives
the reboot and is used by `conf_cache_restore.sh` at next array start if the sync
can't reach the partner.
@@ -164,7 +164,7 @@ conf_cache_save.sh --log # verbose output
### What It Does
At array start (after `conf_sync.sh`), checks which partner confs are missing from
`/tmp/.cache/vv/d/`. For each missing conf, loads it from `$PERSISTENT_CONF_CACHE`
`/tmp/varaverk/conf/`. For each missing conf, loads it from `$PERSISTENT_CONF_CACHE`
if a backup exists there.
Always removes the persistent backup when done — whether used or not. On a normal
@@ -434,8 +434,8 @@ REBOOT_VM_WAIT=30
# STATE_DIR and PERSISTENT_CONF_CACHE are derived from SCRIPTS_DIR in master.conf.
# They adapt to internal (/boot/config/plugins/varaverk) or appdata storage mode
# (/mnt/user/appdata/Varaverk) automatically — do not hardcode paths.
STATE_DIR="${SCRIPTS_DIR}/State_Files"
PERSISTENT_CONF_CACHE="${SCRIPTS_DIR}/.cache/vv/d"
STATE_DIR="${DATA_DIR}/state"
PERSISTENT_CONF_CACHE="${CACHE_BACKUP_DIR}/conf"
```
---
@@ -446,7 +446,7 @@ PERSISTENT_CONF_CACHE="${SCRIPTS_DIR}/.cache/vv/d"
```bash
# Check what's in the RAM cache:
ls -la /tmp/.cache/vv/d/
ls -la /tmp/varaverk/conf/
# Check what's in the persistent backup:
ls -la "$PERSISTENT_CONF_CACHE/" # set SCRIPTS_DIR first or use full path