Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions .claude/skills/arr-stack-update/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ from container labels — never hardcode the paths, they have moved before.
Meleys and Vermithor both run a `sonarr`, a `radarr` and a `sabnzbd`. **Always name the host** — never
say "the sonarr container".

**Vhagar hosts two compose projects**, `jellyfin` and `raven` (`/volume1/docker/raven`, not part
of the media stack), so `vhagar` and `all` stop at discovery unless narrowed: run it as
`vhagar --services jellyfin`. Its docker sudo uses the stored keychain password, like Vermithor.
**Meleys and Vhagar both also run `raven`** (`/volume1/docker/raven`), its own compose project and
not part of the media stack. The script skips it through `OTHER_PROJECTS`; without that, the
one-project check stops both hosts at discovery. Vhagar's docker sudo uses the stored keychain
password, like Vermithor.

**Jellyfin's bind mounts are CIFS remote folders** (`/volume1/Vhagar/{Caraxes,Meleys,Syrax,Vermithor}`).
After a fleet-wide reboot (a DSM update) Vhagar mounts them before the other boxes serve SMB, the
Expand Down Expand Up @@ -99,10 +100,10 @@ Before ever passing `--include-stateful`:
- For Wizarr specifically, prefer the `wizarr-upgrade` skill, which judges whether a
given release is safe to take and knows the rollback shape.

`stripe-bridge`, `fleet-monitor` and `fleet-collector` are filtered out unconditionally.
They are built from this repo, `compose pull` has nothing to fetch for them, `deploy-nas`
owns their lifecycle, and on meleys they sit in a second compose project whose directory
would otherwise clobber the media project's.
`stripe-bridge`, `fleet-monitor` and `fleet-collector` are filtered out unconditionally, as
their whole `stripe-bridge` compose project is in `OTHER_PROJECTS`. They are built from this
repo, `compose pull` has nothing to fetch for them, `deploy-nas` owns their lifecycle, and on
meleys their project directory would otherwise clobber the media project's.

## Hard-Won Details (do not "simplify" these away)

Expand All @@ -126,9 +127,9 @@ would otherwise clobber the media project's.
if a label is empty. Do not "tidy" either back to tabs.
- **Meleys hosts two compose projects, not one.** `westeroz` is the media stack;
`stripe-bridge`, `fleet-monitor` and `fleet-collector` live in `/volume1/docker/stripe-bridge`,
are built from this repo rather than pulled, and belong to `deploy-nas`. All three are in
`NEVER`. They were not always, and the loop's last-wins `workdir` assignment then pointed
the pull at the wrong directory. The script now `die`s if the selected services span two
are built from this repo rather than pulled, and belong to `deploy-nas`. Their project is in
`OTHER_PROJECTS`, matched on the compose project label. It was not always, and the loop's
last-wins `workdir` assignment then pointed the pull at the wrong directory. The script now `die`s if the selected services span two
project dirs rather than guessing.
- **`sudo` needs the literal path `/usr/local/bin/docker`.** Docker is not on the
non-interactive `PATH`, so a plain `ssh host docker ps` returns `command not found`,
Expand Down
20 changes: 11 additions & 9 deletions .claude/skills/arr-stack-update/scripts/update-arr-stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ REPO="${WZ_REPO:-$(cd "$(dirname "$0")/../../../.." && pwd)}"
# project, discovered at runtime from container labels rather than hardcoded.
ALL_HOSTS="meleys vermithor vhagar"
STATEFUL="wizarr tautulli"
# Built from this repo, not pulled. compose pull has nothing to fetch for them,
# and they sit in a second compose project (/volume1/docker/stripe-bridge) whose
# dir would otherwise clobber the media project's. deploy-nas owns their lifecycle.
NEVER="stripe-bridge fleet-monitor fleet-collector"
# Compose projects that share a host with the media stack but are not it, matched
# on the project label so a container added to one needs no edit here.
# stripe-bridge (bridge, fleet monitor and collector, on Meleys) is built from this
# repo, so compose pull has nothing to fetch and deploy-nas owns it; raven (Meleys
# and Vhagar) is a separate app. Either one left in trips the one-project check.
OTHER_PROJECTS="stripe-bridge raven"

# A service is "up" if it answers at all — some *arr UIs 200, some redirect to a
# login, some 401. Only a connection failure or a 5xx means broken.
Expand Down Expand Up @@ -170,13 +172,13 @@ update_host() {
# no compose labels then yields svc="<image name>", which compose rejects with
# "no such service" and the whole pull aborts having fetched nothing. The label
# filter drops those containers at the source; '|' keeps the rest aligned anyway.
inventory="$(docker_on "$host" "ps -a --filter 'label=com.docker.compose.service' --format '{{.Names}}|{{.Label \"com.docker.compose.service\"}}|{{.Label \"com.docker.compose.project.working_dir\"}}|{{.Image}}|{{.Ports}}'")"
inventory="$(docker_on "$host" "ps -a --filter 'label=com.docker.compose.service' --format '{{.Names}}|{{.Label \"com.docker.compose.service\"}}|{{.Label \"com.docker.compose.project\"}}|{{.Label \"com.docker.compose.project.working_dir\"}}|{{.Image}}|{{.Ports}}'")"

names=(); services=(); images=(); ports=(); workdir=""
while IFS='|' read -r name svc dir image portspec; do
while IFS='|' read -r name svc project dir image portspec; do
[ -n "${svc:-}" ] && [ -n "${dir:-}" ] || continue
if in_list "$name" $NEVER; then
say " · skipping $svc (built from this repo — deploy-nas owns it)"
if in_list "${project:-}" $OTHER_PROJECTS; then
say " · skipping $svc (in the $project project, not the media stack)"
continue
fi
if [ -n "$ONLY_SERVICES" ]; then
Expand All @@ -188,7 +190,7 @@ update_host() {
# One compose project per run. Meleys really does host two, so a stray service
# from the other one would silently send the pull to the wrong directory.
if [ -n "$workdir" ] && [ "$dir" != "$workdir" ]; then
die "$host: selected services span two compose projects ($workdir and $dir). Narrow with --services, or add the other project's services to NEVER."
die "$host: selected services span two compose projects ($workdir and $dir). Narrow with --services, or add the other project to OTHER_PROJECTS."
fi
workdir="$dir"
port="$(printf '%s' "${portspec:-}" | sed -n 's/.*0\.0\.0\.0:\([0-9]*\)->.*/\1/p' | head -1)"
Expand Down
19 changes: 16 additions & 3 deletions apps/admin-portal/src/pages/Fleet/Fleet.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,24 @@
font-size: var(--font-size-sm);
}

/* Never more than three host columns: each track takes at least its share of a
three-wide row, so the six hosts land 3 by 2 rather than 5 and 1. Narrower than
three 18rem tracks it falls to two columns, then one, and min(100%, ...) keeps a
320px screen from scrolling sideways. */
$gridMaxColumns: 3;

.grid {
// min(100%, 18rem) keeps the track from demanding 18rem on a 320px screen,
// which is what would push the page into a sideways scroll.
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
grid-template-columns: repeat(
auto-fit,
minmax(
min(
100%,
max(18rem, calc((100% - #{$gridMaxColumns - 1} * var(--space-2)) / #{$gridMaxColumns}))
),
1fr
)
);
gap: var(--space-2);
padding: 0;
list-style: none;
Expand Down
Loading