Remove the Docker tab and stop overwriting folder.view3's file, which destroyed folders made in its own UI

This commit is contained in:
Gmer4Lfe
2026-08-17 05:11:00 -04:00
parent 6a15a9d99a
commit 3676526daf
5 changed files with 20 additions and 686 deletions
+13 -8
View File
@@ -8,7 +8,7 @@
// DESIGN PRINCIPLES
// Varaverk owns its own folder store.
// docker_folders.json is the primary record and has no external dependency. The
// folder.view3 plugin is synced to only when it is actually installed, so Varaverk's
// folder.view3 owns its own docker.json; Varaverk reads it and never writes it, so
// grouping survives that plugin being absent, removed, or reset.
//
// The conf map is the interface to the scripts.
@@ -42,7 +42,7 @@
//
// CONFIGURATION
// VV_DOCKER_JSON /boot/config/plugins/varaverk/docker_folders.json — primary
// VV_FV3_JSON folder.view3's docker.json — synced only if present
// VV_FV3_JSON folder.view3's docker.json — READ only, imported once at bootstrap
// HOST*_DOCKER_FOLDER_MAP conf mirror consumed by the onboarding scripts
// ═══════════════════════════════════════════════════════════════════════════════════════════════
// Docker tab — folder management and container inventory
@@ -76,12 +76,17 @@ function vv_dk_write_json(array $data): bool {
if (file_put_contents($tmp, json_encode($data, JSON_UNESCAPED_SLASHES)) === false) return false;
if (!rename($tmp, $path)) return false;
// Mirror to folder.view3 if installed — keeps both in sync for users who want both UIs
if (file_exists(dirname(VV_FV3_JSON))) {
$t = VV_FV3_JSON . '.vv.tmp';
@file_put_contents($t, json_encode($data, JSON_UNESCAPED_SLASHES));
@rename($t, VV_FV3_JSON);
}
// Deliberately does NOT write folder.view3's docker.json any more.
//
// This used to mirror the whole file across — a wholesale overwrite, not a merge — so any
// folder created in folder.view3's own UI was destroyed by the next Varaverk save. Two
// writers, one file, and the one that clobbers wins. The evidence was a duplicated
// "Jayred365-Fallback" on HOST1: one folder with folder.view3's 20-char id, another with a
// 12-char id, the same name, different contents.
//
// folder.view3 is now the single owner of that file. Varaverk still *reads* it (see
// vv_dk_read_json's bootstrap import) so the Monitor widget can group containers, but read
// is the whole relationship.
return true;
}