Commit graph

10 commits

Author SHA1 Message Date
Jacob Magar
454f346036 chore: sync working tree updates 2026-04-15 19:13:31 -04:00
Jacob Magar
02251b3f9f fix(hooks): add if matcher to fix-env-perms — only fire on .env file changes 2026-04-05 19:40:02 -04:00
Jacob Magar
c768c53518 fix(hooks): add SessionStart sync-env hook to hooks.json
sync-env.sh existed but was never wired into hooks.json — credentials
were never synced from userConfig on session start.
2026-04-05 19:24:40 -04:00
Jacob Magar
34c4e98ddc chore(hooks): remove SessionStart sync-env hook
sync-env.sh was exiting 1 whenever UNRAID_MCP_BEARER_TOKEN was not
configured via plugin userConfig, causing startup hook errors every
session for users not using the plugin config flow.
2026-04-03 21:25:43 -04:00
Jacob Magar
86bb5ac6f8 fix: address remaining PR review comments
- docker-compose: align network default fallback (jakenet) so service
  reference matches the network name: key value
- entrypoint: match server-side boolean parsing for DISABLE_HTTP_AUTH
  (accept true/1/yes, consistent with settings.py)
- ensure-ignore-files: deduplicate pattern list by driving awk from
  the REQUIRED shell array via a | -separated -v argument
- sync-env: use grep -qE for ERE .+ instead of BRE .\+ (non-POSIX)
2026-04-01 02:03:15 -04:00
Jacob Magar
4df14505d1 fix: address remaining PR #16 review comments
- .codex-plugin/plugin.json: add interface.displayName field required by
  lint-plugin.sh validation check
- .env.example: fix dotenv-linter key ordering across all variable groups
  (MCP settings, safety flags, Docker vars all now alphabetically sorted)
- hooks/scripts/sync-env.sh: scope lock file to CLAUDE_PLUGIN_ROOT instead
  of global /tmp/ to avoid cross-repo lock contention
2026-04-01 01:28:59 -04:00
Jacob Magar
05c188be69 fix: address PR #16 review comments — config correctness and robustness
- entrypoint.sh: only require UNRAID_MCP_BEARER_TOKEN when transport is
  not stdio and HTTP auth is not disabled (fixes false startup failures)
- docker-compose.yaml: use fixed network key `unraid-mcp-external` with
  `name: ${DOCKER_NETWORK:-unraid-mcp-external}` to avoid compose errors
  when DOCKER_NETWORK differs from the declared network name
- docker-compose.yaml: make healthcheck transport-aware — skip HTTP probe
  when UNRAID_MCP_TRANSPORT=stdio to prevent false unhealthy status
- docs/unraid.subdomain.conf: fix proxy_pass port from 3000 to 6970
- .codex-plugin/plugin.json: fix MCP URL port from 3000 to 6970
- .env.example: reorder UNRAID_API_KEY before UNRAID_API_URL (alpha);
  correct UNRAID_MCP_BEARER_TOKEN comment — required conditionally not always
- hooks/scripts/ensure-ignore-files.sh: write .gitignore atomically via
  temp file + mv to prevent truncation on interrupted rewrite
- hooks/scripts/sync-env.sh: chmod 600 .env immediately after touch,
  before any early-exit paths that could leave secrets world-readable
2026-04-01 01:17:22 -04:00
Jacob Magar
c9b1dc5026 fix(hooks): align sync-env/ensure-ignore-files with plugin spec (cw1.1, ova)
- sync-env.sh: replace sed with awk for safe value replacement, add flock
  on /tmp/unraid-sync-env.lock, remove auto-token-generation (fail with
  clear error if UNRAID_MCP_BEARER_TOKEN not set)
- ensure-ignore-files.sh: rename from ensure-gitignore.sh, add --check mode
  that exits non-zero without modifying file (for CI/pre-commit use)
- hooks.json: update both references to new ensure-ignore-files.sh name
- docker-compose.yaml: add user PUID/PGID, external network, deploy.resources
  limits (1024M/1cpu), wget healthcheck, start_period=30s
- Dockerfile: install wget, use wget healthcheck, start_period=30s,
  add entrypoint.sh, ENTRYPOINT points to /entrypoint.sh
- entrypoint.sh: env validation (UNRAID_API_URL, UNRAID_API_KEY,
  UNRAID_MCP_BEARER_TOKEN) with exec for signal forwarding
- .env.example: add PUID, PGID, DOCKER_NETWORK, UNRAID_MCP_ALLOW_DESTRUCTIVE,
  UNRAID_MCP_ALLOW_YOLO; fix UNRAID_MCP_BEARER_TOKEN key name
2026-03-31 17:58:48 -04:00
Jacob Magar
ae55b5b7e0 feat: improve auth, server, subscriptions, tools, and add regression tests 2026-03-31 17:14:30 -04:00
Jacob Magar
edece9e205 fix(unraid-mcp-78s,92j,37t,696,6cr,4yz): P1/P2/P3 sweep — fix HealthMiddleware + signal handlers
- P1 (78s): _HEADERS is now an immutable tuple; content-length derived from
  len(_BODY) rather than a hardcoded magic number
- P1 (92j): Remove no-op SIGTERM/SIGINT handlers that swallowed signals without
  stopping the server; delegate shutdown to Uvicorn's built-in handlers
- P2 (37t): HealthMiddleware now only responds 200 to GET /health; all other
  methods fall through to the auth layer (returns 401)
- P2 (696): Extract _chmod_safe() helper; remove redundant second chmod block
  in ensure_token_exists()
- P3 (6cr): Reorder middleware — HealthMiddleware is now outermost so it
  intercepts /health before BearerAuth; removes the need for a bypass condition
  in BearerAuthMiddleware.__call__
- P3 (4yz): Add Scope/Receive/Send type hints to HealthMiddleware.__call__
2026-03-30 23:39:52 -04:00