Skip to content

feat: support private HTTP backends for external TLS termination - #2

Merged
ImMohammad20000 merged 1 commit into
mainfrom
feat/node-tls-migration
Nov 16, 2026
Merged

ImMohammad20000 merged 1 commit into
mainfrom
feat/node-tls-migration

Conversation

@ImMohammad20000

@ImMohammad20000 ImMohammad20000 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor
  • Add TLS_ENABLED with TLS enabled by default
  • Allow HTTP without certificate files when TLS is disabled
  • Default HTTP bindings to loopback and reject unsafe addresses
  • Preserve API-key authentication in both transport modes
  • Add configuration and transport tests, CI, and documentation

Summary by CodeRabbit

  • New Features

    • TLS can now be disabled for deployments where HTTPS is handled externally. When disabled, the service accepts only loopback or private node addresses; TLS remains enabled by default.
    • The service now binds to the configured node address and API port.
  • Documentation

    • Added guidance on TLS settings, backend binding, and connecting the panel securely.

- Add TLS_ENABLED with TLS enabled by default
- Allow HTTP without certificate files when TLS is disabled
- Default HTTP bindings to loopback and reject unsafe addresses
- Preserve API-key authentication in both transport modes
- Add configuration and transport tests, CI, and documentation
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Configuration now supports TLS and validated node-host settings. The server binds to the configured host and serves HTTP or HTTPS based on the TLS setting. Tests cover configuration rules and authenticated responses in both transport modes.

Changes

TLS Backend Configuration and Serving

Layer / File(s) Summary
TLS and node-host configuration
config.go, config_test.go, README.md
Configuration parses TLS_ENABLED and NODE_HOST. With TLS disabled, it accepts only valid loopback or private IP addresses. Tests cover accepted and rejected settings. The README documents TLS defaults, host rules, authentication, and deployment guidance.
Conditional server transport
main.go, transport_test.go, .github/workflows/test.yml
The server loads TLS credentials only when TLS is enabled, then serves HTTP or HTTPS on the configured host and port. Process tests check unauthenticated and API-key-authenticated responses in both modes. The workflow runs go test -race ./... on pull requests and pushes to main or dev.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant loadConfig
  participant main
  participant HTTPServer
  participant TestClient
  loadConfig-->>main: TLS setting, node host, and API port
  main->>HTTPServer: Start HTTP or HTTPS listener
  TestClient->>HTTPServer: Request root endpoint without API key
  HTTPServer-->>TestClient: 401 response
  TestClient->>HTTPServer: Request root endpoint with API key
  HTTPServer-->>TestClient: 200 response
Loading

Suggested reviewers: m03ed

Merge Risk: Minimal · up to 0a7d6

This change adds a TLS_ENABLED setting and a validated node host, so the service can run over plain HTTP behind external TLS termination. Without TLS, binding is restricted to loopback or private addresses, and API-key authentication applies in both modes. No actionable merge-blocking risk remains after review.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "feat: support private HTTP backends for external TLS termination" matches the main change. The changeset adds a TLS_ENABLED setting, binds the node host to loopback or private addresses whe…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat: support private HTTP backends for external TLS termination" matches the main change. The changeset adds a TLS_ENABLED setting, binds the node host to loopback or private addresses when TLS is disabled, and starts plain HTTP for external TLS termination. The CI workflow, README, and tests are supporting changes that the title does not need to cover.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the host and port,
Then picks the path for TLS support.
It tests a key, then tests once more,
And hears two answers from the door.
The workflow hops through every test,
While bunny logs a cozy rest.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b684e225-e521-4ac2-a895-67151e4349d2
Commits

Reviewing files that changed from the base of the PR and between dadcdc7 and 0a7d6bc.

Files selected for processing: 6

  • .github/workflows/test.yml
  • README.md
  • config.go
  • config_test.go
  • main.go
  • transport_test.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@ImMohammad20000
ImMohammad20000 merged commit 5bb0d5c into main Nov 16, 2026
2 checks passed
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