@@ -40,7 +40,7 @@ The runner establishes a persistent WebSocket connection to Flashduty cloud, rec
4040
4141| Layer | Protection |
4242| -------| ------------|
43- | ** Transport** | TLS-encrypted WebSocket, API Key authentication |
43+ | ** Transport** | TLS-encrypted WebSocket, token authentication |
4444| ** Command Execution** | Shell parsing to prevent injection attacks (e.g., ` cmd1; cmd2 ` ) |
4545| ** Permission Control** | Configurable glob-based command whitelist/blacklist |
4646| ** File System** | Operations sandboxed to workspace root, symlink escape protection |
@@ -127,48 +127,30 @@ sudo mv flashduty-runner /usr/local/bin/
127127``` bash
128128docker run -d \
129129 --name flashduty-runner \
130- -e FLASHDUTY_RUNNER_API_KEY=your_api_key \
131- -e FLASHDUTY_RUNNER_NAME=my-runner \
130+ -e FLASHDUTY_RUNNER_TOKEN=wnt_xxx \
132131 -v /var/flashduty/workspace:/workspace \
133132 registry.flashcat.cloud/public/flashduty-runner:latest
134- ```
135-
136- ### Configuration
137-
138- Create ` ~/.flashduty-runner/config.yaml ` :
139-
140- ``` yaml
141- # API Key from Flashduty Console (required)
142- api_key : " fk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
143133
144- # Runner display name (optional, defaults to hostname)
145- name : " prod-k8s-runner"
146-
147- # Labels for task routing (optional)
148- labels :
149- - k8s
150- - production
151-
152- # Workspace root directory (optional)
153- workspace_root : " /var/flashduty/workspace"
154-
155- # Command permissions (see Security section for options)
156- permission :
157- bash :
158- " * " : " deny"
159- " kubectl get * " : " allow"
160- " kubectl describe * " : " allow"
161- " kubectl logs * " : " allow"
134+ # With custom endpoint
135+ docker run -d \
136+ --name flashduty-runner \
137+ -e FLASHDUTY_RUNNER_TOKEN=wnt_xxx \
138+ -e FLASHDUTY_RUNNER_URL=wss://custom.example.com/safari/worknode/ws \
139+ -v /var/flashduty/workspace:/workspace \
140+ registry.flashcat.cloud/public/flashduty-runner:latest
162141```
163142
164143### Running
165144
166145``` bash
167- # Start the runner
168- flashduty-runner run
146+ # Basic usage (token required)
147+ flashduty-runner run --token wnt_xxx
148+
149+ # Specify workspace directory
150+ flashduty-runner run --token wnt_xxx --workspace ~ /projects
169151
170- # Start with custom config
171- flashduty-runner run --config /path/to/config.yaml
152+ # Specify custom WebSocket endpoint
153+ flashduty-runner run --token wnt_xxx --url wss://custom.example.com/safari/worknode/ws
172154
173155# Check version
174156flashduty-runner version
@@ -186,6 +168,7 @@ After=network.target
186168[Service]
187169Type =simple
188170User =flashduty
171+ EnvironmentFile =/etc/flashduty-runner/env
189172ExecStart =/usr/local/bin/flashduty-runner run
190173Restart =always
191174RestartSec =5
@@ -194,40 +177,31 @@ RestartSec=5
194177WantedBy =multi-user.target
195178```
196179
180+ Create ` /etc/flashduty-runner/env ` :
181+
197182``` bash
198- sudo systemctl daemon-reload
199- sudo systemctl enable --now flashduty-runner
183+ FLASHDUTY_RUNNER_TOKEN=wnt_xxx
184+ # FLASHDUTY_RUNNER_URL=wss://custom.example.com/safari/worknode/ws
185+ # FLASHDUTY_RUNNER_WORKSPACE=/var/flashduty/workspace
200186```
201187
202- ## Configuration Reference
203-
204- | Field | Required | Default | Description |
205- | -------| ----------| ---------| -------------|
206- | ` api_key ` | Yes | - | Flashduty API Key |
207- | ` api_url ` | No | ` wss://api.flashcat.cloud/runner/ws ` | WebSocket endpoint |
208- | ` name ` | No | hostname | Runner display name |
209- | ` labels ` | No | [ ] | Labels for task routing |
210- | ` workspace_root ` | No | ` ~/.flashduty-runner/workspace ` | Workspace directory |
211- | ` permission.bash ` | No | deny all | Command permission rules |
212- | ` log.level ` | No | ` info ` | Log level: debug, info, warn, error |
213-
214- ### Environment Variables
215-
216- All options can be set via environment variables with ` FLASHDUTY_RUNNER_ ` prefix:
217-
218188``` bash
219- FLASHDUTY_RUNNER_API_KEY=fk_xxx
220- FLASHDUTY_RUNNER_NAME=my-runner
221- FLASHDUTY_RUNNER_WORKSPACE_ROOT=/workspace
189+ sudo mkdir -p /etc/flashduty-runner
190+ sudo vim /etc/flashduty-runner/env # add your token
191+ sudo systemctl daemon-reload
192+ sudo systemctl enable --now flashduty-runner
222193```
223194
224- ### Built-in Labels
195+ ## Configuration Reference
225196
226- The runner automatically adds these labels for routing:
197+ Configuration is via command-line flags or environment variables (flags take precedence).
227198
228- - ` os:linux ` / ` os:darwin ` / ` os:windows `
229- - ` arch:amd64 ` / ` arch:arm64 `
230- - ` hostname:<machine-hostname> `
199+ | Flag | Env Variable | Required | Default | Description |
200+ | ------| -------------| ----------| ---------| -------------|
201+ | ` --token ` | ` FLASHDUTY_RUNNER_TOKEN ` | Yes | - | Authentication token |
202+ | ` --url ` | ` FLASHDUTY_RUNNER_URL ` | No | ` wss://api.flashcat.cloud/safari/worknode/ws ` | WebSocket endpoint |
203+ | ` --workspace ` | ` FLASHDUTY_RUNNER_WORKSPACE ` | No | ` ~/.flashduty-runner/workspace ` | Workspace root directory |
204+ | ` --log-level ` | ` FLASHDUTY_RUNNER_LOG_LEVEL ` | No | ` info ` | Log level: debug, info, warn, error |
231205
232206## Troubleshooting
233207
@@ -236,8 +210,8 @@ The runner automatically adds these labels for routing:
236210| Symptom | Cause | Solution |
237211| ---------| -------| ----------|
238212| ` failed to connect ` | Network issue | Check firewall allows outbound port 443 |
239- | ` authentication failed ` | Invalid API Key | Verify API Key in Flashduty console |
240- | Runner not showing online | Connection dropped | Check logs, verify API Key matches account |
213+ | ` authentication failed ` | Invalid token | Verify token in Flashduty console |
214+ | Runner not showing online | Connection dropped | Check logs, verify token matches account |
241215
242216``` bash
243217# Test connectivity
@@ -263,9 +237,11 @@ journalctl -u flashduty-runner -f
263237
264238Enable debug logging to see detailed permission decisions:
265239
266- ``` yaml
267- log :
268- level : " debug"
240+ ``` bash
241+ flashduty-runner run --token wnt_xxx --log-level debug
242+
243+ # Or via environment variable
244+ export FLASHDUTY_RUNNER_LOG_LEVEL=debug
269245```
270246
271247## Contributing
0 commit comments