Commit Graph
103 Commits
Author SHA1 Message Date
Gmer4Lfe d9225d06d9 Route a General Chat question to the profile that fits it 2026-08-09 00:36:13 -04:00
Gmer4Lfe 37784bce6c Offer Troubleshoot as a profile, and say plainly when it has no log 2026-08-09 00:25:52 -04:00
Gmer4Lfe 073352b21e Put the Scheduler dock on the same conversation store as everything else 2026-08-09 00:16:09 -04:00
Gmer4Lfe f4fd17be4d Accept the one retrieval kind the indexer produces and the page offers 2026-08-09 00:08:33 -04:00
Gmer4Lfe f1603349cc Put everything Varaverk persists under one root, state included 2026-08-08 23:26:46 -04:00
Gmer4Lfe d5c36db531 Put every tmpfs path in one place both layers can read 2026-08-08 22:57:29 -04:00
Gmer4Lfe 0f92609425 Give the AI subsystem one profile table and one collection, read everywhere 2026-08-08 22:35:37 -04:00
Gmer4Lfe 0f4d381ac0 Make PHP agree with the clock the rest of the server keeps 2026-08-08 22:35:31 -04:00
Gmer4Lfe 4d00e37ca1 Move the chat into an include, because the second one was going to be a copy 2026-08-08 22:01:06 -04:00
Gmer4Lfe 1e324636e0 Keep conversations, so a useful answer outlives the tab it was asked in 2026-08-08 22:00:58 -04:00
Gmer4Lfe b445ddc2c8 Make a container action tell the truth about what happened
The response was discarded, so a refused stop looked like a completed one, and the payload the
card redraws from is cached for 300s with no invalidation — the container carried on showing as
running until the once-a-minute writer caught up. Stop now confirms; start still does not.
2026-08-07 10:20:11 -04:00
Gmer4Lfe fb50f94ed8 Escape what the monitor page renders, and put the helpers where every page can reach them
The page interpolated media titles, partner hostnames read over the mesh, and docker folder
names straight into innerHTML — its own header claimed otherwise, and the helpers that would
have fixed it were defined in a page it never loads. Container WebUI values now get a scheme
check before they reach window.open().
2026-08-07 10:17:45 -04:00
Gmer4Lfe be306cf86c Let one gate decide every AI surface, so switching AI off actually removes all of it
The Tools card adopted the AI scripts on the host check alone, and api/ai.php only
tested AI_ENABLED in front of ask, so a disabled subsystem still had rows to run and
an endpoint that answered.
2026-08-07 09:49:31 -04:00
Gmer4Lfe bf7a2cc911 Point scripts at the shared host sections, and fix the two reasons those sections could never be found 2026-08-06 23:16:28 -04:00
Gmer4Lfe 4989486f45 Two thirds of the conf was unreachable from the UI, and an empty Config block said nothing about why 2026-08-06 23:08:49 -04:00
Gmer4Lfe 9be6055113 Adopt the AI tools onto the Tools card, but only where the index and the model actually are 2026-08-06 23:02:22 -04:00
Gmer4Lfe 9145a66cef Surface server_reboot.sh on the Tools card without moving it out of the shutdown chain it belongs to 2026-08-06 22:24:30 -04:00
Gmer4Lfe f2d0e18f2c Ask about a run from the row it is on, and stop spending context on health checks when the run was clean 2026-08-06 21:51:55 -04:00
Gmer4Lfe ce0cbd868c Write down the routing every bug so far produced, and check it without asking the model 2026-08-06 21:34:05 -04:00
Gmer4Lfe 917ff43795 Profile permissions belong in one table, because scattered they hid a capability chat was never meant to have 2026-08-06 20:51:19 -04:00
Gmer4Lfe 815ceef276 A question about how a run went should arrive with the run attached, not with directions to the log panel 2026-08-06 18:43:12 -04:00
Gmer4Lfe 269ef9b2de Verify a bug report's component and evidence before filing it 2026-08-05 21:25:00 -04:00
Gmer4Lfe 657ee435d1 Add a copy-out button that formats a report as a pasteable issue 2026-08-05 21:12:40 -04:00
Gmer4Lfe 2c5e412d91 File AI-detected Varaverk defects as deduped reports, surfaced on the AI tab and counted in the coffee report 2026-08-05 20:48:54 -04:00
Gmer4Lfe 714d97dd49 Add an incident journal the troubleshooter reads back, and thinking for diagnosis 2026-08-05 20:26:56 -04:00
Gmer4Lfe 5a813eb4c8 Add a troubleshooting profile with the scoped log, and a deterministic conf-key lookup 2026-08-05 20:18:05 -04:00
Gmer4Lfe aeb8c01370 Show the terse control list when the help block is collapsed 2026-08-05 17:58:29 -04:00
Gmer4Lfe 90eee5674f Guarantee a trailing newline when writing a conf so appends cannot join the last line 2026-08-04 21:20:42 -04:00
Gmer4Lfe 87fa2693f0 Show the reference tables collapsed and the task guide on expand, from one file 2026-08-04 19:45:23 -04:00
Gmer4Lfe 64a28acd64 Keep wrapped list items in their bullet instead of orphaning the continuation 2026-08-04 19:38:58 -04:00
Gmer4Lfe 3ea80ef944 Single-source the scheduler help from markdown the AI index can read 2026-08-04 19:30:38 -04:00
Gmer4Lfe 83508cfb1b Pull partner token ledgers into a RAM cache so fleet totals are fleet-wide 2026-08-04 18:14:38 -04:00
Gmer4Lfe 969a85f303 Record token usage per turn and show daily, weekly and all-time totals by host 2026-08-04 18:04:46 -04:00
Gmer4Lfe b1fdaced9f Restrict the AI tab to HOST1 — the only node with the GPU, Ollama and the index 2026-08-04 17:25:40 -04:00
Gmer4Lfe 452bf0e544 Route definitional questions to the narrative docs, and tolerate misspelling
"What is Varaverk" matched the PURPOSE intent, so retrieval returned every
script's one-line purpose and the model answered that the context does not
define the system — while README.md sat in the index unread. A definitional
question with no explicit filter now goes to kind=readme.

Varaverk is a coined word with no spell-check, so it arrives as varavrk,
veraverk, varavek. Edit distance catches those without a pattern that needs
extending per typo. This is search, not identity — a near-miss only widens a
document search, unlike hostname resolution where it must never resolve.
2026-08-03 18:17:56 -04:00
Gmer4Lfe d0b3588f6c Give the assistant a standing memory file
A small operator-written file handed to the model at the start of every
conversation — who you are, how this install is set up, what has already been
decided. Injected ahead of the retrieved passages and marked operator-authored
so it outranks anything they contradict, and never cited as a source.

Deliberately not indexed and deliberately under DATA_DIR: it changes
constantly, vector similarity is the wrong way to retrieve things you were
told to remember, and gitignoring it keeps personal notes out of a pushed
repository. The character cap is a context budget — this text costs its share
of 16k on every single turn.
2026-08-03 17:11:27 -04:00
Gmer4Lfe 69ffb5e1dc Fix two false alarms in the AI health checks
vv_meta uses columns k/v, so the embedder-match check read nothing and
reported "unrecorded" — a silent pass on the one mismatch that returns
confident nonsense instead of an error. And Ollama reports tags fully
qualified while conf carries the bare name, so an installed embedding model
was reported missing. A health panel that cries wolf is worse than none.
2026-08-02 17:42:35 -04:00
Gmer4Lfe 237156c46f Add config-vs-reality health checks, loaded models, and log evidence
The failures this subsystem actually has are configuration drift, so each
check names the setting to change rather than reporting that retrieval
failed. Notably it catches a conf model tag that is no longer installed, and
an index built by a different embedder than the one configured — vectors
from two models are not comparable, and that failure returns confident
nonsense rather than erroring. Diagnostic questions also get recent log
warnings, attached only then because they cost budget the passages need.
2026-08-02 17:40:43 -04:00
Gmer4Lfe 264ba57cbb Add the AI tab — grounded chat over the documentation index
Token and poll rather than SSE, so the api layer keeps one response
convention and reuses the pattern manual_sync already proved. History is
capped at three turns because the model is only fully offloaded at 16384
context and unbounded history would cross that silently. The tab exists
only while AI_ENABLED is true, rejected server-side and not merely hidden.
2026-08-02 17:32:17 -04:00
Gmer4Lfe 987313e7dc Document the PHP api layer and fix what documenting it exposed
Writing down what each endpoint actually guarantees made the places it
didn't obvious — shell arguments reaching a crontab or a bash -c
unescaped, master.conf written without tmp+rename, and conf edits that
could be saved without ever being parsed.
2026-08-02 10:11:39 -04:00
Gmer4Lfe 43b5443b30 Add structured headers to the PHP include layer, fix monitor state paths
All 16 include/ files now carry PURPOSE / DESIGN PRINCIPLES / OPERATIONAL
SAFEGUARDS / EXPORTS / CONFIGURATION, keeping the first three section names
identical to the bash headers so retrieval can route across both languages.

monitor.php read six watchdog state files from /tmp while the watchdogs write
to STATE_DIR, so every strike set came back empty and the summary reported
healthy unconditionally. docs.php gained path containment before it is wired
to a page.
2026-08-02 00:38:22 -04:00
Gmer4Lfe e2e76560a2 Fix Authelia config path and stale schedule comments in conf templates
The Authelia config default pointed at /mnt/user/appdata/Authelia, which does
not exist — the auth stack lives in the Critical-Data share so it gets synced.
Because conf_populate only fills empty fields, that wrong non-empty default
blocked auto-detection permanently and left the auth page's rules panel dead.

Also corrects three schedule comments that no longer matched varaverk.cron and
two references to scripts that have since been renamed or split.
2026-08-02 00:13:53 -04:00
Gmer4Lfe cdce877601 Add a second GPU card to the monitor page
The 3080 was invisible because the stats parser only ever described GPU 0.
2026-08-01 20:37:58 -04:00
Gmer4Lfe 084220692f Add unambiguous prefix-match fallback for NetBIOS-truncated hostnames
Unraid truncates the Server Name to 15 chars. Depending on which form
ends up in master.conf's HOST* value (the truncated OS hostname, or a
longer name matching what Tailscale independently registered for that
peer), either host-identity detection or Tailscale IP resolution could
fail — hit live on HOST2 in both directions this session.

- common.sh detect_hosts(): was case-sensitive exact match only, with no
  fallback and an exit 1 on failure — meaning every orchestrator/watchdog/
  rsync script would hard-fail on a truncated-hostname host, not just the
  web UI. Now case-insensitive, with a prefix-match fallback when the
  local hostname is exactly 15 chars.
- common.sh resolve_tailscale_ip(): already did a bare regex prefix match
  with zero ambiguity handling (pre-existing risk: e.g. server1/server10
  could collide). Replaced with an explicit unambiguous-only check.
- config.php vv_detect_host() / vv_resolve_tailscale_ip(): same treatment,
  kept as close a mirror of the bash logic as PHP allows.

All fallbacks require an EXACT prefix match (never fuzzy/percentage
similarity — considered and rejected, since names like server1/server2/
server3 would be dangerously similar under any generic similarity metric)
and require exactly one candidate to qualify; ambiguous matches are
treated as no match rather than guessed. Verified live against HOST1/
HOST2 in both master.conf configurations (short and long HOST2 value).
2026-07-04 23:49:44 -04:00
Gmer4Lfe abfbaa7f47 Fix host identity detection for NetBIOS-truncated hostnames
Unraid truncates the Server Name to 15 chars (NetBIOS limit). HOST2's
real hostname is "unRAID-Jayred36" but master.conf's HOST2 (matching
what Tailscale shows for this peer, since resolve_tailscale_ip() keys
off the same value) is the untruncated "unRAID-Jayred365" — confirmed
live, Tailscale's own Self.HostName on that machine is truncated too.

vv_detect_host() did a strict case-insensitive match against the bare
`hostname -s` output with no tolerance for this, so it always returned
'unknown' on HOST2. That silently broke the first-run wizard (Varaverk.page
explicitly excludes 'unknown' from the "needs setup" check) even though
host2.conf never existed, plus vv_partner_state() and vv_fallback_active()
in monitor.php which independently reimplemented the same hostname
comparison instead of calling vv_detect_host().

Fix: vv_detect_host() falls back to a prefix match when the local hostname
is exactly 15 chars; vv_partner_state()/vv_fallback_active() now call
vv_detect_host() instead of duplicating the comparison. Verified live on
HOST2 — vv_detect_host() now returns 'host2', partner state correctly
flags HOST2 as is_me, and the wizard-trigger condition now evaluates true.
2026-07-04 23:28:54 -04:00
Gmer4Lfe 3d7b15d6bb Fix vv_push_master_conf() — remote command was expanding locally, not on the remote host
The readiness probe wrapped the remote command in raw double quotes with
manually backslash-escaped inner quotes. shell_exec() runs its command
through an extra local `sh -c` layer beyond the ssh invocation itself, and
because the remote command was double-quoted (not single-quoted/opaque),
that extra local layer expanded the $(...)/${...} substitutions using
HOST1's own environment before ssh ever sent anything to the remote host.
Confirmed live: the exact same command run directly (one shell layer)
returned the correct remote SCRIPTS_DIR; run through an extra sh -c layer
(matching shell_exec's real behavior) it silently evaluated everything
against HOST1's local varaverk.cfg instead, producing an empty probe result
every time — so every push silently reported "plugin not installed" even
though HOST2 was fully installed and reachable.

Fix: build the remote command as a plain string and escapeshellarg() it as
a whole, same pattern vv_pt_ssh() already used safely elsewhere. Verified
live — probe now returns HOST2's real SCRIPTS_DIR and the master.conf push
lands with a matching checksum on both hosts.
2026-07-04 23:19:42 -04:00
Gmer4Lfe 7e4db7b504 Fix stale plugin docs and dead links
- unraid_api.php comment still told you to run Deployment/deploy.sh,
  deleted a while back
- VaraverkSettings.page linked to a CHANGELOG.md that doesn't exist
  anywhere in the repo
- Manual-Plugin.md / README-Plugin.md described manually heredoc-ing the
  .plg locally and a .txz-based install that isn't wired up — rewritten
  to describe the actual install flow (raw .plg URL via Plugins ->
  Install Plugin), with plugin_setup.sh's dev-symlink role called out
  separately from that install path
2026-07-04 23:00:57 -04:00
Gmer4Lfe f7fa75fdfb Fix dead/incorrect vars in Plugin/ found during full codebase audit
- WEBGUI_PHP_WAIT was referenced by webgui_watchdog.sh but never defined
  in master.conf, always silently falling back to a hardcoded default
- arrs.php/confform.php still pointed at Media/ for arr cleanup/discovery
  scripts moved to Arrs_Stack/ in b4bc926 — broke the Arrs page's stats
  and the per-script settings editor for those scripts
- docker_folders.php read directly from the optional folder.view3 plugin's
  file instead of Varaverk's own docker_folders.json (the primary store
  since the Docker tab got its own config) — left the Monitor page's
  Docker Folders widget empty on any host without folder.view3 installed
- vv_wd_remote_data() read remote watchdog state files from hardcoded
  /tmp or /boot/config paths instead of the remote's actual STATE_DIR
  (which resolves dynamically and can differ under flash mode) — remote
  node's Watchdog panel was always empty; same wrong path also used for
  two local reads (system_watchdog_oom.db, watchdog_appdata_growth.db)
- rsync.php referenced a {HOST}_MONTHLY_SYNC_SHARES conf var that never
  existed (monthly_maintenance.sh has no rsync section) — nulled out to
  match the existing pattern used for the fallback window
- vv_arr_node_names() did a pointless identity array_map
- vv_dk_webui() had its own duplicate local-IP resolution instead of
  using vv_local_ip(), despite config.php's comment claiming that exact
  duplication was already consolidated
2026-07-04 23:00:26 -04:00
Gmer4Lfe 6fd22ae4ee Move Custom Scripts out of the repo and add an Import Script picker
Custom Scripts (the Scheduler page's inline editor) used to save into the
git-tracked Custom/ folder, so anything saved there would end up on GitHub.
They now live in /boot/config/plugins/user.scripts/Varaverk/Scripts, same
folder family as Unraid's own User Scripts plugin. Import Script lets you
browse the whole server and move an existing script in instead of only
creating new ones inline — always a move, never a copy, so no stray
duplicate is left where it came from.
2026-07-03 10:57:35 -04:00
Gmer4Lfe b314aa4aff fix monitor disk used space underreported for spun-down disks
Unraid API returns fsUsed=0 when a disk's filesystem is unmounted (spun
down). disks.ini keeps the last-known value in KB even after spindown —
use it as fallback when isSpinning=false and fsUsed=0. Also remove the
mounted-only guard in the ini fallback path (vv_disk_entry) for the same
reason. Stale comments in user_script_plug-in.sh and partnership_manager.sh
also cleaned up.
2026-06-27 23:08:51 -04:00