Spaces:
Running
Running
feat: add hf_transfer, provider tile, telegram detail, dockerignore, readme sync
Browse files- Dockerfile: add --no-install-recommends, hf_transfer for faster backups
- health-server.js: show LLM provider in model tile, webhook/polling in telegram tile
- .dockerignore: add to reduce build context
- README.md: fix stale DEV_MODE-only terminal references, add TELEGRAM_WEBHOOK_URL row
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- .dockerignore +12 -0
- Dockerfile +2 -2
- README.md +5 -4
- health-server.js +4 -2
.dockerignore
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.git
|
| 2 |
+
.DS_Store
|
| 3 |
+
__pycache__
|
| 4 |
+
*.pyc
|
| 5 |
+
node_modules
|
| 6 |
+
.env
|
| 7 |
+
.env.*
|
| 8 |
+
!.env.example
|
| 9 |
+
venv
|
| 10 |
+
.venv
|
| 11 |
+
tasks/
|
| 12 |
+
*.log
|
Dockerfile
CHANGED
|
@@ -20,7 +20,7 @@ ARG DEV_MODE=false
|
|
| 20 |
# override by setting DEV_MODE=false as an HF Space Variable to opt out.
|
| 21 |
|
| 22 |
# Install system dependencies (+ optional JupyterLab deps in DEV_MODE)
|
| 23 |
-
RUN apt-get update && apt-get install -y \
|
| 24 |
git \
|
| 25 |
sudo \
|
| 26 |
ca-certificates \
|
|
@@ -50,7 +50,7 @@ RUN apt-get update && apt-get install -y \
|
|
| 50 |
fonts-wqy-zenhei \
|
| 51 |
xfonts-scalable \
|
| 52 |
--no-install-recommends && \
|
| 53 |
-
pip3 install --no-cache-dir --break-system-packages huggingface_hub && \
|
| 54 |
rm -rf /var/lib/apt/lists/*
|
| 55 |
|
| 56 |
# Install JupyterLab only when DEV_MODE is enabled (build-time)
|
|
|
|
| 20 |
# override by setting DEV_MODE=false as an HF Space Variable to opt out.
|
| 21 |
|
| 22 |
# Install system dependencies (+ optional JupyterLab deps in DEV_MODE)
|
| 23 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 24 |
git \
|
| 25 |
sudo \
|
| 26 |
ca-certificates \
|
|
|
|
| 50 |
fonts-wqy-zenhei \
|
| 51 |
xfonts-scalable \
|
| 52 |
--no-install-recommends && \
|
| 53 |
+
pip3 install --no-cache-dir --break-system-packages huggingface_hub hf_transfer && \
|
| 54 |
rm -rf /var/lib/apt/lists/*
|
| 55 |
|
| 56 |
# Install JupyterLab only when DEV_MODE is enabled (build-time)
|
README.md
CHANGED
|
@@ -119,7 +119,7 @@ HuggingClaw features a built-in dashboard to track:
|
|
| 119 |
- **Uptime:** Real-time uptime monitoring.
|
| 120 |
- **Sync Status:** Visual indicators for workspace backup operations.
|
| 121 |
- **Chat Status:** Real-time connection status for WhatsApp and Telegram.
|
| 122 |
-
- **Model Info:** See which LLM
|
| 123 |
|
| 124 |
## π± Telegram Setup *(Optional)*
|
| 125 |
|
|
@@ -134,6 +134,7 @@ To chat via Telegram:
|
|
| 134 |
| :--- | :--- | :--- |
|
| 135 |
| `TELEGRAM_BOT_TOKEN` | β | Telegram bot token from BotFather |
|
| 136 |
| `TELEGRAM_ALLOWED_USERS` | β | Comma-separated Telegram user IDs for access |
|
|
|
|
| 137 |
|
| 138 |
## π Cloudflare Proxy Setup
|
| 139 |
|
|
@@ -391,9 +392,9 @@ HuggingClaw uses a multi-layered approach to ensure stability and persistence on
|
|
| 391 |
<details>
|
| 392 |
<summary><b>Click to view technical details</b></summary>
|
| 393 |
|
| 394 |
-
- **Dashboard (`/`)**: Management, monitoring, and keep-alive tools
|
| 395 |
- **Control UI (`/app/`)**: Secure interface for managing agents and channels, proxied to the OpenClaw gateway on internal port `7860`.
|
| 396 |
-
- **JupyterLab Terminal (`/terminal/`)**: Browser terminal/notebook server on internal port `8888` (
|
| 397 |
- **Health Check (`/health`)**: Endpoint for uptime monitoring and readiness probes.
|
| 398 |
- **Sync Engine**: Python background process managing HF Dataset persistence.
|
| 399 |
- **Transparent Proxy**: Interceptor for requests to blocked domains (Telegram, etc.).
|
|
@@ -404,7 +405,7 @@ HuggingClaw uses a multi-layered approach to ensure stability and persistence on
|
|
| 404 |
2. Resolve backup namespace and restore workspace from HF Dataset.
|
| 405 |
3. Generate `openclaw.json` configuration.
|
| 406 |
4. Launch background tasks (auto-sync, channel helpers).
|
| 407 |
-
5. Start the local dashboard/reverse proxy and OpenClaw gateway (JupyterLab starts
|
| 408 |
|
| 409 |
</details>
|
| 410 |
|
|
|
|
| 119 |
- **Uptime:** Real-time uptime monitoring.
|
| 120 |
- **Sync Status:** Visual indicators for workspace backup operations.
|
| 121 |
- **Chat Status:** Real-time connection status for WhatsApp and Telegram.
|
| 122 |
+
- **Model Info:** See which LLM and provider are currently powering your assistant.
|
| 123 |
|
| 124 |
## π± Telegram Setup *(Optional)*
|
| 125 |
|
|
|
|
| 134 |
| :--- | :--- | :--- |
|
| 135 |
| `TELEGRAM_BOT_TOKEN` | β | Telegram bot token from BotFather |
|
| 136 |
| `TELEGRAM_ALLOWED_USERS` | β | Comma-separated Telegram user IDs for access |
|
| 137 |
+
| `TELEGRAM_WEBHOOK_URL` | *(auto-provisioned)* | Override webhook URL; set `TELEGRAM_MODE=polling` to use long-polling instead |
|
| 138 |
|
| 139 |
## π Cloudflare Proxy Setup
|
| 140 |
|
|
|
|
| 392 |
<details>
|
| 393 |
<summary><b>Click to view technical details</b></summary>
|
| 394 |
|
| 395 |
+
- **Dashboard (`/`)**: Management, monitoring, and keep-alive tools. Terminal button appears when DEV mode is enabled (default when `GATEWAY_TOKEN` is set).
|
| 396 |
- **Control UI (`/app/`)**: Secure interface for managing agents and channels, proxied to the OpenClaw gateway on internal port `7860`.
|
| 397 |
+
- **JupyterLab Terminal (`/terminal/`)**: Browser terminal/notebook server on internal port `8888` (auto-enabled when `GATEWAY_TOKEN` is set; set `DEV_MODE=false` to disable).
|
| 398 |
- **Health Check (`/health`)**: Endpoint for uptime monitoring and readiness probes.
|
| 399 |
- **Sync Engine**: Python background process managing HF Dataset persistence.
|
| 400 |
- **Transparent Proxy**: Interceptor for requests to blocked domains (Telegram, etc.).
|
|
|
|
| 405 |
2. Resolve backup namespace and restore workspace from HF Dataset.
|
| 406 |
3. Generate `openclaw.json` configuration.
|
| 407 |
4. Launch background tasks (auto-sync, channel helpers).
|
| 408 |
+
5. Start the local dashboard/reverse proxy and OpenClaw gateway (JupyterLab starts automatically when `GATEWAY_TOKEN` is set; set `DEV_MODE=false` to opt out).
|
| 409 |
|
| 410 |
</details>
|
| 411 |
|
health-server.js
CHANGED
|
@@ -28,6 +28,8 @@ const JUPYTER_ENABLED =
|
|
| 28 |
!/^(false|0|no|off)$/i.test(String(process.env.HUGGINGCLAW_JUPYTER_ENABLED || "").trim());
|
| 29 |
const startTime = Date.now();
|
| 30 |
const LLM_MODEL = process.env.LLM_MODEL || "Not Set";
|
|
|
|
|
|
|
| 31 |
const TELEGRAM_ENABLED = !!process.env.TELEGRAM_BOT_TOKEN;
|
| 32 |
const WHATSAPP_ENABLED = isTrue(process.env.WHATSAPP_ENABLED);
|
| 33 |
const WHATSAPP_STATUS_FILE = "/tmp/huggingclaw-wa-status.json";
|
|
@@ -240,9 +242,9 @@ function renderDashboard(data) {
|
|
| 240 |
|
| 241 |
const tiles = [
|
| 242 |
tile({ title: "Gateway", value: badge(data.gatewayReady ? "Online" : "Offline", data.gatewayReady ? "ok" : "off"), detail: `OpenClaw on internal port ${GATEWAY_PORT}`, tone: data.gatewayReady ? "ok" : "off" }),
|
| 243 |
-
tile({ title: "Model", value: `<code>${escapeHtml(LLM_MODEL)}</code>`, detail: "Primary LLM configured", tone: "neutral" }),
|
| 244 |
tile({ title: "Runtime", value: escapeHtml(data.uptimeHuman), detail: `Public port ${PORT}`, tone: "neutral" }),
|
| 245 |
-
tile({ title: "Telegram", value: badge(TELEGRAM_ENABLED ? "Enabled" : "Disabled", TELEGRAM_ENABLED ? "ok" : "neutral"), detail: TELEGRAM_ENABLED ? "
|
| 246 |
];
|
| 247 |
|
| 248 |
|
|
|
|
| 28 |
!/^(false|0|no|off)$/i.test(String(process.env.HUGGINGCLAW_JUPYTER_ENABLED || "").trim());
|
| 29 |
const startTime = Date.now();
|
| 30 |
const LLM_MODEL = process.env.LLM_MODEL || "Not Set";
|
| 31 |
+
const LLM_PROVIDER = LLM_MODEL.includes("/") ? LLM_MODEL.split("/")[0] : "";
|
| 32 |
+
const TELEGRAM_WEBHOOK_URL = (process.env.TELEGRAM_WEBHOOK_URL || "").trim();
|
| 33 |
const TELEGRAM_ENABLED = !!process.env.TELEGRAM_BOT_TOKEN;
|
| 34 |
const WHATSAPP_ENABLED = isTrue(process.env.WHATSAPP_ENABLED);
|
| 35 |
const WHATSAPP_STATUS_FILE = "/tmp/huggingclaw-wa-status.json";
|
|
|
|
| 242 |
|
| 243 |
const tiles = [
|
| 244 |
tile({ title: "Gateway", value: badge(data.gatewayReady ? "Online" : "Offline", data.gatewayReady ? "ok" : "off"), detail: `OpenClaw on internal port ${GATEWAY_PORT}`, tone: data.gatewayReady ? "ok" : "off" }),
|
| 245 |
+
tile({ title: "Model", value: `<code>${escapeHtml(LLM_MODEL)}</code>`, detail: LLM_PROVIDER ? `Provider: ${escapeHtml(LLM_PROVIDER)}` : "Primary LLM configured", tone: "neutral" }),
|
| 246 |
tile({ title: "Runtime", value: escapeHtml(data.uptimeHuman), detail: `Public port ${PORT}`, tone: "neutral" }),
|
| 247 |
+
tile({ title: "Telegram", value: badge(TELEGRAM_ENABLED ? "Enabled" : "Disabled", TELEGRAM_ENABLED ? "ok" : "neutral"), detail: TELEGRAM_ENABLED ? (TELEGRAM_WEBHOOK_URL ? "Webhook" : "Polling") + (process.env.CLOUDFLARE_PROXY_URL ? " via CF proxy" : "") : "Not configured", tone: TELEGRAM_ENABLED ? "ok" : "neutral" }),
|
| 248 |
];
|
| 249 |
|
| 250 |
|