Rename Moltbot/Clawdbot to OpenClaw; drop back-compat; bump add-on to 0.5.0
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
# Moltbot Assistant (Home Assistant Add-on)
|
# OpenClaw Assistant (Home Assistant Add-on)
|
||||||
|
|
||||||
This add-on runs a Moltbot Assistant instance on Home Assistant OS (Supervisor add-on).
|
This add-on runs a OpenClaw Assistant instance on Home Assistant OS (Supervisor add-on).
|
||||||
|
|
||||||
> Note: The upstream project has gone through renames. This add-on currently installs **OpenClaw** (the successor of Clawdbot) and also provides a `clawdbot` shim for backwards compatibility.
|
> Note: The upstream project has gone through renames. This add-on installs **OpenClaw**.
|
||||||
|
|
||||||
## What this add-on provides
|
## What this add-on provides
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ we open it directly using a user-provided public/base URL.
|
|||||||
1. Home Assistant → Settings → Add-ons → Add-on store
|
1. Home Assistant → Settings → Add-ons → Add-on store
|
||||||
2. Add repository URL:
|
2. Add repository URL:
|
||||||
- Add-on store → ⋮ → Repositories → paste the GitHub repo URL
|
- Add-on store → ⋮ → Repositories → paste the GitHub repo URL
|
||||||
3. Install **Moltbot Assistant**
|
3. Install **OpenClaw Assistant**
|
||||||
|
|
||||||
## Configuration overview
|
## Configuration overview
|
||||||
All configuration is done via the add-on UI (Options).
|
All configuration is done via the add-on UI (Options).
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# Moltbot Assistant – Home Assistant Add-on (Draft)
|
# OpenClaw Assistant – Home Assistant Add-on (Draft)
|
||||||
|
|
||||||
This repository contains a Home Assistant add-on that runs a **Moltbot Assistant** instance on **HAOS**.
|
This repository contains a Home Assistant add-on that runs an **OpenClaw Assistant** instance on **HAOS**.
|
||||||
|
|
||||||
Upstream note: the project has gone through renames. This add-on currently installs **OpenClaw** and keeps a `clawdbot` shim for backwards compatibility.
|
Upstream note: the project has gone through renames. This add-on installs **OpenClaw**.
|
||||||
|
|
||||||
## What you get
|
## What you get
|
||||||
- Always-on personal assistant running as a Supervisor-managed container
|
- Always-on personal assistant running as a Supervisor-managed container
|
||||||
@@ -18,7 +18,7 @@ Upstream note: the project has gone through renames. This add-on currently insta
|
|||||||
## Install (high level)
|
## Install (high level)
|
||||||
1. Add this repo in Home Assistant:
|
1. Add this repo in Home Assistant:
|
||||||
Settings → Add-ons → Add-on Store → ⋮ → Repositories
|
Settings → Add-ons → Add-on Store → ⋮ → Repositories
|
||||||
2. Install **Moltbot Assistant**
|
2. Install **OpenClaw Assistant**
|
||||||
3. Configure options (at minimum: Telegram bot token)
|
3. Configure options (at minimum: Telegram bot token)
|
||||||
|
|
||||||
## Setup / Docs
|
## Setup / Docs
|
||||||
@@ -28,7 +28,7 @@ See **DOCS.md** for the supported setups:
|
|||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
All configuration is done via the add-on UI.
|
All configuration is done via the add-on UI.
|
||||||
See the schema in `moltbot_assistant/config.yaml`.
|
See the schema in `openclaw_assistant/config.yaml`.
|
||||||
|
|
||||||
### Optional: Brave Search
|
### Optional: Brave Search
|
||||||
If you provide `brave_api_key`, the add-on exports `BRAVE_API_KEY` for the assistant’s web search tool.
|
If you provide `brave_api_key`, the add-on exports `BRAVE_API_KEY` for the assistant’s web search tool.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ ARG BUILD_FROM=ghcr.io/hassio-addons/base:14.0.2
|
|||||||
FROM ${BUILD_FROM}
|
FROM ${BUILD_FROM}
|
||||||
|
|
||||||
# Base image is Alpine (HA add-ons base). It may only provide Node 18.x.
|
# Base image is Alpine (HA add-ons base). It may only provide Node 18.x.
|
||||||
# Clawdbot requires Node 20+, so we install a Node 20 musl build directly.
|
# OpenClaw requires Node 20+, so we install a Node 20 musl build directly.
|
||||||
ARG NODE_VERSION=22.12.0
|
ARG NODE_VERSION=22.12.0
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
@@ -42,12 +42,9 @@ RUN set -eu; \
|
|||||||
libstdc++ libgcc libatomic; \
|
libstdc++ libgcc libatomic; \
|
||||||
/usr/local/bin/node -v; /usr/local/bin/npm -v
|
/usr/local/bin/node -v; /usr/local/bin/npm -v
|
||||||
|
|
||||||
# Install OpenClaw globally (successor of Clawdbot)
|
# Install OpenClaw globally
|
||||||
# We also provide a lightweight `clawdbot` shim for backwards compatibility.
|
|
||||||
RUN npm config set fund false && npm config set audit false \
|
RUN npm config set fund false && npm config set audit false \
|
||||||
&& npm install -g openclaw@2026.1.29 \
|
&& npm install -g openclaw@2026.1.29
|
||||||
&& printf '%s\n' '#!/usr/bin/env sh' 'exec openclaw "$@"' > /usr/local/bin/clawdbot \
|
|
||||||
&& chmod +x /usr/local/bin/clawdbot
|
|
||||||
|
|
||||||
COPY run.sh /run.sh
|
COPY run.sh /run.sh
|
||||||
COPY nginx.conf.tpl /etc/nginx/nginx.conf.tpl
|
COPY nginx.conf.tpl /etc/nginx/nginx.conf.tpl
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
name: Moltbot Assistant
|
name: OpenClaw Assistant
|
||||||
version: "0.4.8"
|
version: "0.5.0"
|
||||||
slug: moltbot_assistant
|
slug: openclaw_assistant
|
||||||
description: Run Moltbot Assistant (Clawdbot-compatible) as a Home Assistant add-on.
|
description: Run OpenClaw Assistant (OpenClaw-compatible) as a Home Assistant add-on.
|
||||||
url: https://github.com/techartdev/MoltBotHomeAssistant
|
url: https://github.com/techartdev/OpenClawHomeAssistant
|
||||||
arch:
|
arch:
|
||||||
- amd64
|
- amd64
|
||||||
startup: services
|
startup: services
|
||||||
@@ -15,7 +15,7 @@ host_network: true
|
|||||||
# Home Assistant Ingress (UI inside the add-on page)
|
# Home Assistant Ingress (UI inside the add-on page)
|
||||||
ingress: true
|
ingress: true
|
||||||
ingress_port: 8099
|
ingress_port: 8099
|
||||||
panel_title: Moltbot Assistant
|
panel_title: OpenClaw Assistant
|
||||||
panel_icon: mdi:robot
|
panel_icon: mdi:robot
|
||||||
|
|
||||||
map:
|
map:
|
||||||
@@ -43,7 +43,7 @@ options:
|
|||||||
# Example: "https://example.duckdns.org:12345" or "http://192.168.1.10:18789"
|
# Example: "https://example.duckdns.org:12345" or "http://192.168.1.10:18789"
|
||||||
gateway_public_url: ""
|
gateway_public_url: ""
|
||||||
|
|
||||||
# Run `clawdbot doctor --fix` on startup (useful after upgrades; slows restarts)
|
# Run `openclaw doctor --fix` on startup (useful after upgrades; slows restarts)
|
||||||
run_doctor_on_start: false
|
run_doctor_on_start: false
|
||||||
|
|
||||||
homeassistant_token: ""
|
homeassistant_token: ""
|
||||||
|
Before Width: | Height: | Size: 614 B After Width: | Height: | Size: 614 B |
|
Before Width: | Height: | Size: 614 B After Width: | Height: | Size: 614 B |
@@ -54,7 +54,7 @@ http {
|
|||||||
# (Nabu Casa, DuckDNS, LAN, etc.).
|
# (Nabu Casa, DuckDNS, LAN, etc.).
|
||||||
|
|
||||||
return 200 '<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
|
return 200 '<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>Moltbot Assistant</title>
|
<title>OpenClaw Assistant</title>
|
||||||
<style>
|
<style>
|
||||||
body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;margin:0;padding:16px;background:#0b0f14;color:#e6edf3}
|
body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;margin:0;padding:16px;background:#0b0f14;color:#e6edf3}
|
||||||
a,button{font:inherit}
|
a,button{font:inherit}
|
||||||
@@ -69,7 +69,7 @@ http {
|
|||||||
</style>
|
</style>
|
||||||
</head><body>
|
</head><body>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h2 style="margin:0 0 8px 0">Moltbot Assistant</h2>
|
<h2 style="margin:0 0 8px 0">OpenClaw Assistant</h2>
|
||||||
<div class="row" style="margin-bottom:6px">
|
<div class="row" style="margin-bottom:6px">
|
||||||
<a class="btn" href="__GATEWAY_PUBLIC_URL____GW_PUBLIC_URL_PATH__?token=__GATEWAY_TOKEN__" target="_blank" rel="noopener noreferrer">Open Gateway Web UI</a>
|
<a class="btn" href="__GATEWAY_PUBLIC_URL____GW_PUBLIC_URL_PATH__?token=__GATEWAY_TOKEN__" target="_blank" rel="noopener noreferrer">Open Gateway Web UI</a>
|
||||||
<a class="btn secondary" href="./terminal/" target="_self">Open Terminal (full page)</a>
|
<a class="btn secondary" href="./terminal/" target="_self">Open Terminal (full page)</a>
|
||||||
@@ -49,9 +49,9 @@ export TZ="$TZNAME"
|
|||||||
set +x
|
set +x
|
||||||
|
|
||||||
# HA add-ons mount persistent storage at /config (maps to /addon_configs/<slug> on the host).
|
# HA add-ons mount persistent storage at /config (maps to /addon_configs/<slug> on the host).
|
||||||
# Use /config as HOME so Clawdbot finds its auth store and config there.
|
# Use /config as HOME so OpenClaw finds its auth store and config there.
|
||||||
export HOME=/config
|
export HOME=/config
|
||||||
mkdir -p /config/.clawdbot /config/clawd /config/keys /config/secrets
|
mkdir -p /config/.openclaw /config/clawd /config/keys /config/secrets
|
||||||
|
|
||||||
# Back-compat: some docs/scripts assume /data; point it at /config.
|
# Back-compat: some docs/scripts assume /data; point it at /config.
|
||||||
if [ ! -e /data ]; then
|
if [ ! -e /data ]; then
|
||||||
@@ -59,12 +59,12 @@ if [ ! -e /data ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Ensure these exist so cleanup doesn't fail
|
# Ensure these exist so cleanup doesn't fail
|
||||||
mkdir -p /config/.clawdbot/agents/main/sessions || true
|
mkdir -p /config/.openclaw/agents/main/sessions || true
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# SINGLE-INSTANCE GUARD (prevents multiple gateway runs racing each other)
|
# SINGLE-INSTANCE GUARD (prevents multiple gateway runs racing each other)
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
STARTUP_LOCK="/config/.clawdbot/gateway.start.lock"
|
STARTUP_LOCK="/config/.openclaw/gateway.start.lock"
|
||||||
exec 9>"$STARTUP_LOCK"
|
exec 9>"$STARTUP_LOCK"
|
||||||
if ! flock -n 9; then
|
if ! flock -n 9; then
|
||||||
echo "ERROR: Another instance appears to be running (could not acquire $STARTUP_LOCK)."
|
echo "ERROR: Another instance appears to be running (could not acquire $STARTUP_LOCK)."
|
||||||
@@ -78,11 +78,11 @@ fi
|
|||||||
|
|
||||||
# Returns 0 if a gateway process appears to be running, else 1
|
# Returns 0 if a gateway process appears to be running, else 1
|
||||||
gateway_running() {
|
gateway_running() {
|
||||||
pgrep -f "clawdbot.*gateway.*run" >/dev/null 2>&1
|
pgrep -f "openclaw.*gateway.*run" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup_session_locks() {
|
cleanup_session_locks() {
|
||||||
local sessions_dir="/config/.clawdbot/agents/main/sessions"
|
local sessions_dir="/config/.openclaw/agents/main/sessions"
|
||||||
local glob1="${sessions_dir}"/*.jsonl.lock
|
local glob1="${sessions_dir}"/*.jsonl.lock
|
||||||
|
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
@@ -121,7 +121,7 @@ if [ -n "$HA_TOKEN" ]; then
|
|||||||
printf '%s' "$HA_TOKEN" > /config/secrets/homeassistant.token
|
printf '%s' "$HA_TOKEN" > /config/secrets/homeassistant.token
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Brave Search API key (for clawdbot's web_search tool, which reads BRAVE_API_KEY)
|
# Brave Search API key (for OpenClaw's web_search tool, which reads BRAVE_API_KEY)
|
||||||
if [ -n "$BRAVE_KEY" ]; then
|
if [ -n "$BRAVE_KEY" ]; then
|
||||||
export BRAVE_API_KEY="$BRAVE_KEY"
|
export BRAVE_API_KEY="$BRAVE_KEY"
|
||||||
umask 077
|
umask 077
|
||||||
@@ -150,9 +150,8 @@ if [ -z "$GW_TOKEN" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Write gateway config (JSON5).
|
# Write gateway config (JSON5).
|
||||||
# We keep legacy Clawdbot paths for compatibility, and also write OpenClaw paths.
|
mkdir -p /config/.openclaw
|
||||||
mkdir -p /config/.clawdbot /config/.openclaw
|
cat > /config/.openclaw/openclaw.json <<EOF
|
||||||
cat > /config/.clawdbot/clawdbot.json <<EOF
|
|
||||||
{
|
{
|
||||||
discovery: { wideArea: { enabled: false } },
|
discovery: { wideArea: { enabled: false } },
|
||||||
|
|
||||||
@@ -186,8 +185,7 @@ cat > /config/.clawdbot/clawdbot.json <<EOF
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Also write OpenClaw config path(s) (best-effort; OpenClaw can auto-migrate legacy paths).
|
# OpenClaw reads its config from /config/.openclaw/openclaw.json
|
||||||
cp -f /config/.clawdbot/clawdbot.json /config/.openclaw/openclaw.json 2>/dev/null || true
|
|
||||||
|
|
||||||
echo "Model primary=${MODEL_PRIMARY}"
|
echo "Model primary=${MODEL_PRIMARY}"
|
||||||
echo "Gateway bind=${GW_BIND} port=${GW_PORT} token=${GW_TOKEN:+(set)}${GW_TOKEN:-(auto)}"
|
echo "Gateway bind=${GW_BIND} port=${GW_PORT} token=${GW_TOKEN:+(set)}${GW_TOKEN:-(auto)}"
|
||||||
@@ -195,7 +193,7 @@ echo "Telegram dmPolicy=${DM_POLICY}${ALLOW_FROM_RAW:+ (allowFrom=${ALLOW_FROM_R
|
|||||||
echo "Telegram allowFrom JSON: ${ALLOW_FROM_JSON:-<none>}"
|
echo "Telegram allowFrom JSON: ${ALLOW_FROM_JSON:-<none>}"
|
||||||
|
|
||||||
# Auth store debug (redacted): never print tokens
|
# Auth store debug (redacted): never print tokens
|
||||||
AUTH_STORE="/config/.clawdbot/agents/main/agent/auth-profiles.json"
|
AUTH_STORE="/config/.openclaw/agents/main/agent/auth-profiles.json"
|
||||||
if [ -f "$AUTH_STORE" ]; then
|
if [ -f "$AUTH_STORE" ]; then
|
||||||
echo "Auth store present at $AUTH_STORE"
|
echo "Auth store present at $AUTH_STORE"
|
||||||
echo "Auth store summary (redacted):"
|
echo "Auth store summary (redacted):"
|
||||||
@@ -234,9 +232,9 @@ RUN_DOCTOR=$(jq -r '.run_doctor_on_start // false' "$OPTIONS_FILE")
|
|||||||
|
|
||||||
if [ "$RUN_DOCTOR" = "true" ]; then
|
if [ "$RUN_DOCTOR" = "true" ]; then
|
||||||
echo "Running assistant doctor (auto-fix) ..."
|
echo "Running assistant doctor (auto-fix) ..."
|
||||||
(timeout 60s "${CLI_BIN:-clawdbot}" doctor --fix --yes) || true
|
(timeout 60s "${CLI_BIN:-openclaw}" doctor --fix --yes) || true
|
||||||
else
|
else
|
||||||
echo "Skipping clawdbot doctor on startup (run_doctor_on_start=false)"
|
echo "Skipping doctor on startup (run_doctor_on_start=false)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
@@ -275,14 +273,12 @@ TTYD_PID=""
|
|||||||
CLI_BIN=""
|
CLI_BIN=""
|
||||||
if command -v openclaw >/dev/null 2>&1; then
|
if command -v openclaw >/dev/null 2>&1; then
|
||||||
CLI_BIN="openclaw"
|
CLI_BIN="openclaw"
|
||||||
elif command -v clawdbot >/dev/null 2>&1; then
|
|
||||||
CLI_BIN="clawdbot"
|
|
||||||
else
|
else
|
||||||
echo "ERROR: Neither openclaw nor clawdbot is installed."
|
echo "ERROR: openclaw is not installed."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Starting Moltbot Assistant gateway (${CLI_BIN}-compatible)..."
|
echo "Starting OpenClaw Assistant gateway (${CLI_BIN}-compatible)..."
|
||||||
"${CLI_BIN}" gateway run &
|
"${CLI_BIN}" gateway run &
|
||||||
GW_PID=$!
|
GW_PID=$!
|
||||||
|
|
||||||
@@ -305,7 +301,7 @@ fi
|
|||||||
|
|
||||||
# Render nginx config from template with the gateway token.
|
# Render nginx config from template with the gateway token.
|
||||||
# NOTE: This intentionally exposes the token in the browser URL via a redirect.
|
# NOTE: This intentionally exposes the token in the browser URL via a redirect.
|
||||||
# This matches Clawdbot Control UI's current expectations.
|
# This matches OpenClaw Control UI's current expectations.
|
||||||
GW_TOKEN="$GW_TOKEN" GW_PUBLIC_URL="$GW_PUBLIC_URL" python3 - <<'PY'
|
GW_TOKEN="$GW_TOKEN" GW_PUBLIC_URL="$GW_PUBLIC_URL" python3 - <<'PY'
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
name: Moltbot Assistant Add-ons
|
name: OpenClaw Assistant Add-ons
|
||||||
url: https://github.com/techartdev/MoltBotHomeAssistant
|
url: https://github.com/techartdev/OpenClawHomeAssistant
|
||||||
maintainer: Vanyo <vanyo@techart.bg>
|
maintainer: Vanyo <vanyo@techart.bg>
|
||||||
|
|||||||
Reference in New Issue
Block a user