Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ Copy the token — you'll need it as the API key.
3. Configure:
- **API Key**: Paste your gateway token
- **Base URL**: `http://127.0.0.1:18789/v1` or a LAN url if you use `gateway_bind_mode: lan`
- **Api Version**: leave empty
- **API Version**: leave empty
- **Organization**: leave empty
- **Skip Authentication**: **true**

Expand Down
22 changes: 22 additions & 0 deletions openclaw_assistant/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
sudo \
vim \
nano \
fd-find \
ripgrep \
bat \
less \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -99,6 +103,24 @@ USER root
RUN npm config set fund false && npm config set audit false \
&& npm install -g openclaw@2026.2.9

# Shell aliases and color options for interactive use
RUN tee -a /etc/bash.bashrc <<'EOF'

# Aliases
alias bat="batcat"
alias fd="fdfind"

# Enable colors
alias ls="ls --color=auto"
alias grep="grep --color=auto"
alias egrep="grep -E --color=auto"
alias fgrep="grep -F --color=auto"
alias diff="diff --color=auto"
alias ip="ip --color=auto"
if [ -z "${LS_COLORS+x}" ]; then
export LS_COLORS="di=1;34:ln=1;36:so=1;pi=33:ex=1;32:bd=1;33:cd=1;33:su=1;31:sg=1;31:tw=1;34:ow=1;34"
fi
EOF
COPY run.sh /run.sh
COPY oc_config_helper.py /oc_config_helper.py
COPY nginx.conf.tpl /etc/nginx/nginx.conf.tpl
Expand Down
2 changes: 1 addition & 1 deletion openclaw_assistant/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: OpenClaw Assistant
version: "0.5.39"
version: "0.5.40"
slug: openclaw_assistant
description: Run OpenClaw Assistant (OpenClaw-compatible) as a Home Assistant add-on.
url: https://github.com/techartdev/OpenClawHomeAssistant
Expand Down
29 changes: 29 additions & 0 deletions openclaw_assistant/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,28 @@ fi

# Start ingress reverse proxy (nginx). This provides the add-on UI inside HA.
# Token is injected server-side; never put it in the browser URL.
NGINX_PID_FILE="/var/run/openclaw-nginx.pid"

# Clean up stale nginx process from previous run (e.g., after crash/unclean restart)
if [ -f "$NGINX_PID_FILE" ]; then
OLD_NGINX_PID=$(cat "$NGINX_PID_FILE" 2>/dev/null || echo "")
if [ -n "$OLD_NGINX_PID" ] && kill -0 "$OLD_NGINX_PID" 2>/dev/null; then
echo "Stopping previous nginx process (PID $OLD_NGINX_PID)..."
kill "$OLD_NGINX_PID" 2>/dev/null || true
sleep 1
kill -9 "$OLD_NGINX_PID" 2>/dev/null || true
fi
rm -f "$NGINX_PID_FILE"
fi
# Also kill any orphaned nginx workers that might hold port 8099
if command -v pkill >/dev/null 2>&1; then
pkill -f "nginx.*-c /etc/nginx/nginx.conf" 2>/dev/null || true
sleep 1
fi
# Verify port 8099 is actually free before proceeding
if command -v ss >/dev/null 2>&1 && ss -tlnp 2>/dev/null | grep -q ':8099 '; then
echo "WARN: Port 8099 still in use after cleanup; nginx may fail to start"
fi

# Render nginx config from template.
# The gateway token is NOT managed by the add-on; OpenClaw will generate/store it.
Expand Down Expand Up @@ -324,6 +346,13 @@ PY
echo "Starting ingress proxy (nginx) on :8099 ..."
nginx -g 'daemon off;' &
NGINX_PID=$!
sleep 1
if kill -0 "$NGINX_PID" 2>/dev/null; then
echo "$NGINX_PID" > "$NGINX_PID_FILE"
echo "nginx started with PID $NGINX_PID"
else
echo "WARN: nginx failed to start (PID $NGINX_PID exited); ingress UI may be unavailable"
fi

# Wait for gateway; if it exits, shut down others.
wait "${GW_PID}"