Skip to content

Pin the endpoint webserver adapter explicitly - #1050

Open
DROOdotFOO wants to merge 4 commits into
masterfrom
fix/pin-endpoint-adapter
Open

DROOdotFOO wants to merge 4 commits into
masterfrom
fix/pin-endpoint-adapter

Conversation

@DROOdotFOO

@DROOdotFOO DROOdotFOO commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Summary

Pins the declared Cowboy endpoint adapter and hardens both the root development endpoint and the deployed playground listener.

  • Explicitly select Phoenix.Endpoint.Cowboy2Adapter in both endpoint configs.
  • Bound Ranch acceptors/connections and Cowboy request, header, keepalive, idle, and HTTP/2 rates.
  • Cap parsed request bodies at 1 MB with bounded read size and timeout.
  • Keep the root endpoint loopback-only by default.
  • Mount Tidewave project evaluation only for IPv4/IPv6 loopback binds; non-loopback development binds retain health serving without project evaluation.
  • Keep the existing Cowboy dependency family instead of introducing a second webserver stack.

Manual testing

  • Root application compiled with warnings as errors using the existing dependency cache
  • Root config smoke covered 127.0.0.2, ::1, 0.0.0.0, and 192.0.2.10
  • Playground config smoke verified adapter, connection cap, and body limit
  • Playground endpoint compiled; it retains the branch's pre-existing module-redefinition warning
  • git diff --check

`Raxol.Endpoint` set no `adapter:`, so it inherited Phoenix's default.
That default is Cowboy only for backwards compatibility --
`Phoenix.Endpoint.Supervisor` says so itself:

    Even though Bandit is the default in apps generated via the
    installer, we continue to use Cowboy as the default if not
    explicitly specified for backwards compatibility.
    TODO: Change this to default to Bandit in 2.0

`plug_cowboy` is this project's declared webserver and `bandit` appears
in no mix.lock anywhere in the repo, so a Phoenix 2.0 bump would have
silently repointed the endpoint at a dependency that is not present.
Naming the adapter makes the choice reviewable and turns that upgrade
into a deliberate edit instead of a boot failure.

No behaviour change today: this pins what was already resolving.

Found while establishing whether `plug_cowboy` could be dropped to
retire the cowlib advisories. It cannot -- Cowboy is live and serving --
but the silent inheritance is worth closing regardless.
@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown

Unified Regression Test Results

Workflow: Unified Regression Testing
Event: pull_request
SHA: 17487b3

Performance Results

Found 1 performance result(s)

Memory Results

Found 3 memory result(s)

Targets

  • Parser: <3μs average
  • Render: <1ms average
  • Memory: <3MB per session

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