mirror of
https://github.com/jmagar/unraid-mcp
synced 2026-04-21 13:37:53 +00:00
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)
This commit is contained in:
parent
a11049185f
commit
86bb5ac6f8
4 changed files with 11 additions and 25 deletions
|
|
@ -13,8 +13,7 @@ services:
|
|||
- ./backups:/app/backups
|
||||
- unraid-mcp-credentials:/home/mcp/.unraid-mcp
|
||||
networks:
|
||||
- default
|
||||
- unraid-mcp-external
|
||||
- jakenet
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
|
|
@ -37,7 +36,6 @@ volumes:
|
|||
unraid-mcp-credentials:
|
||||
|
||||
networks:
|
||||
default: {}
|
||||
unraid-mcp-external:
|
||||
jakenet:
|
||||
name: ${DOCKER_NETWORK:-jakenet}
|
||||
external: true
|
||||
name: ${DOCKER_NETWORK:-unraid-mcp-external}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ required_vars=(
|
|||
# UNRAID_MCP_BEARER_TOKEN is only required for HTTP-based transports with auth enabled
|
||||
_transport="${UNRAID_MCP_TRANSPORT:-streamable-http}"
|
||||
_disable_auth="${UNRAID_MCP_DISABLE_HTTP_AUTH:-false}"
|
||||
if [[ "$_transport" != "stdio" && "$_disable_auth" != "true" ]]; then
|
||||
if [[ "$_transport" != "stdio" && "$_disable_auth" != "true" && "$_disable_auth" != "1" && "$_disable_auth" != "yes" ]]; then
|
||||
required_vars+=(UNRAID_MCP_BEARER_TOKEN)
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -46,16 +46,12 @@ for pattern in "${REQUIRED[@]}"; do
|
|||
done
|
||||
|
||||
GITIGNORE_TMP="${GITIGNORE}.tmp.$$"
|
||||
printf '%s\n' "$existing" | awk '
|
||||
# Join REQUIRED with RS separator (|) — none of the patterns contain |
|
||||
_pat_list="$(IFS='|'; printf '%s' "${REQUIRED[*]}")"
|
||||
printf '%s\n' "$existing" | awk -v pat_list="$_pat_list" '
|
||||
BEGIN {
|
||||
want[".env"]=1
|
||||
want[".env.*"]=1
|
||||
want["!.env.example"]=1
|
||||
want["backups/*"]=1
|
||||
want["!backups/.gitkeep"]=1
|
||||
want["logs/*"]=1
|
||||
want["!logs/.gitkeep"]=1
|
||||
want["__pycache__/"]=1
|
||||
n_pat = split(pat_list, ordered, "|")
|
||||
for (i = 1; i <= n_pat; i++) want[ordered[i]] = 1
|
||||
}
|
||||
{ lines[++n]=$0 }
|
||||
END {
|
||||
|
|
@ -66,15 +62,7 @@ printf '%s\n' "$existing" | awk '
|
|||
emitted[lines[i]] = 1
|
||||
}
|
||||
}
|
||||
ordered[1]=".env"
|
||||
ordered[2]=".env.*"
|
||||
ordered[3]="!.env.example"
|
||||
ordered[4]="backups/*"
|
||||
ordered[5]="!backups/.gitkeep"
|
||||
ordered[6]="logs/*"
|
||||
ordered[7]="!logs/.gitkeep"
|
||||
ordered[8]="__pycache__/"
|
||||
for (i = 1; i <= 8; i++) {
|
||||
for (i = 1; i <= n_pat; i++) {
|
||||
if (!emitted[ordered[i]]) {
|
||||
print ordered[i]
|
||||
emitted[ordered[i]] = 1
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ done
|
|||
# Fail if bearer token is not set — do NOT auto-generate.
|
||||
# Auto-generated tokens cause a mismatch: the server reads the generated token
|
||||
# but Claude Code sends the (empty) userConfig value. Every MCP call returns 401.
|
||||
if ! grep -q "^UNRAID_MCP_BEARER_TOKEN=.\+" "$ENV_FILE" 2>/dev/null; then
|
||||
if ! grep -qE "^UNRAID_MCP_BEARER_TOKEN=.+" "$ENV_FILE" 2>/dev/null; then
|
||||
echo "sync-env: ERROR — UNRAID_MCP_BEARER_TOKEN is not set." >&2
|
||||
echo " Generate one: openssl rand -hex 32" >&2
|
||||
echo " Then paste it into the plugin's userConfig MCP token field." >&2
|
||||
|
|
|
|||
Loading…
Reference in a new issue