Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ linters:
# Exclude G301 (directory permissions) - workspace needs readable directories
# Exclude G304 (file inclusion) - paths are validated via safePath()
# Exclude G306 (file permissions) - workspace files need to be readable
# Exclude G706 (log injection) - we use slog structured logging which is inherently safe
excludes:
- G301
- G304
- G306
- G706

formatters:
enable:
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ sudo mv flashduty-runner /usr/local/bin/
```bash
docker run -d \
--name flashduty-runner \
-e FLASHDUTY_RUNNER_TOKEN=wnt_xxx \
-e FLASHDUTY_RUNNER_TOKEN=ent_xxx \
-v /var/flashduty/workspace:/workspace \
registry.flashcat.cloud/public/flashduty-runner:latest

# With custom endpoint
docker run -d \
--name flashduty-runner \
-e FLASHDUTY_RUNNER_TOKEN=wnt_xxx \
-e FLASHDUTY_RUNNER_URL=wss://custom.example.com/safari/worknode/ws \
-e FLASHDUTY_RUNNER_TOKEN=ent_xxx \
-e FLASHDUTY_RUNNER_URL=wss://custom.example.com/safari/environment/ws \
-v /var/flashduty/workspace:/workspace \
registry.flashcat.cloud/public/flashduty-runner:latest
```
Expand All @@ -144,13 +144,13 @@ docker run -d \

```bash
# Basic usage (token required)
flashduty-runner run --token wnt_xxx
flashduty-runner run --token ent_xxx

# Specify workspace directory
flashduty-runner run --token wnt_xxx --workspace ~/projects
flashduty-runner run --token ent_xxx --workspace ~/projects

# Specify custom WebSocket endpoint
flashduty-runner run --token wnt_xxx --url wss://custom.example.com/safari/worknode/ws
flashduty-runner run --token ent_xxx --url wss://custom.example.com/safari/environment/ws

# Check version
flashduty-runner version
Expand Down Expand Up @@ -180,8 +180,8 @@ WantedBy=multi-user.target
Create `/etc/flashduty-runner/env`:

```bash
FLASHDUTY_RUNNER_TOKEN=wnt_xxx
# FLASHDUTY_RUNNER_URL=wss://custom.example.com/safari/worknode/ws
FLASHDUTY_RUNNER_TOKEN=ent_xxx
# FLASHDUTY_RUNNER_URL=wss://custom.example.com/safari/environment/ws
# FLASHDUTY_RUNNER_WORKSPACE=/var/flashduty/workspace
```

Expand All @@ -199,7 +199,7 @@ Configuration is via command-line flags or environment variables (flags take pre
| Flag | Env Variable | Required | Default | Description |
|------|-------------|----------|---------|-------------|
| `--token` | `FLASHDUTY_RUNNER_TOKEN` | Yes | - | Authentication token |
| `--url` | `FLASHDUTY_RUNNER_URL` | No | `wss://api.flashcat.cloud/safari/worknode/ws` | WebSocket endpoint |
| `--url` | `FLASHDUTY_RUNNER_URL` | No | `wss://api.flashcat.cloud/safari/environment/ws` | WebSocket endpoint |
| `--workspace` | `FLASHDUTY_RUNNER_WORKSPACE` | No | `~/.flashduty-runner/workspace` | Workspace root directory |
| `--log-level` | `FLASHDUTY_RUNNER_LOG_LEVEL` | No | `info` | Log level: debug, info, warn, error |

Expand Down Expand Up @@ -238,7 +238,7 @@ journalctl -u flashduty-runner -f
Enable debug logging to see detailed permission decisions:

```bash
flashduty-runner run --token wnt_xxx --log-level debug
flashduty-runner run --token ent_xxx --log-level debug

# Or via environment variable
export FLASHDUTY_RUNNER_LOG_LEVEL=debug
Expand Down
20 changes: 10 additions & 10 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ sudo mv flashduty-runner /usr/local/bin/
```bash
docker run -d \
--name flashduty-runner \
-e FLASHDUTY_RUNNER_TOKEN=wnt_xxx \
-e FLASHDUTY_RUNNER_TOKEN=ent_xxx \
-v /var/flashduty/workspace:/workspace \
registry.flashcat.cloud/public/flashduty-runner:latest

# 使用自定义端点
docker run -d \
--name flashduty-runner \
-e FLASHDUTY_RUNNER_TOKEN=wnt_xxx \
-e FLASHDUTY_RUNNER_URL=wss://custom.example.com/safari/worknode/ws \
-e FLASHDUTY_RUNNER_TOKEN=ent_xxx \
-e FLASHDUTY_RUNNER_URL=wss://custom.example.com/safari/environment/ws \
-v /var/flashduty/workspace:/workspace \
registry.flashcat.cloud/public/flashduty-runner:latest
```
Expand All @@ -144,13 +144,13 @@ docker run -d \

```bash
# 基本用法(token 必填)
flashduty-runner run --token wnt_xxx
flashduty-runner run --token ent_xxx

# 指定工作区目录
flashduty-runner run --token wnt_xxx --workspace ~/projects
flashduty-runner run --token ent_xxx --workspace ~/projects

# 指定自定义 WebSocket 端点
flashduty-runner run --token wnt_xxx --url wss://custom.example.com/safari/worknode/ws
flashduty-runner run --token ent_xxx --url wss://custom.example.com/safari/environment/ws

# 查看版本
flashduty-runner version
Expand Down Expand Up @@ -180,8 +180,8 @@ WantedBy=multi-user.target
创建 `/etc/flashduty-runner/env`:

```bash
FLASHDUTY_RUNNER_TOKEN=wnt_xxx
# FLASHDUTY_RUNNER_URL=wss://custom.example.com/safari/worknode/ws
FLASHDUTY_RUNNER_TOKEN=ent_xxx
# FLASHDUTY_RUNNER_URL=wss://custom.example.com/safari/environment/ws
# FLASHDUTY_RUNNER_WORKSPACE=/var/flashduty/workspace
```

Expand All @@ -199,7 +199,7 @@ sudo systemctl enable --now flashduty-runner
| 参数 | 环境变量 | 必填 | 默认值 | 说明 |
|------|----------|------|--------|------|
| `--token` | `FLASHDUTY_RUNNER_TOKEN` | 是 | - | 认证令牌 |
| `--url` | `FLASHDUTY_RUNNER_URL` | 否 | `wss://api.flashcat.cloud/safari/worknode/ws` | WebSocket 端点 |
| `--url` | `FLASHDUTY_RUNNER_URL` | 否 | `wss://api.flashcat.cloud/safari/environment/ws` | WebSocket 端点 |
| `--workspace` | `FLASHDUTY_RUNNER_WORKSPACE` | 否 | `~/.flashduty-runner/workspace` | 工作区根目录 |
| `--log-level` | `FLASHDUTY_RUNNER_LOG_LEVEL` | 否 | `info` | 日志级别:debug, info, warn, error |

Expand Down Expand Up @@ -238,7 +238,7 @@ journalctl -u flashduty-runner -f
启用调试日志以查看详细的权限决策:

```bash
flashduty-runner run --token wnt_xxx --log-level debug
flashduty-runner run --token ent_xxx --log-level debug

# 或通过环境变量
export FLASHDUTY_RUNNER_LOG_LEVEL=debug
Expand Down
12 changes: 6 additions & 6 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

"github.com/spf13/cobra"

"github.com/flashcatcloud/flashduty-runner/environment"
"github.com/flashcatcloud/flashduty-runner/permission"
"github.com/flashcatcloud/flashduty-runner/workspace"
"github.com/flashcatcloud/flashduty-runner/ws"
)

Expand All @@ -35,7 +35,7 @@ var (

// Default values
const (
defaultURL = "wss://api.flashcat.cloud/safari/worknode/ws"
defaultURL = "wss://api.flashcat.cloud/safari/environment/ws"
defaultLogLevel = "info"
)

Expand Down Expand Up @@ -67,13 +67,13 @@ func runCmd() *cobra.Command {

Examples:
# Basic usage (token required)
flashduty-runner run --token wnt_xxx
flashduty-runner run --token ent_xxx

# Specify workspace directory
flashduty-runner run --token wnt_xxx --workspace ~/projects
flashduty-runner run --token ent_xxx --workspace ~/projects

# Specify custom API URL
flashduty-runner run --token wnt_xxx --url wss://custom.example.com/safari/worknode/ws
flashduty-runner run --token ent_xxx --url wss://custom.example.com/safari/environment/ws

Environment variables:
FLASHDUTY_RUNNER_TOKEN - Authentication token (required if --token not provided)
Expand Down Expand Up @@ -177,7 +177,7 @@ func runRunner() error {
checker := permission.NewChecker(map[string]string{"*": "allow"})

// Create workspace
wspace, err := workspace.New(cfg.WorkspaceRoot, checker)
wspace, err := environment.New(cfg.WorkspaceRoot, checker)
if err != nil {
return fmt.Errorf("failed to create workspace: %w", err)
}
Expand Down
Loading
Loading