Commit Graph
91 Commits
Author SHA1 Message Date
Gmer4Lfe a705aa36b7 List each AI enhancement against the script it enhances
Declared in PHP rather than in each bash header, against scriptinfo's usual rule
that the header next to the code is authoritative: it is authoritative about what
the script does, and an enhancement is something else reading its output, gated
by a flag the script has never heard of. A description of PHP inside a file that
cannot enforce it would drift the first time either changed.

Shown with its switch, so "there is an enhancement" and "it is running" are never
the same claim. Discovery is listed even though nothing acts on its output — it
takes the first accessible root folder with no regard for content, and the
classification scan is what notices that night. That relationship explains where
misfiled series come from and was written down nowhere.
2026-08-14 22:25:24 -04:00
Gmer4Lfe 60971f1af4 Let a misfiled series be moved from the finding that reported it
The triage could say Narcos is filed under anime and offer nothing to do about
it. Findings that recorded a destination now carry a Move action, which the AI
tab renders as a button on its own — actions are read from the server, so no UI
knew this existed. Armed like Fix and Dismiss, because it is the only action in
that card that relocates files rather than settings and the undo is another move.
Offered only where the triage said misfiled, never for uncertain: three
narrowings before a file is touched. Re-reads the series from Sonarr first, so a
finding gone stale cannot undo a move made by hand in the meantime.
2026-08-14 22:13:25 -04:00
Gmer4Lfe 793a75b8a2 Remember the last ten manual syncs so a repeat is one click
Retyping two paths and nine checkboxes correctly every time is where the
mistakes come from, and "one-off" described how a transfer is scheduled rather
than how often it is run. Pinned entries are exempt from the rotation — the
command used twice a year is both the most worth keeping and the first that ten
ordinary runs evict. Stored server-side, so the list is there from any screen,
and loading one fills the form and stops rather than running it.
2026-08-14 17:38:48 -04:00
Gmer4Lfe 7a3e8dd378 Say when rsync last moved data, and stop colouring successful runs red
last_sync reads the maintenance orchestrators' run records, and those do git
pull, permissions, cleaners and docker updates on schedule whether or not the
global gate is open — so the page reported a healthy 56-minute "daily sync"
while nothing had transferred since 16 July. Both cards also compared status
against 'success' while being fed 'ok', so every clean run rendered in the
failure colour. Adds the assistant, scoped to the tab.
2026-08-14 16:50:28 -04:00
Gmer4Lfe 1f4b751fbb Cache the watchdog payload, and stop reading trailing comments as conf values
The tab collected over SSH on every 30s poll — 8.3s a load with HOST2 down.
vv_parse_conf_scalar() captured to end of line, so a commented toggle parsed as
"true   # HOST2 back online": every threshold read right because (int) stops at
the first non-digit, and 38 booleans read wrong. The Fallback tab has been
showing failover disabled while it was on.
2026-08-14 10:45:17 -04:00
Gmer4Lfe 2ccc93bb14 Send a bug report to one place, on purpose, after reading it
The page built its own markdown and nothing could send it; local and upstream
are different people, so neither falls back to the other.
2026-08-13 16:32:36 -04:00
Gmer4Lfe e64d26af6c Put each page's settings on that page
A watchdog threshold was reachable only from the bottom of a list of a hundred
and twenty on another tab.
2026-08-12 19:55:51 -04:00
Gmer4Lfe 8ca52c64b9 Give the rest of the conf a place to be changed
A third of the settings had no control anywhere, so the answer to "where do I
change this" was to open a file over SSH.
2026-08-12 19:41:01 -04:00
Gmer4Lfe dfe4c0d495 Toggle the script in the orchestrator you clicked, not the first one that lists it
docker_update.sh runs bare in daily, --weekly in weekly and --remainder in
monthly, so switching it off in monthly disabled the daily run and reported
success.
2026-08-11 20:08:32 -04:00
Gmer4Lfe f90b23ddd9 Initialise the array the write path collects refusals into
An undefined variable reaching a by-reference array parameter is a TypeError
under PHP 8, so every save through this endpoint died before writing anything.
2026-08-11 19:03:12 -04:00
Gmer4Lfe 29e0daf80d Let the assistant propose what to remember, and the operator decide what is kept 2026-08-10 22:00:42 -04:00
Gmer4Lfe eb24e60b8c Stream the answer as it is written, and let the operator stop it 2026-08-10 20:22:57 -04:00
Gmer4Lfe 613634473a Let General Chat search the web, and only General Chat
Search is the one capability that fits the profile holding none: every other capability either
reads this installation or changes it, and chat's whole contract is that it can do neither. The
assistant deliberately does not get it — its contract is that answers come from this install's
own documents, and a web result there is an answer that looks sourced and is not. A chat question
about this machine hands off to the assistant before the search would run, so it never reaches
the internet even with the box ticked.

Off by default, and not because it is dangerous: searching sends the operator's question outside
the house, which is theirs to decide. Asked for per turn as well as enabled in conf.

Provider-agnostic, as asked — searxng, brave, tavily. Only whichever is configured here can be
verified; all three read every field by name, so a shape that changes underneath yields no
results rather than wrong ones.

The explain fixtures asserted chat holds no capabilities at all, which is exactly the guarantee
worth keeping. caps=only: now states the set rather than its emptiness, so the check still fails
the day something else is granted there.
2026-08-09 22:42:43 -04:00
Gmer4Lfe a5be719261 Refuse a conf write that widens a path to its own ancestor
Several scripts delete inside a conf path — the orphan cleaner runs rm -rf under a download dir
and rsync runs --delete against a destination — so /mnt/user/Movies becoming /mnt/user is the
edit that turns a cleanup into a sweep. Depth cannot be the test, because /tv and /movies are
real container-internal values here; direction can. Clearing a path, making it relative and
'..' segments go with it, and autofix additionally requires a proposed path to exist, since
every probe it has is a network probe and proves nothing about a directory. Refusals now reach
the caller: a save whose only change was refused answered ok with no explanation.
2026-08-09 21:21:52 -04:00
Gmer4Lfe 77fb1abb85 Put the findings where they can be answered
Seven findings had been sitting in needs_operator with no way to reach the operator: the only
way to read one was the sweep tool over SSH. The card states the gate as well as the list,
because an empty list means nothing found when repair is on and nothing is looking when it is
off. Buttons come from the actions the endpoint returned for that row, so a tab left open
overnight cannot offer a choice the store has moved past.
2026-08-09 21:14:44 -04:00
Gmer4Lfe 500f9d92c8 Redact credentials on the way into a stored chat
A stored transcript is replayed into a later prompt when reopened, so a key typed while
changing a setting would be handed back to the model on every subsequent turn.
2026-08-09 19:07:34 -04:00
Gmer4Lfe 67eabdc17c Route every conf writer through the guarded path
Eleven call sites wrote master.conf with tmp+rename and nothing else — no backup, no
parse check, no audit — including the two toggles the UI uses most and the raw editor
that installs a whole hand-edited file.
2026-08-09 19:07:28 -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 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 ea0c713c89 Put the assistant on the dashboard, where the questions actually occur to you 2026-08-08 22:01:13 -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 df3c4bb369 Stop signalling on the strength of a stat file alone
A job killed hard never corrects its own record, so 'running' outlives the
process and the pid can since belong to something else; array-start jobs get
setsid too, so Stop can reach past their direct children.
2026-08-08 13:50:01 -04:00
Gmer4Lfe 9cabb04395 Resolve Custom script ids where the scripts actually live
The Custom/ prefix is a namespace, not a directory under SCRIPTS_DIR, so every
launcher that resolved it as one could never find the script.
2026-08-08 12:47:26 -04:00
Gmer4Lfe 2ab7d3d98a Stop the Stop button from killing the web server
UI-launched jobs inherited php-fpm's process group, so stopping one that was
actually running group-killed the WebGUI; setsid makes the job its own group
leader and stop.php now refuses to signal any group it does not lead.
2026-08-08 11:09:08 -04:00
Gmer4Lfe 86a0ba55fe Include the config the container endpoint now depends on
vv_cache_clear() went in without it, so every start and stop fatalled on the line after the
docker command had already run — the action succeeded and the page was told it failed.
2026-08-07 10:33:08 -04:00
Gmer4Lfe ab794db0ab Stop the dashboard polling harder than its data can change
Every poll after the first asked for ?live=1, so the page paid a full collection — partner SSH
timeouts included — every two seconds while the tmpfs cache it was built around went unused.
Polls are now guarded against overlap and stop while the tab is hidden, repeated failures say so
instead of leaving the last good reading on screen, and two functions nothing called are gone.
2026-08-07 10:23:13 -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 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 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 e467cdaf23 The scheduler AI dock read the poll envelope as the job, so every answer hung on thinking 2026-08-06 18:28:13 -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 185abdb442 Add a scope-aware assistant dock to the scheduler right panel 2026-08-05 19:56:02 -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 8d393a1e1c Add three chat profiles: Varaverk Assistant, General Chat, Code Sketcher
Explicit buttons rather than an automatic router. Misclassifying a Varaverk
question as chat produces a confident invention about the user's system, which
is exactly what retrieval exists to prevent — with buttons there is no hidden
heuristic to be wrong and the strict profile is the default you land on.

Only Varaverk Assistant retrieves; the other two would be carrying passages
that cannot help write a folder-copy script. Memory goes to all three, since
that is what lets chat know the setup without claiming authority over it.
History depth is per profile and set server-side: retrieval costs ~2500 of
16384, so the profiles that skip it can hold a real conversation. Code
Sketcher is told to flag flags it is unsure of, after it invented
rsync --no-overwrite.
2026-08-03 17:36:24 -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 7625e923e5 Accept the global RSYNC_ENABLED flag, not only prefixed tiers
The pattern required a tier prefix, so the master gate the rsync page renders
alongside the tier toggles was rejected as an invalid flag name and sprang
back to off. There was no way to enable syncing from the UI. Masked until now
because every POST to this endpoint was being swallowed as multipart.
2026-08-02 18:49:00 -04:00
Gmer4Lfe 7f01b3040d Log entry into the AI endpoint before any dependency loads
A POST the browser demonstrably sent — correct token, correct body — left no
trace: no CSRF termination, no fatal, and no action log. Rejected-before-PHP
and died-inside-the-include are indistinguishable from outside, so the first
statement now records that execution arrived.
2026-08-02 18:16:58 -04:00
Gmer4Lfe 563ea0eb78 Log AI requests, and stop hiding a failed job-file write
There is no nginx access log on this host and the CSRF prepend exits with an
empty body, so a request that never arrived and one that arrived and failed
were indistinguishable — the page just sat at "starting…". The job-file write
was also suppressed with @, which would produce exactly that hang: a token
returned for a job that can never report.
2026-08-02 17:57:22 -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 c34224effa Carry the CSRF token on fetch requests and put mutations behind POST
Unraid already enforces CSRF on every POST via auto_prepend, but its
injector is jQuery-only — the plugin's native fetch() calls carried no
token and were being terminated before the endpoint ran, silently,
because csrf_terminate exits with an empty body that r.json() swallows.
2026-08-02 10:28:53 -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 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 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 5d32f58f5d fix boot device detection failing on ZFS /boot
findmnt returns 'flash/boot' for a ZFS dataset, not a /dev/* path.
lsblk -no pkname then fails, leaving transport as 'unknown'. Resolve
ZFS pools to a backing device via zpool before checking transport.
2026-06-27 23:18:36 -04:00