Skip to content

Conversation

@0xle0ne
Copy link
Member

@0xle0ne 0xle0ne commented Nov 29, 2025

No description provided.

@0xle0ne 0xle0ne requested a review from Copilot November 29, 2025 17:17
Copilot finished reviewing on behalf of 0xle0ne November 29, 2025 17:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the ncproxy component to use HAProxy instead of nginx as the underlying proxy server. The change involves replacing nginx-specific configuration templates, updating the service logic, and adapting the Docker setup accordingly.

Key changes:

  • Replaced nginx with HAProxy in the nproxy Docker container (Dockerfile and entrypoint)
  • Refactored ncproxy configuration generation from nginx to HAProxy syntax
  • Introduced a new logger subsystem to receive HAProxy syslog messages via Unix socket
  • Updated CLI to use --haproxy-dir flag with backward-compatible --nginx-dir alias

Reviewed changes

Copilot reviewed 1 out of 25 changed files in this pull request and generated no comments.

Show a summary per file
File Description
docker-compose.yaml Added image tags for nproxy and ndns services
bin/nproxy/entrypoint.sh Updated entrypoint script to use HAProxy commands and configuration paths
bin/nproxy/Dockerfile Replaced nginx packages with haproxy package installation
bin/ncproxy/src/utils/rule.rs Renamed NginxRuleKind to ProxyRuleKind, updated SSL config handling for HAProxy's combined PEM file requirements, and adjusted upstream backend generation
bin/ncproxy/src/utils/resource.rs Changed from nginx::add_rule to haproxy::add_rule
bin/ncproxy/src/utils/nginx.rs Deprecated nginx module, replaced with placeholder comment
bin/ncproxy/src/utils/mod.rs Replaced nginx module export with haproxy module, updated test configuration
bin/ncproxy/src/utils/haproxy.rs New HAProxy configuration manager implementing config generation, testing, and reload functionality with multi-file config structure
bin/ncproxy/src/subsystem/mod.rs Added logger module import
bin/ncproxy/src/subsystem/metric.rs Added HAProxy httplog format parser as fallback for metric collection
bin/ncproxy/src/subsystem/logger.rs New Unix datagram socket-based syslog receiver for HAProxy log persistence
bin/ncproxy/src/subsystem/init.rs Integrated logger spawning and updated to use haproxy_dir
bin/ncproxy/src/subsystem/event.rs Updated comments and function calls from nginx to haproxy
bin/ncproxy/src/services/rule.rs Updated rule apply/remove calls from nginx to haproxy functions
bin/ncproxy/src/models/templates/upstream.conf Converted nginx upstream block to HAProxy backend configuration
bin/ncproxy/src/models/templates/unix_upstream.conf Converted unix socket upstream to HAProxy backend with unix@ syntax
bin/ncproxy/src/models/templates/stream.conf Converted nginx stream server to HAProxy frontend with tcp mode
bin/ncproxy/src/models/templates/nginx.conf Deprecated nginx global template, replaced with reference comment
bin/ncproxy/src/models/templates/http.conf Converted nginx virtual host configuration to HAProxy ACL-based routing snippets
bin/ncproxy/src/models/templates/haproxy.cfg New HAProxy global configuration template with syslog socket logging
bin/ncproxy/src/models/template.rs Updated CONF_TEMPLATE to reference haproxy.cfg
bin/ncproxy/src/models/system.rs Updated SystemState and EventEmitter to use haproxy_dir and pass state_dir for reload
bin/ncproxy/src/models/store.rs Renamed NginxRuleKind to ProxyRuleKind, updated directory paths from sites-* to routes-*
bin/ncproxy/src/main.rs Updated documentation comments from nginx to HAProxy
bin/ncproxy/src/cli.rs Renamed nginx_dir to haproxy_dir with backward-compatible nginx-dir alias

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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