1	<?xml version='1.0' standalone='yes'?>
2	<!DOCTYPE PLUGIN [
3	<!ENTITY name    "varaverk">
4	<!ENTITY author  "gmer4lfe">
5	<!ENTITY version "2026.05.31">
6	<!ENTITY sha256  "d588470d6cc7f284601cb56039d5dfea6fb5bb1ee2c800657438a8edacafbd01">
7	<!ENTITY launch  "varaverk/monitor">
8	<!ENTITY github  "https://github.com/FailedProxy/Varaverk">
9	<!ENTITY branch  "main">
10	<!ENTITY cfgdir  "/boot/config/plugins/varaverk">
11	<!ENTITY plugdir "/usr/local/emhttp/plugins/varaverk">
12	<!ENTITY pkg     "varaverk-&version;-noarch-1.txz">
13	]>
14	<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;"
15	        support="https://github.com/FailedProxy/Varaverk/issues"
16	        icon="/plugins/varaverk/icons/varaverk.png">
17
18	<CHANGES>
19	###2026.05.31
20	- Packaged release: web files now ship as a .txz that Unraid reinstalls to RAM on every boot
21	- Survives reboots with zero manual steps (no symlink, no go script) — fixes plugin vanishing after OS upgrades
22	- Scripts are git-cloned to appdata on first install; web files stay on flash (~200KB)
23	- Updates handled in-UI (git pull); the plugin no longer pulls on every boot
24
25	###2026.05.30
26	- First-run setup wizard: auto-detects hostname, creates master.conf + host conf from templates
27	- Scheduler setup mode: after wizard, master.conf and host conf open sequentially with forced save flow
28	- Partnership tab: Onboard button highlighted on arrival from wizard; disabled until partner is configured
29	- HOST2 install paths: state-file pull, master.conf push detection, conf-only flow
30	- Onboard Step 9: master.conf automatically pushed to all listed hosts on onboard completion
31	- Graceful pre-onboard state: neutral banners instead of error warnings before SSH is configured
32	- GitHub link in tab bar and Settings page; Community Apps support URL
33
34	###2026.05.28
35	- Initial release: Monitor, Scheduler, Docker, Watchdog, Partnership, Fallback, Arrs tabs
36	- Mutual container fallback with tiered escalation and strike-confirmed handback
37	- Partnership lifecycle: onboard, offboard, transfer
38	- Rsync profile system with per-share container stops and writeback
39	- Watchdog: Tier 1 (explicit) + Tier 2 (global scan) container monitoring
40	- master.conf push-on-save to all configured partners via SSH
41	</CHANGES>
42
43	<!--
44	  ── 1. Web files symlink (runs on every boot) ──────────────────────────────────
45	  Instead of extracting a .txz, we symlink the installed plugin web dir directly
46	  to the workspace on flash. Changes to Plugin/unraid/ are live instantly — no
47	  package build, no sync step. /boot is always mounted before this runs.
48	  ────────────────────────────────────────────────────────────────────────────────
49	-->
50	<FILE Run="/bin/bash">
51	<INLINE>
52	<![CDATA[
53	#!/bin/bash
54	WEB_DIR="/usr/local/emhttp/plugins/varaverk"
55	SRC="/boot/config/plugins/varaverk/Plugin/unraid"
56	[[ -L "$WEB_DIR" ]] && rm -f "$WEB_DIR"
57	[[ -d "$WEB_DIR" ]] && rm -rf "$WEB_DIR"
58	ln -sf "$SRC" "$WEB_DIR"
59	echo "[Varaverk] web dir symlinked → $SRC"
60	]]>
61	</INLINE>
62	</FILE>
63
64	<!--
65	  ── 2. Scripts bootstrap (first install only) ──────────────────────────────────
66	  Clones the repo directly into the plugin config dir on flash (/boot/config/plugins/varaverk).
67	  No array dependency — scripts live on flash (64GB NVMe) and are available at boot.
68	  Uses git init+fetch+reset so the clone works into the non-empty cfgdir (varaverk.cfg,
69	  varaverk-*.txz etc. are already there). Never auto-pulls — updates via the UI git pull.
70
71	  Clone source priority:
72	    1. Gitea (internal) — reads settings from varaverk.cfg; detects container IP at runtime
73	    2. GitHub (public)  — HTTPS fallback if Gitea is unreachable
74	  ────────────────────────────────────────────────────────────────────────────────
75	-->
76	<FILE Run="/bin/bash" Method="install">
77	<INLINE>
78	<![CDATA[
79	#!/bin/bash
80	PLUGIN="varaverk"
81	CFG_DIR="/boot/config/plugins/$PLUGIN"
82	CFG_FILE="$CFG_DIR/varaverk.cfg"
83	GITHUB="https://github.com/FailedProxy/Varaverk"
84	BRANCH="main"
85	LOG="$CFG_DIR/install.log"
86
87	mkdir -p "$CFG_DIR"
88	log() { echo "[$(date '+%H:%M:%S')] $*" | tee -a "$LOG"; }
89
90	# Scripts live in the plugin dir on flash — no array needed.
91	SCRIPTS_DIR="$CFG_DIR"
92	CONF_DIR="$SCRIPTS_DIR/Configurations"
93
94	# ── Boot device check ─────────────────────────────────────────────────────────
95	# Warn if /boot is on a USB/removable device. Varaverk is designed for internal
96	# NVMe/SSD boot — git repo + state files + data writes on USB will wear it out
97	# fast and may run out of space. Install proceeds but user is warned.
98	_boot_dev=$(df /boot --output=source 2>/dev/null | tail -1)
99	_boot_base=$(lsblk -no pkname "$_boot_dev" 2>/dev/null || basename "${_boot_dev%[0-9p]*}")
100	_removable=$(cat "/sys/block/${_boot_base}/removable" 2>/dev/null || echo "0")
101	if [[ "$_removable" == "1" ]]; then
102	    log "WARNING: /boot is on a removable/USB device ($_boot_dev)"
103	    log "WARNING: Varaverk is designed for internal NVMe/SSD boot."
104	    log "WARNING: Running from USB risks drive wear and space exhaustion."
105	    log "WARNING: Strongly recommend migrating boot to an internal NVMe/SSD drive."
106	fi
107	unset _boot_dev _boot_base _removable
108
109	# Seed varaverk.cfg with defaults (SCRIPTS_DIR + Gitea settings) if not present.
110	# Requires internal NVMe/SSD boot — scripts live on flash, available before array mounts.
111	if [[ ! -f "$CFG_FILE" ]]; then
112	    cat > "$CFG_FILE" <<'CFGEOF'
113	SCRIPTS_DIR="/boot/config/plugins/varaverk"
114	GITEA_CONTAINER="Gitea"
115	GITEA_REPO_PATH="FailedProxy/Varaverk.git"
116	GITEA_SSH_KEY="/root/.ssh/unraid_gitea"
117	SSH_PORT="221"
118	CFGEOF
119	    log "seeded varaverk.cfg"
120	fi
121
122	# Read Gitea settings from varaverk.cfg (allows override without editing .plg).
123	_read_cfg() { grep -oP "(?<=^${1}=\")[^\"]*" "$CFG_FILE" 2>/dev/null || echo "${2}"; }
124	GITEA_CONTAINER=$(_read_cfg GITEA_CONTAINER "Gitea")
125	GITEA_REPO_PATH=$(_read_cfg GITEA_REPO_PATH "FailedProxy/Varaverk.git")
126	GITEA_SSH_KEY=$(_read_cfg   GITEA_SSH_KEY   "/root/.ssh/unraid_gitea")
127	SSH_PORT=$(_read_cfg        SSH_PORT        "221")
128
129	# Clone on first install only; never auto-pull (updates via the UI git pull).
130	if [[ ! -d "$SCRIPTS_DIR/.git" ]]; then
131	    log "initialising repo in $SCRIPTS_DIR ($BRANCH)..."
132
133	    # Locate Gitea: local container → local IP; else Tailscale; else fall back to GitHub.
134	    GITEA_IP=""
135	    if command -v docker >/dev/null 2>&1 && \
136	       docker ps --format "{{.Names}}" 2>/dev/null | grep -q "^${GITEA_CONTAINER}$"; then
137	        GITEA_IP=$(hostname -I | awk '{print $1}')
138	        log "Gitea running locally — using $GITEA_IP"
139	    elif command -v tailscale >/dev/null 2>&1; then
140	        # Try each known peer until we find one hosting Gitea
141	        while IFS= read -r peer_ip; do
142	            if ssh -i "$GITEA_SSH_KEY" -p "$SSH_PORT" \
143	                   -o ConnectTimeout=3 -o StrictHostKeyChecking=no \
144	                   -o BatchMode=yes "git@${peer_ip}" info 2>/dev/null | grep -q "varaverk\|Gitea\|gitea"; then
145	                GITEA_IP="$peer_ip"
146	                log "Gitea found on Tailscale peer $GITEA_IP"
147	                break
148	            fi
149	        done < <(tailscale status --json 2>/dev/null | \
150	                 python3 -c "import json,sys; d=json.load(sys.stdin); \
151	                 [print(v['TailscaleIPs'][0]) for v in d.get('Peer',{}).values() \
152	                  if v.get('TailscaleIPs')]" 2>/dev/null)
153	    fi
154
155	    # init-in-place — git clone would fail because the dir already has files.
156	    git -C "$SCRIPTS_DIR" init >> "$LOG" 2>&1
157
158	    CLONED=false
159	    if [[ -n "$GITEA_IP" && -f "$GITEA_SSH_KEY" ]]; then
160	        GITEA_URL="ssh://git@${GITEA_IP}:${SSH_PORT}/${GITEA_REPO_PATH}"
161	        log "trying Gitea: $GITEA_URL"
162	        git -C "$SCRIPTS_DIR" remote add origin "$GITEA_URL" >> "$LOG" 2>&1
163	        if GIT_SSH_COMMAND="ssh -i $GITEA_SSH_KEY -p $SSH_PORT -o StrictHostKeyChecking=no" \
164	           GIT_TERMINAL_PROMPT=0 \
165	           git -C "$SCRIPTS_DIR" fetch --depth=1 origin "$BRANCH" >> "$LOG" 2>&1; then
166	            git -C "$SCRIPTS_DIR" reset --hard FETCH_HEAD >> "$LOG" 2>&1
167	            git -C "$SCRIPTS_DIR" branch -M "$BRANCH" >> "$LOG" 2>&1
168	            git -C "$SCRIPTS_DIR" branch --set-upstream-to=origin/"$BRANCH" "$BRANCH" >> "$LOG" 2>&1
169	            log "scripts installed from Gitea ($GITEA_IP)"
170	            CLONED=true
171	        else
172	            log "Gitea fetch failed — falling back to GitHub"
173	            git -C "$SCRIPTS_DIR" remote remove origin >> "$LOG" 2>&1 || true
174	        fi
175	    fi
176
177	    if [[ "$CLONED" == false ]]; then
178	        log "trying GitHub: $GITHUB"
179	        git -C "$SCRIPTS_DIR" remote add origin "$GITHUB" >> "$LOG" 2>&1
180	        if GIT_TERMINAL_PROMPT=0 \
181	           git -C "$SCRIPTS_DIR" fetch --depth=1 origin "$BRANCH" >> "$LOG" 2>&1; then
182	            git -C "$SCRIPTS_DIR" reset --hard FETCH_HEAD >> "$LOG" 2>&1
183	            git -C "$SCRIPTS_DIR" branch -M "$BRANCH" >> "$LOG" 2>&1
184	            git -C "$SCRIPTS_DIR" branch --set-upstream-to=origin/"$BRANCH" "$BRANCH" >> "$LOG" 2>&1
185	            log "scripts installed from GitHub"
186	            CLONED=true
187	        else
188	            log "WARNING: both Gitea and GitHub failed — scripts not installed, retry when network is up"
189	            exit 0
190	        fi
191	    fi
192	else
193	    log "repo present — leaving scripts untouched (update from the UI)"
194	fi
195
196	# Seed master.conf from template if absent.
197	mkdir -p "$CONF_DIR"
198	if [[ ! -f "$CONF_DIR/master.conf" && -f "$CONF_DIR/master.conf.template" ]]; then
199	    cp "$CONF_DIR/master.conf.template" "$CONF_DIR/master.conf"
200	    log "seeded master.conf from template"
201	fi
202	log "install step complete"
203	]]>
204	</INLINE>
205	</FILE>
206
207	<!--
208	  ── 3. Remove ───────────────────────────────────────────────────────────────────
209	  Stops background scripts, removes cron, the installed package, and flash config.
210	  Scripts/conf in appdata are left intact (delete manually for a full wipe).
211	  ────────────────────────────────────────────────────────────────────────────────
212	-->
213	<FILE Run="/bin/bash" Method="remove">
214	<INLINE>
215	<![CDATA[
216	#!/bin/bash
217	PLUGIN="varaverk"
218	CFG_DIR="/boot/config/plugins/$PLUGIN"
219	CFG_FILE="$CFG_DIR/varaverk.cfg"
220	CRON_FILE="$CFG_DIR/varaverk.cron"
221	WEB_DIR="/usr/local/emhttp/plugins/$PLUGIN"
222	log() { echo "[Varaverk remove] $*"; }
223
224	[[ -f "$CFG_FILE" ]] && _sd=$(grep -oP '(?<=SCRIPTS_DIR=")[^"]+' "$CFG_FILE" 2>/dev/null)
225	SCRIPTS_DIR="${_sd:-$CFG_DIR}"
226
227	# Stop continuous background scripts.
228	if [[ -f "$SCRIPTS_DIR/Fallback/fallback.sh" ]]; then
229	    bash "$SCRIPTS_DIR/Fallback/fallback.sh" --stop 2>/dev/null && log "fallback.sh stopped" || true
230	fi
231	pkill -f "run_job.sh" 2>/dev/null || true
232	pkill -f "watchdog_orchestrator.sh" 2>/dev/null || true
233
234	# Remove cron entries.
235	if [[ -f "$CRON_FILE" ]]; then
236	    rm -f "$CRON_FILE"
237	    /usr/local/sbin/update_cron 2>/dev/null || true
238	    log "cron removed"
239	fi
240	rm -f /etc/cron.d/varaverk
241
242	# Remove the installed package (and its RAM files).
243	removepkg "$PLUGIN" 2>/dev/null || true
244	[[ -L "$WEB_DIR" ]] && rm -f "$WEB_DIR"
245	[[ -d "$WEB_DIR" ]] && rm -rf "$WEB_DIR"
246	log "web files removed"
247
248	# Remove flash config (incl. cached .txz).
249	rm -rf "$CFG_DIR"
250	log "flash config removed"
251	log "done — scripts/conf in $SCRIPTS_DIR preserved (delete manually for full wipe)"
252	]]>
253	</INLINE>
254	</FILE>
255
256	</PLUGIN>
257

<?xml version='1.0' standalone='yes'?>
<!DOCTYPE PLUGIN [
<!ENTITY name    "varaverk">
<!ENTITY author  "gmer4lfe">
<!ENTITY version "2026.05.31">
<!ENTITY sha256  "d588470d6cc7f284601cb56039d5dfea6fb5bb1ee2c800657438a8edacafbd01">
<!ENTITY launch  "varaverk/monitor">
<!ENTITY github  "https://github.com/FailedProxy/Varaverk">
<!ENTITY branch  "main">
<!ENTITY cfgdir  "/boot/config/plugins/varaverk">
<!ENTITY plugdir "/usr/local/emhttp/plugins/varaverk">
<!ENTITY pkg     "varaverk-&version;-noarch-1.txz">
]>
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;"
        support="https://github.com/FailedProxy/Varaverk/issues"
        icon="/plugins/varaverk/icons/varaverk.png">

<CHANGES>
###2026.05.31
- Packaged release: web files now ship as a .txz that Unraid reinstalls to RAM on every boot
- Survives reboots with zero manual steps (no symlink, no go script) — fixes plugin vanishing after OS upgrades
- Scripts are git-cloned to appdata on first install; web files stay on flash (~200KB)
- Updates handled in-UI (git pull); the plugin no longer pulls on every boot

###2026.05.30
- First-run setup wizard: auto-detects hostname, creates master.conf + host conf from templates
- Scheduler setup mode: after wizard, master.conf and host conf open sequentially with forced save flow
- Partnership tab: Onboard button highlighted on arrival from wizard; disabled until partner is configured
- HOST2 install paths: state-file pull, master.conf push detection, conf-only flow
- Onboard Step 9: master.conf automatically pushed to all listed hosts on onboard completion
- Graceful pre-onboard state: neutral banners instead of error warnings before SSH is configured
- GitHub link in tab bar and Settings page; Community Apps support URL

###2026.05.28
- Initial release: Monitor, Scheduler, Docker, Watchdog, Partnership, Fallback, Arrs tabs
- Mutual container fallback with tiered escalation and strike-confirmed handback
- Partnership lifecycle: onboard, offboard, transfer
- Rsync profile system with per-share container stops and writeback
- Watchdog: Tier 1 (explicit) + Tier 2 (global scan) container monitoring
- master.conf push-on-save to all configured partners via SSH
</CHANGES>

<!--
  ── 1. Web files symlink (runs on every boot) ──────────────────────────────────
  Instead of extracting a .txz, we symlink the installed plugin web dir directly
  to the workspace on flash. Changes to Plugin/unraid/ are live instantly — no
  package build, no sync step. /boot is always mounted before this runs.
  ────────────────────────────────────────────────────────────────────────────────
-->
<FILE Run="/bin/bash">
<INLINE>
<![CDATA[
#!/bin/bash
WEB_DIR="/usr/local/emhttp/plugins/varaverk"
SRC="/boot/config/plugins/varaverk/Plugin/unraid"
[[ -L "$WEB_DIR" ]] && rm -f "$WEB_DIR"
[[ -d "$WEB_DIR" ]] && rm -rf "$WEB_DIR"
ln -sf "$SRC" "$WEB_DIR"
echo "[Varaverk] web dir symlinked → $SRC"
]]>
</INLINE>
</FILE>

<!--
  ── 2. Scripts bootstrap (first install only) ──────────────────────────────────
  Clones the repo directly into the plugin config dir on flash (/boot/config/plugins/varaverk).
  No array dependency — scripts live on flash (64GB NVMe) and are available at boot.
  Uses git init+fetch+reset so the clone works into the non-empty cfgdir (varaverk.cfg,
  varaverk-*.txz etc. are already there). Never auto-pulls — updates via the UI git pull.

  Clone source priority:
    1. Gitea (internal) — reads settings from varaverk.cfg; detects container IP at runtime
    2. GitHub (public)  — HTTPS fallback if Gitea is unreachable
  ────────────────────────────────────────────────────────────────────────────────
-->
<FILE Run="/bin/bash" Method="install">
<INLINE>
<![CDATA[
#!/bin/bash
PLUGIN="varaverk"
CFG_DIR="/boot/config/plugins/$PLUGIN"
CFG_FILE="$CFG_DIR/varaverk.cfg"
GITHUB="https://github.com/FailedProxy/Varaverk"
BRANCH="main"
LOG="$CFG_DIR/install.log"

mkdir -p "$CFG_DIR"
log() { echo "[$(date '+%H:%M:%S')] $*" | tee -a "$LOG"; }

# Scripts live in the plugin dir on flash — no array needed.
SCRIPTS_DIR="$CFG_DIR"
CONF_DIR="$SCRIPTS_DIR/Configurations"

# ── Boot device check ─────────────────────────────────────────────────────────
# Warn if /boot is on a USB/removable device. Varaverk is designed for internal
# NVMe/SSD boot — git repo + state files + data writes on USB will wear it out
# fast and may run out of space. Install proceeds but user is warned.
_boot_dev=$(df /boot --output=source 2>/dev/null | tail -1)
_boot_base=$(lsblk -no pkname "$_boot_dev" 2>/dev/null || basename "${_boot_dev%[0-9p]*}")
_removable=$(cat "/sys/block/${_boot_base}/removable" 2>/dev/null || echo "0")
if [[ "$_removable" == "1" ]]; then
    log "WARNING: /boot is on a removable/USB device ($_boot_dev)"
    log "WARNING: Varaverk is designed for internal NVMe/SSD boot."
    log "WARNING: Running from USB risks drive wear and space exhaustion."
    log "WARNING: Strongly recommend migrating boot to an internal NVMe/SSD drive."
fi
unset _boot_dev _boot_base _removable

# Seed varaverk.cfg with defaults (SCRIPTS_DIR + Gitea settings) if not present.
# Requires internal NVMe/SSD boot — scripts live on flash, available before array mounts.
if [[ ! -f "$CFG_FILE" ]]; then
    cat > "$CFG_FILE" <<'CFGEOF'
SCRIPTS_DIR="/boot/config/plugins/varaverk"
GITEA_CONTAINER="Gitea"
GITEA_REPO_PATH="FailedProxy/Varaverk.git"
GITEA_SSH_KEY="/root/.ssh/unraid_gitea"
SSH_PORT="221"
CFGEOF
    log "seeded varaverk.cfg"
fi

# Read Gitea settings from varaverk.cfg (allows override without editing .plg).
_read_cfg() { grep -oP "(?<=^${1}=\")[^\"]*" "$CFG_FILE" 2>/dev/null || echo "${2}"; }
GITEA_CONTAINER=$(_read_cfg GITEA_CONTAINER "Gitea")
GITEA_REPO_PATH=$(_read_cfg GITEA_REPO_PATH "FailedProxy/Varaverk.git")
GITEA_SSH_KEY=$(_read_cfg   GITEA_SSH_KEY   "/root/.ssh/unraid_gitea")
SSH_PORT=$(_read_cfg        SSH_PORT        "221")

# Clone on first install only; never auto-pull (updates via the UI git pull).
if [[ ! -d "$SCRIPTS_DIR/.git" ]]; then
    log "initialising repo in $SCRIPTS_DIR ($BRANCH)..."

    # Locate Gitea: local container → local IP; else Tailscale; else fall back to GitHub.
    GITEA_IP=""
    if command -v docker >/dev/null 2>&1 && \
       docker ps --format "{{.Names}}" 2>/dev/null | grep -q "^${GITEA_CONTAINER}$"; then
        GITEA_IP=$(hostname -I | awk '{print $1}')
        log "Gitea running locally — using $GITEA_IP"
    elif command -v tailscale >/dev/null 2>&1; then
        # Try each known peer until we find one hosting Gitea
        while IFS= read -r peer_ip; do
            if ssh -i "$GITEA_SSH_KEY" -p "$SSH_PORT" \
                   -o ConnectTimeout=3 -o StrictHostKeyChecking=no \
                   -o BatchMode=yes "git@${peer_ip}" info 2>/dev/null | grep -q "varaverk\|Gitea\|gitea"; then
                GITEA_IP="$peer_ip"
                log "Gitea found on Tailscale peer $GITEA_IP"
                break
            fi
        done < <(tailscale status --json 2>/dev/null | \
                 python3 -c "import json,sys; d=json.load(sys.stdin); \
                 [print(v['TailscaleIPs'][0]) for v in d.get('Peer',{}).values() \
                  if v.get('TailscaleIPs')]" 2>/dev/null)
    fi

    # init-in-place — git clone would fail because the dir already has files.
    git -C "$SCRIPTS_DIR" init >> "$LOG" 2>&1

    CLONED=false
    if [[ -n "$GITEA_IP" && -f "$GITEA_SSH_KEY" ]]; then
        GITEA_URL="ssh://git@${GITEA_IP}:${SSH_PORT}/${GITEA_REPO_PATH}"
        log "trying Gitea: $GITEA_URL"
        git -C "$SCRIPTS_DIR" remote add origin "$GITEA_URL" >> "$LOG" 2>&1
        if GIT_SSH_COMMAND="ssh -i $GITEA_SSH_KEY -p $SSH_PORT -o StrictHostKeyChecking=no" \
           GIT_TERMINAL_PROMPT=0 \
           git -C "$SCRIPTS_DIR" fetch --depth=1 origin "$BRANCH" >> "$LOG" 2>&1; then
            git -C "$SCRIPTS_DIR" reset --hard FETCH_HEAD >> "$LOG" 2>&1
            git -C "$SCRIPTS_DIR" branch -M "$BRANCH" >> "$LOG" 2>&1
            git -C "$SCRIPTS_DIR" branch --set-upstream-to=origin/"$BRANCH" "$BRANCH" >> "$LOG" 2>&1
            log "scripts installed from Gitea ($GITEA_IP)"
            CLONED=true
        else
            log "Gitea fetch failed — falling back to GitHub"
            git -C "$SCRIPTS_DIR" remote remove origin >> "$LOG" 2>&1 || true
        fi
    fi

    if [[ "$CLONED" == false ]]; then
        log "trying GitHub: $GITHUB"
        git -C "$SCRIPTS_DIR" remote add origin "$GITHUB" >> "$LOG" 2>&1
        if GIT_TERMINAL_PROMPT=0 \
           git -C "$SCRIPTS_DIR" fetch --depth=1 origin "$BRANCH" >> "$LOG" 2>&1; then
            git -C "$SCRIPTS_DIR" reset --hard FETCH_HEAD >> "$LOG" 2>&1
            git -C "$SCRIPTS_DIR" branch -M "$BRANCH" >> "$LOG" 2>&1
            git -C "$SCRIPTS_DIR" branch --set-upstream-to=origin/"$BRANCH" "$BRANCH" >> "$LOG" 2>&1
            log "scripts installed from GitHub"
            CLONED=true
        else
            log "WARNING: both Gitea and GitHub failed — scripts not installed, retry when network is up"
            exit 0
        fi
    fi
else
    log "repo present — leaving scripts untouched (update from the UI)"
fi

# Seed master.conf from template if absent.
mkdir -p "$CONF_DIR"
if [[ ! -f "$CONF_DIR/master.conf" && -f "$CONF_DIR/master.conf.template" ]]; then
    cp "$CONF_DIR/master.conf.template" "$CONF_DIR/master.conf"
    log "seeded master.conf from template"
fi
log "install step complete"
]]>
</INLINE>
</FILE>

<!--
  ── 3. Remove ───────────────────────────────────────────────────────────────────
  Stops background scripts, removes cron, the installed package, and flash config.
  Scripts/conf in appdata are left intact (delete manually for a full wipe).
  ────────────────────────────────────────────────────────────────────────────────
-->
<FILE Run="/bin/bash" Method="remove">
<INLINE>
<![CDATA[
#!/bin/bash
PLUGIN="varaverk"
CFG_DIR="/boot/config/plugins/$PLUGIN"
CFG_FILE="$CFG_DIR/varaverk.cfg"
CRON_FILE="$CFG_DIR/varaverk.cron"
WEB_DIR="/usr/local/emhttp/plugins/$PLUGIN"
log() { echo "[Varaverk remove] $*"; }

[[ -f "$CFG_FILE" ]] && _sd=$(grep -oP '(?<=SCRIPTS_DIR=")[^"]+' "$CFG_FILE" 2>/dev/null)
SCRIPTS_DIR="${_sd:-$CFG_DIR}"

# Stop continuous background scripts.
if [[ -f "$SCRIPTS_DIR/Fallback/fallback.sh" ]]; then
    bash "$SCRIPTS_DIR/Fallback/fallback.sh" --stop 2>/dev/null && log "fallback.sh stopped" || true
fi
pkill -f "run_job.sh" 2>/dev/null || true
pkill -f "watchdog_orchestrator.sh" 2>/dev/null || true

# Remove cron entries.
if [[ -f "$CRON_FILE" ]]; then
    rm -f "$CRON_FILE"
    /usr/local/sbin/update_cron 2>/dev/null || true
    log "cron removed"
fi
rm -f /etc/cron.d/varaverk

# Remove the installed package (and its RAM files).
removepkg "$PLUGIN" 2>/dev/null || true
[[ -L "$WEB_DIR" ]] && rm -f "$WEB_DIR"
[[ -d "$WEB_DIR" ]] && rm -rf "$WEB_DIR"
log "web files removed"

# Remove flash config (incl. cached .txz).
rm -rf "$CFG_DIR"
log "flash config removed"
log "done — scripts/conf in $SCRIPTS_DIR preserved (delete manually for full wipe)"
]]>
</INLINE>
</FILE>

</PLUGIN>


Bash

cat /boot/config/plugins/varaverk/varaverk.cfg && echo "---" && df /boot --output=source,target 2>/dev/null

Check varaverk.cfg SCRIPTS_DIR and boot device


SCRIPTS_DIR="/boot/config/plugins/varaverk"
GITEA_CONTAINER="Gitea"
GITEA_REPO_PATH="FailedProxy/Varaverk.git"
GITEA_SSH_KEY="/root/.ssh/unraid_gitea"
SSH_PORT="221"
---
Filesystem     Mounted on
flash/boot     /boot


check /plugin/varaverk check host.conf and master.conf . make sure varaverk is running from boot not appdata


ls /mnt/user/appdata/Varaverk 2>/dev/null || echo "no appdata/Varaverk dir" && ls /mnt/user/appdata/varaverk 2>/dev/null || echo "no appdata/varaverk dir"

Check for any appdata Varaverk directory


no appdata/Varaverk dir
no appdata/varaverk dir


Everything checks out. Here's the full picture:

**All running from boot — nothing in appdata:**

| Component | Path | Status |
|---|---|---|
| Scripts | `/boot/config/plugins/varaverk` | ✓ boot |
| Web files | symlink → `/boot/.../Plugin/unraid` | ✓ boot |
| `varaverk.cfg` `SCRIPTS_DIR` | `/boot/config/plugins/varaverk` | ✓ boot |
| `DATA_DIR` | `/boot/config/plugins/varaverk/data` | ✓ boot |
| `STATE_DIR` | `/boot/config/plugins/varaverk/State_Files` | ✓ boot |
| Claude data | `/boot/config/plugins/varaverk/claude-data` | ✓ boot |
| Claude binary | `/boot/config/plugins/varaverk/claude-bin` | ✓ boot |
| `HOST1_STORAGE_MODE_INTERNAL` | `true` | ✓ |
| appdata/Varaverk | doesn't exist | ✓ clean |

**One thing to be aware of:** `/boot` is still on USB flash (`flash/boot`) — the standard Unraid setup. `STORAGE_MODE_INTERNAL=true` was designed for systems with boot on an internal NVMe/SSD. Running git operations and writing logs/data to flash will cause wear over time. The `.plg` even logs a warning about this at install time.

If you haven't migrated boot to an internal drive, that's worth doing eventually — but it doesn't affect current functionality, everything is running correctly from where you want it.

Also minor: the `###2026.05.31` CHANGES entry in the `.plg` says "Scripts are git-cloned to appdata on first install" — that comment is stale/wrong, the actual code clones to `/boot`. Worth fixing if you do another package build.


save exactly where we are for when i get back


I'll update the memory files to capture exactly where we are.


1	---
2	name: project_varaverk
3	description: Varaverk — self-healing mutually-redundant two-server Unraid home media ecosystem
4	metadata:
5	  node_type: memory
6	  type: project
7	  originSessionId: ffec43cd-13e3-4911-878f-40459f7d16a9
8	---
9
10	**Varaverk** is a complete self-healing, self-maintaining, mutually-redundant two-server home server ecosystem. One codebase runs on both servers. No primary/standby — both servers run independently and cover each other when one goes down.
11
12	## The Two Servers
13
14	**HOST1 — unRAID-Gmer4Lfe**
15	- Hardware: Threadripper 1950X, 128GB RAM, ZFS cache pools
16	- Location: Primary site
17	- Domain: Gmer4Lfe.com
18	- Runs: Arrs (Movies, TV, Music), Auth stack (source of truth), Emby (primary)
19
20	**HOST2 — unRAID-Jayred365**
21	- Hardware: Intel i5 10th gen, 64GB RAM
22	- Location: Remote — different building, different power utility
23	- Domain: Gmer4Lfe.us
24
25	## Architecture
26	- Platform adapter layer (Plugin/unraid/adapter.sh) isolates OS-specific calls — scripts never branch on OS
27	- Self-healing, not enterprise HA — goal is minimal media stack disruption
28	- Tailscale for mesh networking between hosts
29
30	## Active To-Dos (from Notes_To-Do.md)
31	- Fix fallback strike list timing: ~30s first, ~90s for 3-strike trigger — needs testing
32	- Verify silent toggle switches back on good notifications
33	- Rename folder Unraid_Scripts → Varaverk everywhere, update git script, all traces/scripts
34
35	## Future Design Ideas
36	- Shared auth stack for partner hosts to start shared services
37	- When owner offboards with 2+ servers: auto-promote strongest server (by compute + bandwidth)
38	- Overall setup script that pulls vars automatically (docker names, etc.)
39	- App layer as king: no more direct git — app opens/edits settings, partnership deploys to servers, pushes correct host.conf
40	- Web UI: on initial launch with no state file, open master.conf; lock orchs until setup complete
41	- First-launch guide: owner sets up master.conf → host1.conf → Tailscale shares → onboard → host2/3 install and see state file, default to mirror mode
42
43	**Why:** User is building this as a personal project on Unraid. Design philosophy favors simplicity and independence over enterprise tooling.
44	**How to apply:** Understand the two-server mesh model when suggesting architecture. The app layer / web UI direction is the current strategic focus — moving away from raw git/scripts toward a proper application.
45

---
name: project_varaverk
description: Varaverk — self-healing mutually-redundant two-server Unraid home media ecosystem
metadata:
  node_type: memory
  type: project
  originSessionId: ffec43cd-13e3-4911-878f-40459f7d16a9
---

**Varaverk** is a complete self-healing, self-maintaining, mutually-redundant two-server home server ecosystem. One codebase runs on both servers. No primary/standby — both servers run independently and cover each other when one goes down.

## The Two Servers

**HOST1 — unRAID-Gmer4Lfe**
- Hardware: Threadripper 1950X, 128GB RAM, ZFS cache pools
- Location: Primary site
- Domain: Gmer4Lfe.com
- Runs: Arrs (Movies, TV, Music), Auth stack (source of truth), Emby (primary)

**HOST2 — unRAID-Jayred365**
- Hardware: Intel i5 10th gen, 64GB RAM
- Location: Remote — different building, different power utility
- Domain: Gmer4Lfe.us

## Architecture
- Platform adapter layer (Plugin/unraid/adapter.sh) isolates OS-specific calls — scripts never branch on OS
- Self-healing, not enterprise HA — goal is minimal media stack disruption
- Tailscale for mesh networking between hosts

## Active To-Dos (from Notes_To-Do.md)
- Fix fallback strike list timing: ~30s first, ~90s for 3-strike trigger — needs testing
- Verify silent toggle switches back on good notifications
- Rename folder Unraid_Scripts → Varaverk everywhere, update git script, all traces/scripts

## Future Design Ideas
- Shared auth stack for partner hosts to start shared services
- When owner offboards with 2+ servers: auto-promote strongest server (by compute + bandwidth)
- Overall setup script that pulls vars automatically (docker names, etc.)
- App layer as king: no more direct git — app opens/edits settings, partnership deploys to servers, pushes correct host.conf
- Web UI: on initial launch with no state file, open master.conf; lock orchs until setup complete
- First-launch guide: owner sets up master.conf → host1.conf → Tailscale shares → onboard → host2/3 install and see state file, default to mirror mode

**Why:** User is building this as a personal project on Unraid. Design philosophy favors simplicity and independence over enterprise tooling.
**How to apply:** Understand the two-server mesh model when suggesting architecture. The app layer / web UI direction is the current strategic focus — moving away from raw git/scripts toward a proper application.


1	---
2	name: workspace
3	description: Primary workspace location and important paths
4	metadata:
5	  node_type: memory
6	  type: project
7	  originSessionId: ffec43cd-13e3-4911-878f-40459f7d16a9
8	---
9
10	Primary workspace: /root
11
12	Plugin source: /boot/config/plugins/varaverk  (on Unraid USB — persists across reboots)
13
14	Key files:
15	- /boot/config/plugins/varaverk/Notes_To-Do.md — running notes and design ideas
16	- /boot/config/plugins/varaverk/README.md — full project documentation
17	- /boot/config/plugins/varaverk/Manual.md — manual
18	- /boot/config/plugins/varaverk/common.sh — shared library
19	- /boot/config/plugins/varaverk/schedule.json — scheduling config
20	- /boot/config/plugins/varaverk/varaverk.cron — cron config
21
22	**Why:** /boot is the Unraid USB drive and survives reboots/reinstalls. /root does not persist without explicit setup.
23	**How to apply:** Always look at /boot/config/plugins/varaverk for the authoritative source. Notes and docs there survive power outages.
24

---
name: workspace
description: Primary workspace location and important paths
metadata:
  node_type: memory
  type: project
  originSessionId: ffec43cd-13e3-4911-878f-40459f7d16a9
---

Primary workspace: /root

Plugin source: /boot/config/plugins/varaverk  (on Unraid USB — persists across reboots)

Key files:
- /boot/config/plugins/varaverk/Notes_To-Do.md — running notes and design ideas
- /boot/config/plugins/varaverk/README.md — full project documentation
- /boot/config/plugins/varaverk/Manual.md — manual
- /boot/config/plugins/varaverk/common.sh — shared library
- /boot/config/plugins/varaverk/schedule.json — scheduling config
- /boot/config/plugins/varaverk/varaverk.cron — cron config

**Why:** /boot is the Unraid USB drive and survives reboots/reinstalls. /root does not persist without explicit setup.
**How to apply:** Always look at /boot/config/plugins/varaverk for the authoritative source. Notes and docs there survive power outages.


Edit

---
name: workspace
description: Primary workspace location and important paths
metadata:
  node_type: memory
  type: project
  originSessionId: ffec43cd-13e3-4911-878f-40459f7d16a9
---

Primary workspace: /root

Plugin source: /boot/config/plugins/varaverk  (on Unraid USB — persists across reboots)

Key files:
- /boot/config/plugins/varaverk/Notes_To-Do.md — running notes and design ideas
- /boot/config/plugins/varaverk/README.md — full project documentation
- /boot/config/plugins/varaverk/Manual.md — manual
- /boot/config/plugins/varaverk/common.sh — shared library
- /boot/config/plugins/varaverk/schedule.json — scheduling config
- /boot/config/plugins/varaverk/varaverk.cron — cron config

**Why:** /boot is the Unraid USB drive and survives reboots/reinstalls. /root does not persist without explicit setup.
**How to apply:** Always look at /boot/config/plugins/varaverk for the authoritative source. Notes and docs there survive power outages.

---
name: workspace
description: Primary workspace location and important paths
metadata:
  type: project
---

Primary workspace: /root

Plugin source: /boot/config/plugins/varaverk  (on Unraid USB — persists across reboots)

Key files:
- /boot/config/plugins/varaverk/Notes_To-Do.md — running notes and design ideas
- /boot/config/plugins/varaverk/README.md — full project documentation
- /boot/config/plugins/varaverk/Manual.md — manual
- /boot/config/plugins/varaverk/common.sh — shared library
- /boot/config/plugins/varaverk/schedule.json — scheduling config
- /boot/config/plugins/varaverk/varaverk.cron — cron config

## Claude Code Persistent Storage (as of 2026-06-13)

claude_startup.sh runs at array start and re-creates these symlinks every boot:
- /root/.claude            → /boot/config/plugins/varaverk/claude-data/
- /root/.local/share/claude → /boot/config/plugins/varaverk/claude-bin/
- /root/.local/bin/claude  → /boot/config/plugins/varaverk/claude-bin/versions/2.1.177
- /root/CLAUDE.md          → /boot/config/plugins/varaverk/CLAUDE.md

Memory files live at: /boot/config/plugins/varaverk/claude-data/projects/-root/memory/

Old install data at /boot/config/claude and /boot/config/claude-bin has been fully migrated
into claude-data and claude-bin — those old dirs can be deleted when convenient.

HOST1_STORAGE_MODE_INTERNAL=true in host1.conf controls all of the above.

**Why:** /boot is the Unraid USB drive and survives reboots/reinstalls. /root does not persist without explicit setup.
**How to apply:** Always look at /boot/config/plugins/varaverk for the authoritative source. Notes and docs there survive power outages.


The file /root/.claude/projects/-root/memory/workspace.md has been updated successfully. (file state is current in your context — no need to Read it back)

---
name: workspace
description: Primary workspace location and important paths
metadata:
  node_type: memory
  type: project
  originSessionId: ffec43cd-13e3-4911-878f-40459f7d16a9
---

Primary workspace: /root

Plugin source: /boot/config/plugins/varaverk  (on Unraid USB — persists across reboots)

Key files:
- /boot/config/plugins/varaverk/Notes_To-Do.md — running notes and design ideas
- /boot/config/plugins/varaverk/README.md — full project documentation
- /boot/config/plugins/varaverk/Manual.md — manual
- /boot/config/plugins/varaverk/common.sh — shared library
- /boot/config/plugins/varaverk/schedule.json — scheduling config
- /boot/config/plugins/varaverk/varaverk.cron — cron config

**Why:** /boot is the Unraid USB drive and survives reboots/reinstalls. /root does not persist without explicit setup.
**How to apply:** Always look at /boot/config/plugins/varaverk for the authoritative source. Notes and docs there survive power outages.

---
name: workspace
description: Primary workspace location and important paths
metadata:
  type: project
---

Primary workspace: /root

Plugin source: /boot/config/plugins/varaverk  (on Unraid USB — persists across reboots)

Key files:
- /boot/config/plugins/varaverk/Notes_To-Do.md — running notes and design ideas
- /boot/config/plugins/varaverk/README.md — full project documentation
- /boot/config/plugins/varaverk/Manual.md — manual
- /boot/config/plugins/varaverk/common.sh — shared library
- /boot/config/plugins/varaverk/schedule.json — scheduling config
- /boot/config/plugins/varaverk/varaverk.cron — cron config

## Claude Code Persistent Storage (as of 2026-06-13)

claude_startup.sh runs at array start and re-creates these symlinks every boot:
- /root/.claude            → /boot/config/plugins/varaverk/claude-data/
- /root/.local/share/claude → /boot/config/plugins/varaverk/claude-bin/
- /root/.local/bin/claude  → /boot/config/plugins/varaverk/claude-bin/versions/2.1.177
- /root/CLAUDE.md          → /boot/config/plugins/varaverk/CLAUDE.md

Memory files live at: /boot/config/plugins/varaverk/claude-data/projects/-root/memory/

Old install data at /boot/config/claude and /boot/config/claude-bin has been fully migrated
into claude-data and claude-bin — those old dirs can be deleted when convenient.

HOST1_STORAGE_MODE_INTERNAL=true in host1.conf controls all of the above.

**Why:** /boot is the Unraid USB drive and survives reboots/reinstalls. /root does not persist without explicit setup.
**How to apply:** Always look at /boot/config/plugins/varaverk for the authoritative source. Notes and docs there survive power outages.

+## Claude Code Persistent Storage (as of 2026-06-13)

+claude_startup.sh runs at array start and re-creates these symlinks every boot:

+- /root/.claude            → /boot/config/plugins/varaverk/claude-data/

+- /root/.local/share/claude → /boot/config/plugins/varaverk/claude-bin/

+- /root/.local/bin/claude  → /boot/config/plugins/varaverk/claude-bin/versions/2.1.177

+- /root/CLAUDE.md          → /boot/config/plugins/varaverk/CLAUDE.md

+Memory files live at: /boot/config/plugins/varaverk/claude-data/projects/-root/memory/

+Old install data at /boot/config/claude and /boot/config/claude-bin has been fully migrated

+into claude-data and claude-bin — those old dirs can be deleted when convenient.

+HOST1_STORAGE_MODE_INTERNAL=true in host1.conf controls all of the above.


## Active To-Dos (from Notes_To-Do.md)
- Fix fallback strike list timing: ~30s first, ~90s for 3-strike trigger — needs testing
- Verify silent toggle switches back on good notifications
- Rename folder Unraid_Scripts → Varaverk everywhere, update git script, all traces/scripts

## Session State — 2026-06-13

**What was done this session:**
- New Claude Code install after a reinstall. Old data was at /boot/config/claude and /boot/config/claude-bin.
- Memory files restored from old install into current install.
- claude_startup.sh run manually — created claude-data and claude-bin dirs under /boot/config/plugins/varaverk/, migrated all data, symlinks confirmed working.
- Verified Varaverk is fully running from /boot — nothing in appdata. varaverk.cfg SCRIPTS_DIR, DATA_DIR, STATE_DIR, all point to /boot/config/plugins/varaverk.
- No code changes made — session was setup/verification only.

**Stale note in .plg:** The ###2026.05.31 CHANGES entry says "Scripts are git-cloned to appdata on first install" — this is wrong, the actual code clones to /boot/config/plugins/varaverk. Worth fixing on next package build.

**Flash wear note:** /boot is on USB flash (flash/boot). HOST1_STORAGE_MODE_INTERNAL=true was designed for NVMe/SSD boot. Git writes, logs, and claude data all land on flash — acceptable for now but worth migrating boot to NVMe eventually.

## Active To-Dos (from Notes_To-Do.md)
- Fix fallback strike list timing: ~30s first, ~90s for 3-strike trigger — needs testing
- Verify silent toggle switches back on good notifications
- Rename folder Unraid_Scripts → Varaverk everywhere, update git script, all traces/scripts
- Delete old /boot/config/claude and /boot/config/claude-bin dirs (migrated, no longer needed)


The file /root/.claude/projects/-root/memory/project_varaverk.md has been updated successfully. (file state is current in your context — no need to Read it back)

## Session State — 2026-06-13

**What was done this session:**
- New Claude Code install after a reinstall. Old data was at /boot/config/claude and /boot/config/claude-bin.
- Memory files restored from old install into current install.
- claude_startup.sh run manually — created claude-data and claude-bin dirs under /boot/config/plugins/varaverk/, migrated all data, symlinks confirmed working.
- Verified Varaverk is fully running from /boot — nothing in appdata. varaverk.cfg SCRIPTS_DIR, DATA_DIR, STATE_DIR, all point to /boot/config/plugins/varaverk.
- No code changes made — session was setup/verification only.

**Stale note in .plg:** The ###2026.05.31 CHANGES entry says "Scripts are git-cloned to appdata on first install" — this is wrong, the actual code clones to /boot/config/plugins/varaverk. Worth fixing on next package build.

**Flash wear note:** /boot is on USB flash (flash/boot). HOST1_STORAGE_MODE_INTERNAL=true was designed for NVMe/SSD boot. Git writes, logs, and claude data all land on flash — acceptable for now but worth migrating boot to NVMe eventually.

## Active To-Dos (from Notes_To-Do.md)
- Fix fallback strike list timing: ~30s first, ~90s for 3-strike trigger — needs testing
- Verify silent toggle switches back on good notifications
- Rename folder Unraid_Scripts → Varaverk everywhere, update git script, all traces/scripts
- Delete old /boot/config/claude and /boot/config/claude-bin dirs (migrated, no longer needed)

---
name: project_varaverk
description: Varaverk — self-healing mutually-redundant two-server Unraid home media ecosystem
metadata:
  node_type: memory
  type: project
  originSessionId: ffec43cd-13e3-4911-878f-40459f7d16a9
---

**Varaverk** is a complete self-healing, self-maintaining, mutually-redundant two-server home server ecosystem. One codebase runs on both servers. No primary/standby — both servers run independently and cover each other when one goes down.

## The Two Servers

**HOST1 — unRAID-Gmer4Lfe**
- Hardware: Threadripper 1950X, 128GB RAM, ZFS cache pools
- Location: Primary site
- Domain: Gmer4Lfe.com
- Runs: Arrs (Movies, TV, Music), Auth stack (source of truth), Emby (primary)

**HOST2 — unRAID-Jayred365**
- Hardware: Intel i5 10th gen, 64GB RAM
- Location: Remote — different building, different power utility
- Domain: Gmer4Lfe.us

## Architecture
- Platform adapter layer (Plugin/unraid/adapter.sh) isolates OS-specific calls — scripts never branch on OS
- Self-healing, not enterprise HA — goal is minimal media stack disruption
- Tailscale for mesh networking between hosts

## Active To-Dos (from Notes_To-Do.md)
- Fix fallback strike list timing: ~30s first, ~90s for 3-strike trigger — needs testing
- Verify silent toggle switches back on good notifications
- Rename folder Unraid_Scripts → Varaverk everywhere, update git script, all traces/scripts

## Future Design Ideas
- Shared auth stack for partner hosts to start shared services
- When owner offboards with 2+ servers: auto-promote strongest server (by compute + bandwidth)
- Overall setup script that pulls vars automatically (docker names, etc.)
- App layer as king: no more direct git — app opens/edits settings, partnership deploys to servers, pushes correct host.conf
- Web UI: on initial launch with no state file, open master.conf; lock orchs until setup complete
- First-launch guide: owner sets up master.conf → host1.conf → Tailscale shares → onboard → host2/3 install and see state file, default to mirror mode

**Why:** User is building this as a personal project on Unraid. Design philosophy favors simplicity and independence over enterprise tooling.
**How to apply:** Understand the two-server mesh model when suggesting architecture. The app layer / web UI direction is the current strategic focus — moving away from raw git/scripts toward a proper application.

+- New Claude Code install after a reinstall. Old data was at /boot/config/claude and /boot/config/claude-bin.

+- Memory files restored from old install into current install.

+- claude_startup.sh run manually — created claude-data and claude-bin dirs under /boot/config/plugins/varaverk/, migrated all data, symlinks confirmed working.

+- Verified Varaverk is fully running from /boot — nothing in appdata. varaverk.cfg SCRIPTS_DIR, DATA_DIR, STATE_DIR, all point to /boot/config/plugins/varaverk.

+- No code changes made — session was setup/verification only.

+**Stale note in .plg:** The ###2026.05.31 CHANGES entry says "Scripts are git-cloned to appdata on first install" — this is wrong, the actual code clones to /boot/config/plugins/varaverk. Worth fixing on next package build.

+**Flash wear note:** /boot is on USB flash (flash/boot). HOST1_STORAGE_MODE_INTERNAL=true was designed for NVMe/SSD boot. Git writes, logs, and claude data all land on flash — acceptable for now but worth migrating boot to NVMe eventually.

+- Delete old /boot/config/claude and /boot/config/claude-bin dirs (migrated, no longer needed)


Saved. When you come back, Claude will know:

- Claude Code setup is complete — `claude_startup.sh` is working, data persists at `claude-data/` and `claude-bin/` under the workspace on `/boot`
- Varaverk is confirmed running fully from boot, nothing in appdata
- Old dirs `/boot/config/claude` and `/boot/config/claude-bin` are migrated and can be deleted
- The stale comment in the `.plg` CHANGES section to fix on the next build
- The flash wear note about `STORAGE_MODE_INTERNAL=true` on a USB boot drive