Public Access
feat: initial source commit
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
# Action Gateway
|
||||
|
||||
Human-in-the-loop approval service for agent actions. The agent submits actions; you approve or reject them via a web UI.
|
||||
|
||||
## Setup
|
||||
|
||||
### 1. Config (optional)
|
||||
Create `/home/node/.openclaw/workspace/config/action-gateway.toml`:
|
||||
```toml
|
||||
database_path = "/home/node/.openclaw/workspace/config/action-gateway.db"
|
||||
bind = "0.0.0.0:7878"
|
||||
base_url = "https://yourdomain.com:7878"
|
||||
notification_webhook = "" # optional Matrix/webhook URL
|
||||
```
|
||||
|
||||
### 2. Add a user
|
||||
```bash
|
||||
./gateway-cli add-user admin yourpassword
|
||||
```
|
||||
|
||||
### 3. Generate an API key for the agent
|
||||
```bash
|
||||
./gateway-cli gen-api-key agent
|
||||
# Copy the key — store it in pass: pass insert gateway/api-key
|
||||
```
|
||||
|
||||
### 4. Run the server
|
||||
```bash
|
||||
./action-gateway
|
||||
# 🚀 Action Gateway running at http://0.0.0.0:7878
|
||||
```
|
||||
|
||||
## Agent usage (from inside the container)
|
||||
```bash
|
||||
# Submit an action
|
||||
curl -s -X POST http://host:7878/api/actions \
|
||||
-H "Authorization: Bearer <api-key>" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"description":"List files in /tmp","command":"ls /tmp"}'
|
||||
|
||||
# Poll for result
|
||||
curl -s http://host:7878/api/actions/<id>/result \
|
||||
-H "Authorization: Bearer <api-key>"
|
||||
```
|
||||
|
||||
## CLI commands
|
||||
```bash
|
||||
gateway-cli add-user <username> <password>
|
||||
gateway-cli list-users
|
||||
gateway-cli remove-user <username>
|
||||
gateway-cli gen-api-key [label]
|
||||
gateway-cli list-keys
|
||||
```
|
||||
|
||||
## Binaries
|
||||
After `cargo build --release`:
|
||||
- `target/release/action-gateway` — the web server
|
||||
- `target/release/gateway-cli` — admin CLI
|
||||
Reference in New Issue
Block a user