Anurag commited on
Commit
e8b08e4
Β·
unverified Β·
2 Parent(s): 68fc4b18ba914e

Merge branch 'main' into main

Browse files
Files changed (4) hide show
  1. .dockerignore +12 -0
  2. Dockerfile +2 -2
  3. README.md +5 -4
  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
  file \
@@ -53,7 +53,7 @@ RUN apt-get update && apt-get install -y \
53
  fonts-wqy-zenhei \
54
  xfonts-scalable \
55
  --no-install-recommends && \
56
- pip3 install --no-cache-dir --break-system-packages huggingface_hub && \
57
  rm -rf /var/lib/apt/lists/*
58
 
59
  # 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
  file \
 
53
  fonts-wqy-zenhei \
54
  xfonts-scalable \
55
  --no-install-recommends && \
56
+ pip3 install --no-cache-dir --break-system-packages huggingface_hub hf_transfer && \
57
  rm -rf /var/lib/apt/lists/*
58
 
59
  # Install JupyterLab only when DEV_MODE is enabled (build-time)
README.md CHANGED
@@ -118,7 +118,7 @@ HuggingClaw features a built-in dashboard to track:
118
  - **Uptime:** Real-time uptime monitoring.
119
  - **Sync Status:** Visual indicators for workspace backup operations.
120
  - **Chat Status:** Real-time connection status for WhatsApp and Telegram.
121
- - **Model Info:** See which LLM is currently powering your assistant.
122
 
123
  ## πŸ“± Telegram Setup *(Optional)*
124
 
@@ -133,6 +133,7 @@ To chat via Telegram:
133
  | :--- | :--- | :--- |
134
  | `TELEGRAM_BOT_TOKEN` | β€” | Telegram bot token from BotFather |
135
  | `TELEGRAM_ALLOWED_USERS` | β€” | Comma-separated Telegram user IDs for access |
 
136
 
137
  ## 🌐 Cloudflare Proxy Setup
138
 
@@ -381,9 +382,9 @@ HuggingClaw uses a multi-layered approach to ensure stability and persistence on
381
  <details>
382
  <summary><b>Click to view technical details</b></summary>
383
 
384
- - **Dashboard (`/`)**: Management, monitoring, and keep-alive tools (terminal controls appear only in DEV mode).
385
  - **Control UI (`/app/`)**: Secure interface for managing agents and channels, proxied to the OpenClaw gateway on internal port `7860`.
386
- - **JupyterLab Terminal (`/terminal/`)**: Browser terminal/notebook server on internal port `8888` (DEV mode only).
387
  - **Health Check (`/health`)**: Endpoint for uptime monitoring and readiness probes.
388
  - **Sync Engine**: Python background process managing HF Dataset persistence.
389
  - **Transparent Proxy**: Interceptor for requests to blocked domains (Telegram, etc.).
@@ -394,7 +395,7 @@ HuggingClaw uses a multi-layered approach to ensure stability and persistence on
394
  2. Resolve backup namespace and restore workspace from HF Dataset.
395
  3. Generate `openclaw.json` configuration.
396
  4. Launch background tasks (auto-sync, channel helpers).
397
- 5. Start the local dashboard/reverse proxy and OpenClaw gateway (JupyterLab starts when `GATEWAY_TOKEN` is set, `DEV_MODE=true`, or `HUGGINGCLAW_JUPYTER_ENABLED=true`).
398
 
399
  </details>
400
 
 
118
  - **Uptime:** Real-time uptime monitoring.
119
  - **Sync Status:** Visual indicators for workspace backup operations.
120
  - **Chat Status:** Real-time connection status for WhatsApp and Telegram.
121
+ - **Model Info:** See which LLM and provider are currently powering your assistant.
122
 
123
  ## πŸ“± Telegram Setup *(Optional)*
124
 
 
133
  | :--- | :--- | :--- |
134
  | `TELEGRAM_BOT_TOKEN` | β€” | Telegram bot token from BotFather |
135
  | `TELEGRAM_ALLOWED_USERS` | β€” | Comma-separated Telegram user IDs for access |
136
+ | `TELEGRAM_WEBHOOK_URL` | *(auto-provisioned)* | Override webhook URL; set `TELEGRAM_MODE=polling` to use long-polling instead |
137
 
138
  ## 🌐 Cloudflare Proxy Setup
139
 
 
382
  <details>
383
  <summary><b>Click to view technical details</b></summary>
384
 
385
+ - **Dashboard (`/`)**: Management, monitoring, and keep-alive tools. Terminal button appears when DEV mode is enabled (default when `GATEWAY_TOKEN` is set).
386
  - **Control UI (`/app/`)**: Secure interface for managing agents and channels, proxied to the OpenClaw gateway on internal port `7860`.
387
+ - **JupyterLab Terminal (`/terminal/`)**: Browser terminal/notebook server on internal port `8888` (auto-enabled when `GATEWAY_TOKEN` is set; set `DEV_MODE=false` to disable).
388
  - **Health Check (`/health`)**: Endpoint for uptime monitoring and readiness probes.
389
  - **Sync Engine**: Python background process managing HF Dataset persistence.
390
  - **Transparent Proxy**: Interceptor for requests to blocked domains (Telegram, etc.).
 
395
  2. Resolve backup namespace and restore workspace from HF Dataset.
396
  3. Generate `openclaw.json` configuration.
397
  4. Launch background tasks (auto-sync, channel helpers).
398
+ 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).
399
 
400
  </details>
401
 
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";
@@ -320,9 +322,9 @@ function renderDashboard(data) {
320
 
321
  const tiles = [
322
  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" }),
323
- tile({ title: "Model", value: `<code>${escapeHtml(LLM_MODEL)}</code>`, detail: "Primary LLM configured", tone: "neutral" }),
324
  tile({ title: "Runtime", value: escapeHtml(data.uptimeHuman), detail: `Public port ${PORT}`, tone: "neutral" }),
325
- tile({ title: "Telegram", value: badge(TELEGRAM_ENABLED ? "Enabled" : "Disabled", TELEGRAM_ENABLED ? "ok" : "neutral"), detail: TELEGRAM_ENABLED ? "Bot channel active" : "Not configured", tone: TELEGRAM_ENABLED ? "ok" : "neutral" }),
326
  ];
327
 
328
 
 
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";
 
322
 
323
  const tiles = [
324
  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" }),
325
+ tile({ title: "Model", value: `<code>${escapeHtml(LLM_MODEL)}</code>`, detail: LLM_PROVIDER ? `Provider: ${escapeHtml(LLM_PROVIDER)}` : "Primary LLM configured", tone: "neutral" }),
326
  tile({ title: "Runtime", value: escapeHtml(data.uptimeHuman), detail: `Public port ${PORT}`, tone: "neutral" }),
327
+ 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" }),
328
  ];
329
 
330