Files
hassio-addons/claude_desktop/config.yaml
Alexandre 53ad396e5b fix(claude_desktop): sign-in persistence broke again — safeStorage patcher didn't handle bundles without a use-strict directive (#2983)
* fix(claude_desktop): patch safeStorage on bundles without a use-strict directive

The v1.37 safeStorage patcher only knew how to inject its plaintext-encryption
opt-in after a leading "use strict" directive in Claude Desktop's main bundle,
and refused to patch anything else. Confirmed live: Claude Desktop 1.30096.1's
main bundle no longer opens with that directive (bare IIFE instead), so the
patch has been silently refusing to run on every boot and sessions stopped
persisting across restarts again, with the same "Encryption not available"
warning documented in SIGN_IN.md before v1.37.

applyPatch() now falls back to prepending the opt-in as the bundle's first
statement when no directive is found, after skipping any leading BOM,
hashbang, or banner comment so a directive hidden behind a comment is still
protected rather than pushed out of position zero.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix(claude_desktop): scan the full directive prologue, not just line 0

Addresses two Codex review findings on PR #2983:

1. skipPrologue()'s //-comment scan only recognized "\n" as a line
   terminator. A comment ending in CR-only or U+2028/U+2029 (all valid
   ECMAScript LineTerminators) made it swallow the rest of the file as
   "still the comment", landing the patch after the bundle's last
   statement instead of before it. Reproduced with
   `// banner\r"use strict";(function(){})();`.

2. applyPatch() only checked whether the very first statement was
   literally "use strict". A directive prologue can hold more than one
   string-literal statement, and "use strict" only has to appear
   somewhere in it, not first; prepending ahead of an earlier directive
   pushed the whole prologue out of first-statement position and
   silently dropped strict mode. Reproduced with
   `"use custom";"use strict";(...)`.

Replaced the single-directive check with scanDirectivePrologue(), which
walks every leading string-literal-only statement and inserts right
after the full prologue (or at the same position when there is none).
skipPrologue/applyPatch split into skipBomAndHashbang +
skipWhitespaceAndComments + scanDirectivePrologue accordingly.

Verified: both findings reproduced against the pre-fix code and no
longer occur; 13-case regression suite covering the original edge cases
plus both findings all pass; re-run against the live production
app.asar still patches successfully and idempotently.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-17 18:31:20 +02:00

141 lines
3.4 KiB
YAML

arch:
- aarch64
- amd64
audio: true
description: "Claude Desktop with Headroom, RTK, and TokenSave optimization"
devices:
- /dev/dri
- /dev/dri/card0
- /dev/dri/card1
- /dev/dri/renderD128
- /dev/fuse
- /dev/kvm
- /dev/vhost-vsock
environment:
AUTO_GPU: "1"
FM_HOME: /data/data
HOME: /data/data
PGID: "1000"
PUID: "1000"
SELKIES_AUDIO_ENABLED: "false"
SELKIES_ENABLE_SHARING: "false"
SELKIES_FRAMERATE: "15"
SELKIES_GAMEPAD_ENABLED: "false"
SELKIES_MICROPHONE_ENABLED: "false"
SELKIES_SECOND_SCREEN: "false"
SELKIES_USE_BROWSER_CURSORS: "true"
START_DOCKER: "false"
TITLE: Claude Desktop
image: ghcr.io/alexbelgium/claude_desktop-{arch}
ingress: true
init: false
hassio_api: true
hassio_role: manager
homeassistant_api: true
auth_api: true
map:
- addon_config:rw
- share:rw
- media:rw
- ssl
name: Claude Desktop
options:
env_vars: []
DNS_server: 8.8.8.8
PGID: 1000
PUID: 1000
data_location: /data/data
additional_apps: ""
additional_pip: ""
github_email: ""
enable_ha_mcp: false
ha_mcp_url: http://homeassistant:8123/api/mcp
ha_mcp_token: ""
enable_ha_api_helper: true
github_token: ""
github_username: ""
enable_tools_health_report: true
expose_headroom_dashboard: false
headroom_auto_compress: true
headroom_wrap_claude_code: true
install_caveman: false
install_codex_cli: false
codex_sandbox_mode: workspace-write
install_github_cli: true
install_headroom: true
install_rtk: true
install_tokensave: true
mcp_servers_desktop:
- headroom
- tokensave
- homeassistant
- codex
mcp_servers_code:
- headroom
- tokensave
- homeassistant
- codex
permission_mode: auto
tokensave_project_paths: []
panel_admin: false
panel_icon: mdi:robot-happy
ports:
3001/tcp: null
8787/tcp: null
ports_description:
3001/tcp: Claude Desktop web interface
8787/tcp: Optional Headroom dashboard and proxy
privileged:
- SYS_ADMIN
- DAC_READ_SEARCH
schema:
env_vars:
- name: match(^[A-Za-z0-9_]+$)
value: str?
DNS_server: str?
data_location: str?
DRINODE: list(/dev/dri/card0|/dev/dri/card1|/dev/dri/card2|/dev/dri/renderD128|/dev/dri/renderD129|)?
KEYBOARD: list(da-dk-qwerty|de-de-qwertz|en-gb-qwerty|en-us-qwerty|es-es-qwerty|fr-ch-qwertz|fr-fr-azerty|it-it-qwerty|ja-jp-qwerty|pt-br-qwerty|sv-se-qwerty|tr-tr-qwerty)?
MAX_RES: match(^[1-9][0-9]{2,3}x[1-9][0-9]{2,3}$)?
PASSWORD: str?
PGID: int
PUID: int
TZ: match([A-Z][a-z]*./[A-Z][a-z]*.)?
additional_apps: str?
additional_pip: str?
cifsdomain: str?
cifspassword: str?
cifsusername: str?
localdisks: str?
networkdisks: str?
github_email: str?
enable_ha_mcp: bool?
ha_mcp_url: str?
ha_mcp_token: password?
enable_ha_api_helper: bool?
github_token: password?
github_username: str?
enable_tools_health_report: bool
expose_headroom_dashboard: bool
headroom_auto_compress: bool?
headroom_wrap_claude_code: bool
install_caveman: bool
install_codex_cli: bool
codex_sandbox_mode: list(read-only|workspace-write|danger-full-access)
install_github_cli: bool
install_headroom: bool
install_rtk: bool
install_tokensave: bool
mcp_servers_desktop:
- list(headroom|tokensave|homeassistant|codex)
mcp_servers_code:
- list(headroom|tokensave|homeassistant|codex)
permission_mode: list(strict|auto|bypass)
tokensave_project_paths:
- str
slug: claude_desktop
udev: true
url: https://github.com/alexbelgium/hassio-addons
version: "07308545.1"
video: true