Skip to content

Phase 1: adapter backup/restore, DHCP server, status panel, lease list, Open WebUI - #1

Merged
cookingwithsimon merged 14 commits into
mainfrom
phase-1
Oct 16, 2026
Merged

cookingwithsimon merged 14 commits into
mainfrom
phase-1

Conversation

@cookingwithsimon

Copy link
Copy Markdown
Owner

Requested by Simon · project thread

Before: the repository was empty.

After: a single-file Windows exe. You pick the Ethernet adapter and press Start. The app backs up the adapter, sets 192.168.100.1/24, checks that no other DHCP server is on the link, and serves DHCP. An eight-step green/amber/red panel says what is working, what isn't and what to do next. When a device takes a lease, its card shows IP, MAC, manufacturer, lease time and first-seen time, with Open WebUI, port buttons and Copy IP. Stop, closing the window, a crash or a Windows shutdown all put the adapter back. If the app is killed, it offers to restore on the next launch.

How: the solution has three projects.

  • ProDHCPServer.Core is pure logic and fully unit-tested (121 tests). It holds the RFC 2131 engine, the backup/restore lifecycle and the status rules.
  • ProDHCPServer.Windows handles the OS side. It reads adapter state from .NET and the registry, so it works while the cable is unplugged, and changes settings through netsh. The UDP 67 socket is bound to the serving adapter's own IP, with an interface-index check on every packet. Static ARP entries make unicast replies possible, and the firewall rule is scoped to the exe.
  • ProDHCPServer.App is the WPF Fluent UI with dark and light themes.

CI runs on windows-latest. It runs the unit tests and Windows integration tests (real sockets, ARP P/Invoke, firewall; no adapter changes), then publishes the exe. A smoke test launches the exe in both themes and saves screenshots as artifacts.

Hardware test checklist: docs/hardware-test-phase1.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KZvcgLYKFKnCYgDw2Bxw5e


Generated by Claude Code

…t, Open WebUI

- Core: RFC 2131 packet codec and server engine (DORA, NAK, RELEASE,
  DECLINE, INFORM, BOOTP, relay, broadcast/unicast with fallback),
  adapter backup/restore lifecycle with crash recovery, eight-step
  status rules with plain-English reasons, offline OUI lookup.
- Windows: adapter read/apply/restore (registry + netsh), UDP 67 socket
  bound to the serving adapter, static ARP entries for unicast replies,
  firewall rule, other-DHCP-server probe, ping and web-port checks.
- App: WPF Fluent UI with dark/light themes, elevation prompt,
  single instance, restore on stop/close/crash/shutdown.
- 121 Core unit tests; Windows integration tests and a launch smoke
  test with screenshots run in CI, which also publishes the exe.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KZvcgLYKFKnCYgDw2Bxw5e
@cookingwithsimon cookingwithsimon self-assigned this Oct 15, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KZvcgLYKFKnCYgDw2Bxw5e
…ranch

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KZvcgLYKFKnCYgDw2Bxw5e
…visible

Opens maximised when the screen is smaller than the default size, compacts
the status rows, and collapses the session log (showing the latest line in
its header) on screens under 1000px tall.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KZvcgLYKFKnCYgDw2Bxw5e
@cookingwithsimon
cookingwithsimon marked this pull request as ready for review October 16, 2026 00:00
claude and others added 10 commits October 16, 2026 00:10
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KZvcgLYKFKnCYgDw2Bxw5e
…ast receive on Windows

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KZvcgLYKFKnCYgDw2Bxw5e
…on't linger

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KZvcgLYKFKnCYgDw2Bxw5e
…old Realtek USB drivers

Hardware testing hit a Realtek RTL8153 USB adapter on Windows' 2015 inbox
driver that stops receiving a few seconds after link-up while still showing
connected. That looked exactly like a silent device. The link step now turns
amber/red when nothing has been received for 20 s while the laptop kept
sending, the ping step points at it instead of blaming the device, the log
records it, and the adapter step flags the known-bad driver with how to update.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KZvcgLYKFKnCYgDw2Bxw5e
- One type scale (12/14/16/20/24/28/48) and three weights; nothing below 12 px or above SemiBold
- Spacing on the 8/4 px grid; L1 panels with 1 px subtle borders, no shadows
- One accent hue for primary actions; Stop becomes a quiet button while the status block shows the live state
- Bigger status block with a state icon, readable from arm's length
- Status checks: icon shapes per state, problem rows tinted, state word kept for screen readers
- Refresh, settings and copy become square icon buttons with tooltips and shortcuts (F5, Ctrl+,)
- Settings open as a slide-over: status stays visible, Esc or the scrim closes it, focus is trapped and restored,
  fields have bound labels and helper text, errors show on blur and clear on edit
- Device empty state gets a Start server button; device list is a framed list with hairlines and a selected state
- Verb-first button labels (Start server, Copy error details, Reset to defaults, Restore adapter)
- Serve anyway uses a named confirmation with a red Serve anyway button and Cancel as default
- Smoke test also screenshots the settings slide-over

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zksaWP7jAxjNu15h1UNgX
Trim the status block and step padding so field laptops at 1366x768 show
nearly the whole chain without scrolling.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zksaWP7jAxjNu15h1UNgX
Restyle with the design-taste skill (direction: one motif). The status LED is the
one shape, used at every scale: a giant light cropped at the edge of the status
field, a light on each check (an unlit ring before it runs, no step numbers), the
link lights on adapters and devices, and round buttons.

- Embed Figtree (text) and League Spartan (status line, device IP), both OFL
- Five sizes (13/16/20/40/64); tabular figures instead of monospace for IPs and MACs
- Faceplate palette: dark ground, surfaces a tone step up, no borders or shadows;
  status colours are the only hues and the primary button is solid ink
- Flat pill buttons with hover/press tint and an ink focus ring
- Banners are whole fields of the state colour with a status light

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zksaWP7jAxjNu15h1UNgX
A fixed 999 corner radius rendered as an ellipse in WPF; bind the radius to half
the actual height instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zksaWP7jAxjNu15h1UNgX
Redesign the main window and settings panel
@cookingwithsimon
cookingwithsimon merged commit cda6e92 into main Oct 16, 2026
1 check passed
@cookingwithsimon
cookingwithsimon deleted the phase-1 branch October 16, 2026 04:06
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.

2 participants