Compare commits

..
3 Commits
Author SHA1 Message Date
Outis 24b62b7415 Merge pull request #426 from outis1one/claude/wolf-pair-port-conflict-7nz8qg
Claude/wolf pair port conflict 7nz8qg
2026-09-02 16:54:24 -04:00
Claude 52604b3ba6 Make app re-runs actually refresh a stale image/icon field
update_field() only ever got called for 'mounts' and 'env' when an app was
already present in config.toml, so the games-on-whales/desktop -> xfce
image-name fix from the previous commit would NOT have reached anyone who
already has a (broken) Desktop entry — re-running the installer or
./manage.sh apps would keep refreshing mounts/env but silently leave the
old, 404ing image reference in place forever.

update_field's own array-reformatting logic (scan forward for a closing
']') isn't safe to reuse for a single-line scalar field like image or
icon_png_path — there's no ']' on that line, so the scan would run into
an unrelated array further down the same block (e.g. 'ports = []') and
corrupt it. Added a separate update_scalar_field() that only ever
replaces the exact matched line, and wired it in for both 'image' and
'icon_png_path' in both copies of this app-injector script (install-time
and manage.sh's own 'apps' command) — verified locally against a
synthetic config.toml block that it replaces only the targeted app's own
fields and leaves a neighboring app's identically-named fields untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLX1yYKJExGSXmgUhxKQG6
2026-09-02 20:51:59 +00:00
Claude 3d9df0793a Fix Wolf Desktop app's image reference: xfce, not desktop
ghcr.io/games-on-whales/desktop never existed. Confirmed live: Wolf logged
"[DOCKER] error 404 - No such image: ghcr.io/games-on-whales/desktop:edge"
and silently returned to the Moonlight app list with no other visible
error, making the Desktop tile look like it just didn't launch. The
games-on-whales/gow repo's apps/ directory names this app "xfce", and
ghcr.io/games-on-whales/xfce:edge is the real, currently published image
(confirmed against GHCR's own tag list for that package) — the icon path
uses the same "xfce" naming.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLX1yYKJExGSXmgUhxKQG6
2026-09-02 20:49:32 +00:00
+78 -4
View File
@@ -1719,8 +1719,16 @@ CATALOG = {
),
'desktop': dict(
name='WolfDesktop', title='Desktop',
icon='https://games-on-whales.github.io/wildlife/apps/desktop/assets/icon.png',
image='ghcr.io/games-on-whales/desktop:edge',
# NOT "desktop" — ghcr.io/games-on-whales/desktop never existed.
# Confirmed live: Wolf logged "[DOCKER] error 404 - No such image:
# ghcr.io/games-on-whales/desktop:edge" and silently dropped back to
# the Moonlight app list with no other indication of failure. The
# games-on-whales/gow repo's apps/ directory names this app "xfce",
# and ghcr.io/games-on-whales/xfce:edge is the real, currently
# published image (confirmed against the GHCR package's own tag
# list). The icon path uses the same "xfce" naming.
icon='https://games-on-whales.github.io/wildlife/apps/xfce/assets/icon.png',
image='ghcr.io/games-on-whales/xfce:edge',
# Shares the SAME persistent home (.config/.local/share) and
# emulators/ -> ~/Applications mount as esde/retroarch below — a real
# XFCE multi-window session is a much more reliable place to run a
@@ -1812,6 +1820,33 @@ def update_field(lines, wolf_name, field, new_value):
return True
return False
def update_scalar_field(lines, wolf_name, field, new_value):
# Same block-bounding as update_field, but for a single-line scalar
# string field (image, icon_png_path) that Wolf never reformats across
# multiple lines. update_field's array logic (which scans forward
# hunting for a closing ']') isn't safe to reuse here — a scalar line
# has no ']' of its own and that scan would run off into an unrelated
# array field further down the same block (e.g. 'ports = []'),
# corrupting it. Confirmed needed live: a stale 'image' field (e.g. the
# games-on-whales/desktop -> xfce rename) was NOT refreshed by
# update_field, since only 'mounts'/'env' were ever passed to it — an
# already-installed app's broken image reference survived every
# reinstall/'./manage.sh apps' re-run until this was added.
for i, line in enumerate(lines):
if f"name = '{wolf_name}'" in line:
block_start = i
while block_start > 0 and lines[block_start].strip() != '[[profiles.apps]]':
block_start -= 1
block_end = i + 1
while block_end < len(lines) and lines[block_end].strip() not in ('[[profiles.apps]]', '[[profiles]]'):
block_end += 1
for j in range(block_start, block_end):
if lines[j].lstrip().startswith(field + " = '"):
indent = lines[j][:len(lines[j]) - len(lines[j].lstrip())]
lines[j] = f"{indent}{field} = '{new_value}'\n"
return True
return False
with open(cfg, 'r') as f:
lines = f.readlines()
@@ -1838,6 +1873,8 @@ for key in list(CATALOG.keys()):
if already:
ok = update_field(lines, wolf_name, 'mounts', new_mounts)
ok = update_field(lines, wolf_name, 'env', new_env) or ok
ok = update_scalar_field(lines, wolf_name, 'image', app['image']) or ok
ok = update_scalar_field(lines, wolf_name, 'icon_png_path', app['icon']) or ok
if ok:
updated.append(app['title'])
else:
@@ -3134,8 +3171,16 @@ CATALOG = {
),
'desktop': dict(
name='WolfDesktop', title='Desktop',
icon='https://games-on-whales.github.io/wildlife/apps/desktop/assets/icon.png',
image='ghcr.io/games-on-whales/desktop:edge',
# NOT "desktop" — ghcr.io/games-on-whales/desktop never existed.
# Confirmed live: Wolf logged "[DOCKER] error 404 - No such image:
# ghcr.io/games-on-whales/desktop:edge" and silently dropped back to
# the Moonlight app list with no other indication of failure. The
# games-on-whales/gow repo's apps/ directory names this app "xfce",
# and ghcr.io/games-on-whales/xfce:edge is the real, currently
# published image (confirmed against the GHCR package's own tag
# list). The icon path uses the same "xfce" naming.
icon='https://games-on-whales.github.io/wildlife/apps/xfce/assets/icon.png',
image='ghcr.io/games-on-whales/xfce:edge',
# Shares the SAME persistent home (.config/.local/share) and
# emulators/ -> ~/Applications mount as esde/retroarch below — a real
# XFCE multi-window session is a much more reliable place to run a
@@ -3228,6 +3273,33 @@ def update_field(lines, wolf_name, field, new_value):
return True
return False
def update_scalar_field(lines, wolf_name, field, new_value):
# Same block-bounding as update_field, but for a single-line scalar
# string field (image, icon_png_path) that Wolf never reformats across
# multiple lines. update_field's array logic (which scans forward
# hunting for a closing ']') isn't safe to reuse here — a scalar line
# has no ']' of its own and that scan would run off into an unrelated
# array field further down the same block (e.g. 'ports = []'),
# corrupting it. Confirmed needed live: a stale 'image' field (e.g. the
# games-on-whales/desktop -> xfce rename) was NOT refreshed by
# update_field, since only 'mounts'/'env' were ever passed to it — an
# already-installed app's broken image reference survived every
# './manage.sh apps' re-run until this was added.
for i, line in enumerate(lines):
if f"name = '{wolf_name}'" in line:
block_start = i
while block_start > 0 and lines[block_start].strip() != '[[profiles.apps]]':
block_start -= 1
block_end = i + 1
while block_end < len(lines) and lines[block_end].strip() not in ('[[profiles.apps]]', '[[profiles]]'):
block_end += 1
for j in range(block_start, block_end):
if lines[j].lstrip().startswith(field + " = '"):
indent = lines[j][:len(lines[j]) - len(lines[j].lstrip())]
lines[j] = f"{indent}{field} = '{new_value}'\n"
return True
return False
with open(cfg, 'r') as f:
lines = f.readlines()
@@ -3257,6 +3329,8 @@ for key in list(CATALOG.keys()): # preserve display order
if already:
ok = update_field(lines, wolf_name, 'mounts', new_mounts)
ok = update_field(lines, wolf_name, 'env', new_env) or ok
ok = update_scalar_field(lines, wolf_name, 'image', app['image']) or ok
ok = update_scalar_field(lines, wolf_name, 'icon_png_path', app['icon']) or ok
if ok:
updated.append(app['title'])
else: