From 2881c71c9208ce95e9c97f14ca931a366cee70b5 Mon Sep 17 00:00:00 2001 From: Arjun Komath Date: Sat, 6 Jun 2026 19:36:58 +1000 Subject: [PATCH] Remove TUI, encourage railway console --- README.md | 43 +--------- compose.dev.yml | 1 - package.json | 3 +- pnpm-lock.yaml | 17 ---- src/public/setup.html | 26 ++++-- src/public/styles.css | 190 +++++++++++++++-------------------------- src/public/tui.html | 193 ------------------------------------------ src/server.js | 192 ----------------------------------------- 8 files changed, 92 insertions(+), 573 deletions(-) delete mode 100644 src/public/tui.html diff --git a/README.md b/README.md index a764b10..12a40a7 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ - **OpenClaw Gateway + Control UI** (served at `/` and `/openclaw`) - A friendly **Setup Wizard** at `/setup` (protected by a password) -- Optional **Web Terminal** at `/tui` for browser-based TUI access - Persistent state via **Railway Volume** (so config/credentials/memory survive redeploys) ## How it works (high level) @@ -49,36 +48,6 @@ This uses OpenClaw's `xai-device-code` onboarding flow, so you can use an eligib 4. Copy the **Bot Token** and paste it into `/setup` 5. Invite the bot to your server (OAuth2 URL Generator → scopes: `bot`, `applications.commands`; then choose permissions) -## Web Terminal (TUI) - -The template includes an optional web-based terminal that runs `openclaw tui` in your browser. - -### Enabling - -Set `ENABLE_WEB_TUI=true` in your Railway Variables. The terminal is **disabled by default**. - -Once enabled, access it at `/tui` or via the "Open Terminal" button on the setup page. - -### Security - -The web TUI implements multiple security layers: - -| Control | Description | -|---------|-------------| -| **Opt-in only** | Disabled by default, requires explicit `ENABLE_WEB_TUI=true` | -| **Password protected** | Uses the same `SETUP_PASSWORD` as the setup wizard | -| **Single session** | Only 1 concurrent TUI session allowed at a time | -| **Idle timeout** | Auto-closes after 5 minutes of inactivity (configurable via `TUI_IDLE_TIMEOUT_MS`) | -| **Max duration** | Hard limit of 30 minutes per session (configurable via `TUI_MAX_SESSION_MS`) | - -### Configuration - -| Variable | Default | Description | -|----------|---------|-------------| -| `ENABLE_WEB_TUI` | `false` | Set to `true` to enable | -| `TUI_IDLE_TIMEOUT_MS` | `300000` (5 min) | Closes session after inactivity | -| `TUI_MAX_SESSION_MS` | `1800000` (30 min) | Maximum session duration | - ## Local testing ```bash @@ -87,14 +56,12 @@ docker build -t openclaw-railway-template . docker run --rm -p 8080:8080 \ -e PORT=8080 \ -e SETUP_PASSWORD=test \ - -e ENABLE_WEB_TUI=true \ -e OPENCLAW_STATE_DIR=/data/.openclaw \ -e OPENCLAW_WORKSPACE_DIR=/data/workspace \ -v $(pwd)/.tmpdata:/data \ openclaw-railway-template # Setup wizard: http://localhost:8080/setup (password: test) -# Web terminal: http://localhost:8080/tui (after setup) ``` ## FAQ @@ -107,10 +74,6 @@ A: Go to `/setup` on your deployed instance. When prompted for credentials, use A: Go back to `/setup` and click the "Open OpenClaw UI" button from there. The setup page passes the required auth token to the UI. Accessing the UI directly without the token will cause connection errors. -**Q: I don't see the TUI option on the setup page.** - -A: Make sure `ENABLE_WEB_TUI=true` is set in your Railway Variables and redeploy. The web terminal is disabled by default. - **Q: How do I approve pairing for Telegram or Discord?** A: Go to `/setup` and use the "Approve Pairing" dialog to approve pending pairing requests from your chat channels. @@ -121,7 +84,7 @@ A: New browsers/devices need a one-time approval from the gateway. Go to `/setup **Q: How do I change the AI model after setup?** -A: Use the OpenClaw CLI to switch models. Access the web terminal at `/tui` (if enabled) or SSH into your container and run: +A: Use the OpenClaw CLI to switch models. Railway provides an integrated in-browser shell directly in your dashboard — no external SSH client needed. Open the Railway dashboard, click your service, go to the **Console** tab, and use the connected shell to run: ```bash openclaw models set provider/model-id @@ -143,10 +106,6 @@ A: Go to `/setup` and click the "Run Doctor" button. This runs `openclaw doctor CleanShot 2026-02-23 at 21 57 59@2x -## TUI - -CleanShot 2026-02-23 at 22 08 20@2x - ## Device approval CleanShot 2026-02-23 at 21 59 21@2x diff --git a/compose.dev.yml b/compose.dev.yml index 69d53b0..c89819d 100644 --- a/compose.dev.yml +++ b/compose.dev.yml @@ -8,6 +8,5 @@ services: - SETUP_PASSWORD=test - OPENCLAW_STATE_DIR=/data/.openclaw - OPENCLAW_WORKSPACE_DIR=/data/workspace - - ENABLE_WEB_TUI=true volumes: - ./.tmpdata:/data diff --git a/package.json b/package.json index 762c1a0..ee7c6e1 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,7 @@ "dependencies": { "express": "^5.1.0", "http-proxy": "^1.18.1", - "node-pty": "^1.0.0", - "ws": "^8.18.0" + "node-pty": "^1.0.0" }, "pnpm": { "onlyBuiltDependencies": ["node-pty"] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3505afd..2406e98 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,9 +17,6 @@ importers: node-pty: specifier: ^1.0.0 version: 1.1.0 - ws: - specifier: ^8.18.0 - version: 8.19.0 packages: @@ -302,18 +299,6 @@ packages: wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - ws@8.19.0: - resolution: {integrity: sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - snapshots: accepts@2.0.0: @@ -627,5 +612,3 @@ snapshots: vary@1.1.2: {} wrappy@1.0.2: {} - - ws@8.19.0: {} diff --git a/src/public/setup.html b/src/public/setup.html index bf90239..9a8bef9 100644 --- a/src/public/setup.html +++ b/src/public/setup.html @@ -42,7 +42,6 @@ pairingMessage: '', showPairingModal: false, isReady: false, - tuiEnabled: false, exporting: false, showExportInfo: false, importing: false, @@ -108,7 +107,6 @@ const j = await this.httpJson('/setup/api/status'); this.configured = j.configured; this.openclawVersion = j.openclawVersion || ''; - this.tuiEnabled = j.tuiEnabled || false; this.status = j.configured ? 'Configured - open /openclaw' : 'Not configured - run setup below'; this.authGroups = j.authGroups || []; if (this.authGroups.length > 0) { @@ -533,10 +531,6 @@ Open OpenClaw UI - - Open Terminal - - @@ -680,6 +674,26 @@
+
+
+
+ +
+

Prefer the command line?

+
+

+ This wizard is just one way to get started. You can also run any openclaw command directly using + Railway's built-in Console — an in-browser shell scoped to this service, no SSH client needed. +

+
    +
  1. Open your project in the Railway dashboard
  2. +
  3. Click this service, then open the Console tab
  4. +
  5. Use the connected shell (top) and file browser (bottom) to run commands, e.g.:
  6. +
+
openclaw onboard
+openclaw models set anthropic/claude-sonnet-4-20250514
+
+