Skip to content

[codex] Fix Direct IP disabled port validation#12

Merged
seslly merged 1 commit into
mainfrom
codex/direct-port-sentinel-fix
Apr 30, 2026
Merged

[codex] Fix Direct IP disabled port validation#12
seslly merged 1 commit into
mainfrom
codex/direct-port-sentinel-fix

Conversation

@seslly

@seslly seslly commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • allows Windrose's stock DirectConnectionServerPort: -1 sentinel when UseDirectConnection is disabled
  • continues rejecting -1 when Direct IP is enabled, so enabled Direct IP still requires a real UDP port
  • surfaces server-side config staging errors in the admin UI instead of only logging the 400 response
  • adds schema coverage for disabled -1, enabled -1, and the existing out-of-range port cases

Why

Issue #10 reports that fresh installs can load a default server config with DirectConnectionServerPort: -1. The admin UI preserved that value when staging unrelated config changes, but the server schema rejected anything outside 1..65535. That made simple edits like changing ServerName fail with HTTP 400 while appearing as a no-op in the UI.

Validation

  • python3 tests/test_schema.py
  • python3 -m py_compile server.py tests/test_schema.py
  • node --check ui/app.js
  • pytest -q tests (68 passed)
  • git diff --check

Fixes #10.

@seslly
seslly marked this pull request as ready for review April 30, 2026 16:49
@seslly
seslly merged commit 624fc43 into main Apr 30, 2026
11 checks passed
@seslly
seslly deleted the codex/direct-port-sentinel-fix branch April 30, 2026 17:11
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.

BUG: Admin UI Returns HTTP 400 When Direct IP Connection Is Set to Default -1

1 participant