feat(mcp): add auto-configuration for Home Assistant and enhance documentation

This commit is contained in:
techartdev
2026-03-10 21:12:21 +02:00
parent e6cad868ab
commit c6232b6f5d
12 changed files with 271 additions and 37 deletions
+28 -28
View File
@@ -30,33 +30,33 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
bat \
less \
openssl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Node.js 22 LTS from NodeSource (Debian Bookworm ships Node 18, but OpenClaw requires 20+)
# Use explicit keyring + apt source instead of setup_22.x pipe script for deterministic builds.
RUN mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
| gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& chmod 644 /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" \
&& chmod 644 /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" \
> /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends nodejs \
&& NODE_VERSION="$(node -v)" \
&& echo "$NODE_VERSION" \
&& echo "$NODE_VERSION" | grep -E '^v22\.' \
&& rm -f /etc/apt/sources.list.d/nodesource.list /etc/apt/keyrings/nodesource.gpg \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
&& apt-get update \
&& apt-get install -y --no-install-recommends nodejs \
&& NODE_VERSION="$(node -v)" \
&& echo "$NODE_VERSION" \
&& echo "$NODE_VERSION" | grep -E '^v22\.' \
&& rm -f /etc/apt/sources.list.d/nodesource.list /etc/apt/keyrings/nodesource.gpg \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install ttyd (web terminal) - not in Debian repos, download binary
# Docker TARGETARCH: amd64, arm64, arm/v7 → ttyd filenames: x86_64, aarch64, armhf
ARG TARGETARCH
RUN ARCH=$(echo ${TARGETARCH:-$(dpkg --print-architecture)} | sed 's|arm64|aarch64|;s|arm/v7|armhf|;s|armv7|armhf|;s|amd64|x86_64|') \
&& echo "Downloading ttyd for arch: ${ARCH}" \
&& curl -fsSL "https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.${ARCH}" -o /usr/local/bin/ttyd \
&& chmod +x /usr/local/bin/ttyd
&& echo "Downloading ttyd for arch: ${ARCH}" \
&& curl -fsSL "https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.${ARCH}" -o /usr/local/bin/ttyd \
&& chmod +x /usr/local/bin/ttyd
RUN node -v && npm -v
@@ -68,8 +68,8 @@ RUN npm install -g pnpm && pnpm -v
RUN apt-get update && apt-get install -y --no-install-recommends \
chromium \
chromium-driver \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Homebrew (Linuxbrew) for OpenClaw skill dependencies
# Homebrew is optional - some skills need CLI tools like gemini, aider, etc.
@@ -80,16 +80,16 @@ ENV HOMEBREW_NO_AUTO_UPDATE=1 \
HOMEBREW_NO_ANALYTICS=1
RUN useradd -m -s /bin/bash linuxbrew \
&& mkdir -p /home/linuxbrew/.linuxbrew \
&& chown -R linuxbrew:linuxbrew /home/linuxbrew
&& mkdir -p /home/linuxbrew/.linuxbrew \
&& chown -R linuxbrew:linuxbrew /home/linuxbrew
USER linuxbrew
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" || \
(echo "WARNING: Homebrew installation failed (likely unsupported CPU - requires SSSE3). Some skills may not work." && exit 0)
RUN if [ -d /home/linuxbrew/.linuxbrew/Homebrew ]; then \
cd /home/linuxbrew/.linuxbrew/Homebrew && \
git config --global --add safe.directory /home/linuxbrew/.linuxbrew/Homebrew && \
/home/linuxbrew/.linuxbrew/bin/brew update --force || true; \
cd /home/linuxbrew/.linuxbrew/Homebrew && \
git config --global --add safe.directory /home/linuxbrew/.linuxbrew/Homebrew && \
/home/linuxbrew/.linuxbrew/bin/brew update --force || true; \
fi
USER root
@@ -105,16 +105,16 @@ RUN chmod +x /usr/local/bin/brew
# Skip if brew installation failed
USER linuxbrew
RUN if [ -x /home/linuxbrew/.linuxbrew/bin/brew ]; then \
/home/linuxbrew/.linuxbrew/bin/brew --version && \
/home/linuxbrew/.linuxbrew/bin/brew install gcc || true; \
/home/linuxbrew/.linuxbrew/bin/brew --version && \
/home/linuxbrew/.linuxbrew/bin/brew install gcc || true; \
else \
echo "Skipping gcc installation - Homebrew not available"; \
echo "Skipping gcc installation - Homebrew not available"; \
fi
USER root
# Install OpenClaw globally
RUN npm config set fund false && npm config set audit false \
&& npm install -g openclaw@2026.3.7
&& npm install -g openclaw@2026.3.8
# Shell aliases and color options for interactive use
RUN tee -a /etc/bash.bashrc <<'EOF'
@@ -142,6 +142,6 @@ COPY openclaw-proxy-shim.cjs /usr/local/lib/openclaw-proxy-shim.cjs
COPY nginx.conf.tpl /etc/nginx/nginx.conf.tpl
COPY landing.html.tpl /etc/nginx/landing.html.tpl
RUN chmod +x /run.sh /oc_config_helper.py /render_nginx.py /usr/local/bin/oc-cleanup \
&& mkdir -p /run/nginx
&& mkdir -p /run/nginx
CMD [ "/run.sh" ]