Skip to content

feat: bootstrap mode + network scanner - #67

Merged
frahlg merged 1 commit into
masterfrom
worktree-agent-ac7f8db2
Apr 16, 2026
Merged

frahlg merged 1 commit into
masterfrom
worktree-agent-ac7f8db2

Conversation

@frahlg

@frahlg frahlg commented Apr 16, 2026

Copy link
Copy Markdown
Member

Onboarding wizard backend. go test ./... green.

When config.yaml is missing, the app now starts a minimal HTTP server
serving only the setup wizard + driver catalog + network scanner.
No drivers, no telemetry, no MPC — just the wizard API.

New package: go/internal/scanner — TCP port scanner for Modbus (502),
MQTT (1883), and HTTP (80) on local subnets. 64-goroutine concurrent
scan with 500ms timeout per host.

API: GET /api/scan returns discovered devices as JSON.
POST /api/config saves + restarts via syscall.Exec.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@frahlg
frahlg merged commit 267cef4 into master Apr 16, 2026
github-actions Bot pushed a commit that referenced this pull request Apr 16, 2026
## [0.5.0](v0.4.0...v0.5.0) (2026-04-16)

### Features

* add setup wizard frontend (web/setup.html + web/setup.js) ([#66](#66)) ([bc1a285](bc1a285))
* bootstrap mode + network scanner for onboarding wizard ([#67](#67)) ([267cef4](267cef4))
* wizard dashboard trigger + driver catalog enrichment ([#68](#68)) ([78c83cf](78c83cf))

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cb657bea09

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +121 to +124
clean := filepath.Clean(filepath.Join(webDir, r.URL.Path))
absWeb, _ := filepath.Abs(webDir)
absPath, _ := filepath.Abs(clean)
if !strings.HasPrefix(absPath, absWeb) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Harden bootstrap static path check

The path-traversal guard in serveStatic is bypassable because it relies on strings.HasPrefix(absPath, absWeb) instead of enforcing a directory boundary. In bootstrap mode, a request like /%2e%2e/web2/secret can arrive as /../web2/secret, and filepath.Clean(filepath.Join(webDir, ...)) resolves to a sibling path such as <webDir>2/secret; that still passes the prefix test and can be served if it exists. This exposes files outside the intended web root during onboarding; use a boundary-safe check (for example filepath.Rel + .. rejection, or absWeb + string(os.PathSeparator) prefix).

Useful? React with 👍 / 👎.

@frahlg
frahlg deleted the worktree-agent-ac7f8db2 branch August 7, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant