Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy protocol moves tolog transport #156

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

bazsi
Copy link
Member

@bazsi bazsi commented Jun 9, 2024

This is now a complete LogTransport based implementation of the HAProxy protocol so it applies cleanly to any kind of LogProto implementation.

@bazsi bazsi force-pushed the proxy-protocol-moves-tolog-transport branch from 4ba6ca2 to a496b05 Compare September 15, 2024 17:50
@bazsi bazsi force-pushed the proxy-protocol-moves-tolog-transport branch 4 times, most recently from 5588b6a to 053c429 Compare September 18, 2024 08:04
@bazsi bazsi force-pushed the proxy-protocol-moves-tolog-transport branch 2 times, most recently from 1e92e02 to a8c2436 Compare September 20, 2024 21:50
@bazsi bazsi force-pushed the proxy-protocol-moves-tolog-transport branch 2 times, most recently from 514c8a2 to ad432b0 Compare September 25, 2024 15:18
@alltilla
Copy link
Member

style check fails on this:

--- a/modules/afsocket/transport-mapper-inet.c
+++ b/modules/afsocket/transport-mapper-inet.c
@@ -91,8 +91,8 @@ _setup_socket_transport(TransportMapperInet *self, LogTransportStack *stack)
 {
   log_transport_stack_add_transport(stack, LOG_TRANSPORT_SOCKET,
                                     self->super.sock_type == SOCK_DGRAM
-                                           ? log_transport_udp_socket_new(stack->fd)
-                                           : log_transport_stream_socket_new(stack->fd));
+                                    ? log_transport_udp_socket_new(stack->fd)
+                                    : log_transport_stream_socket_new(stack->fd));
   return TRUE;
 }

These are interdependent interfaces and LogTransportStack will be the
sole user of LogTransportFactory.

Signed-off-by: Balazs Scheidler <[email protected]>
Instead of relying on the factory to initialize name, initialize it
through the normal constructor path.

Signed-off-by: Balazs Scheidler <[email protected]>
…a stack of LogTransports

Instead of trying to reuse the LogTransport interface and hide cases where
we need multiple swappable LogTransports, let's introduce a
LogTransportStack, that explicitly tracks all such LogTransports, takes
care of their lifecycle and allows them to be swapped during a connection.

To be used for HA Proxy protocol support.

Signed-off-by: Balazs Scheidler <[email protected]>
Signed-off-by: Balazs Scheidler <[email protected]>
@bazsi bazsi force-pushed the proxy-protocol-moves-tolog-transport branch from ad432b0 to d9d4897 Compare October 11, 2024 15:00
alexb271 and others added 6 commits October 16, 2024 14:34
This patch is based on the LogTransport implementation in
github.com/syslog-ng/syslog-ng, which in turn is based on my original
implementation of proxy support as a LogProto class.

Signed-off-by: Alex Becker <[email protected]>
Signed-off-by: Hofi <[email protected]>
Signed-off-by: Balazs Scheidler <[email protected]>
Signed-off-by: Alex Becker <[email protected]>
Signed-off-by: Hofi <[email protected]>
…e loggen with proper `proxied` switches

Signed-off-by: Hofi <[email protected]>
@bazsi bazsi force-pushed the proxy-protocol-moves-tolog-transport branch from d9d4897 to 1774231 Compare October 16, 2024 12:34
@bazsi
Copy link
Member Author

bazsi commented Oct 16, 2024

I've fixed up the outstanding review notes and made sure the CI is green.

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.

4 participants