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

Add common proxy solution for all the supported transport methods that works transparently in the network() and the syslog() sources #4544

Merged
merged 17 commits into from
Jun 7, 2024

Conversation

alexb271
Copy link
Collaborator

Resolves #4388

A new logtransport class for proxied socket has been implemented based on code from the proxied text server.

If everything is good then theoretically the new logtransport could allow deleting the proxied text server code in favor of configuring a regular text server with this new transport, however nothing has been deleted yet in this PR.

@alexb271 alexb271 changed the title Implement proxied socket logtransport and enable the transport(proxied-tcp) option for the syslig source driver Implement proxied socket logtransport and enable the transport(proxied-tcp) option for the syslog source driver Jul 11, 2023
@alexb271 alexb271 requested a review from bazsi July 12, 2023 11:27
alexb271 added a commit to alexb271/syslog-ng that referenced this pull request Jul 17, 2023
@MrAnno MrAnno added this to the syslog-ng 4.4 milestone Jul 21, 2023
@MrAnno MrAnno self-requested a review July 24, 2023 15:11
@bazsi
Copy link
Collaborator

bazsi commented Sep 7, 2023

First of all, sorry for this taking this long. I find I have less than the ideal amount of time to do code level changes to syslog-ng these days.

This looks so MUCH better than the previous iteration, thanks for doing it.

One more ask: can you please also remove the entire old implementation as well? The check for transport(proxied-tcp) will shadow the old implementation anyway, so it's going to be just dead code. If anything wrong comes up with this implementation we would fix it instead of going back to the old one.

@OverOrion OverOrion self-requested a review September 19, 2023 09:02
@MrAnno MrAnno removed their request for review September 19, 2023 09:02
@MrAnno MrAnno removed this from the syslog-ng 4.4 milestone Sep 19, 2023
alexb271 added a commit to alexb271/syslog-ng that referenced this pull request Sep 22, 2023
@alexb271
Copy link
Collaborator Author

First of all, sorry for this taking this long. I find I have less than the ideal amount of time to do code level changes to syslog-ng these days.

This looks so MUCH better than the previous iteration, thanks for doing it.

One more ask: can you please also remove the entire old implementation as well? The check for transport(proxied-tcp) will shadow the old implementation anyway, so it's going to be just dead code. If anything wrong comes up with this implementation we would fix it instead of going back to the old one.

Thank you for the review!

I have added commits to remove the proxied text server. It was used by the network driver originally, not the syslog driver, so I had to make a few tweaks in order to keep the network driver functioning correctly.

@MrAnno MrAnno added this to the syslog-ng 4.5 milestone Oct 2, 2023
alexb271 added a commit to alexb271/syslog-ng that referenced this pull request Oct 5, 2023
alexb271 added a commit to alexb271/syslog-ng that referenced this pull request Oct 5, 2023
alexb271 added a commit to alexb271/syslog-ng that referenced this pull request Oct 5, 2023
Copy link
Collaborator

@OverOrion OverOrion left a comment

Choose a reason for hiding this comment

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

I am still doing the review, currently halfway through at commit 937bb62, but wanted to give some feedback already.

The overall big picture is nice and clean so far.

lib/transport/transport-proxied-socket.c Outdated Show resolved Hide resolved
lib/transport/transport-proxied-socket.c Outdated Show resolved Hide resolved
lib/transport/transport-proxied-socket.c Outdated Show resolved Hide resolved
lib/transport/transport-proxied-socket.c Outdated Show resolved Hide resolved
lib/transport/transport-proxied-socket.c Outdated Show resolved Hide resolved
@alexb271
Copy link
Collaborator Author

alexb271 commented Oct 9, 2023

I am still doing the review, currently halfway through at commit 937bb62, but wanted to give some feedback already.

The overall big picture is nice and clean so far.

Thank you for your reply! Just to avoid any misunderstandings, I did not write the PROXY implementation, my PR is a refactor to move proxy processing into the logtransport layer so that it can be enabled for the syslog source driver. Because of this, I do not know what the magic numbers stand for. However, I can try to address smaller issues like adding typedefs and such.

@OverOrion
Copy link
Collaborator

Thanks for the clarification, I started the review by going through each commit and did not realize until now that it was a simple move (lib/logproto/logproto-proxied-text-server.c -> lib/transport/transport-proxied-socket.c). I will check the diff first and then go through the commits, and close my notes where I think it is not really relevant in this PR. Sorry for the confusion!

I see that the CI is failing due to the light test case test_pp_tls failing, maybe a followup is needed here as well? (I haven't checked it thoroughly yet, just guessing).

@alexb271
Copy link
Collaborator Author

I see that the CI is failing due to the light test case test_pp_tls failing, maybe a followup is needed here as well? (I haven't checked it thoroughly yet, just guessing).

I've tried to replicate the TLS functionality in the new logtransport as it was in the ProxiedTextServer. Unfortunately I don't have much experience with tls in syslog, so I would need some help fixing it if it's not working.

@HofiOne
Copy link
Collaborator

HofiOne commented Nov 17, 2023

I see that the CI is failing due to the light test case test_pp_tls failing, maybe a followup is needed here as well? (I haven't checked it thoroughly yet, just guessing).

I've tried to replicate the TLS functionality in the new logtransport as it was in the ProxiedTextServer. Unfortunately I don't have much experience with tls in syslog, so I would need some help fixing it if it's not working.

@alexb271 would you still work on this or should/may I try to finish?

@alexb271
Copy link
Collaborator Author

I see that the CI is failing due to the light test case test_pp_tls failing, maybe a followup is needed here as well? (I haven't checked it thoroughly yet, just guessing).

I've tried to replicate the TLS functionality in the new logtransport as it was in the ProxiedTextServer. Unfortunately I don't have much experience with tls in syslog, so I would need some help fixing it if it's not working.

@alexb271 would you still work on this or should/may I try to finish?

I'm not actively troubleshooting this right now, so of course you would be welcome to investigate or finish it. If the solution turns out to be something very simple I've missed I can fix that too if required.

@HofiOne HofiOne self-assigned this Nov 17, 2023
@HofiOne
Copy link
Collaborator

HofiOne commented Nov 17, 2023

@alexb271 would you still work on this or should/may I try to finish?

I'm not actively troubleshooting this right now, so of course you would be welcome to investigate or finish it. If the solution turns out to be something very simple I've missed I can fix that too if required.

I do not know if it's possible correctly,(or what is the simplest solution here), but could you please give me rights to this fork (it seems github allows forking of a fork only if I do not yet have my own fork of the same origin), I do not want to move this branch or create a new PR later on, the best would be if I could just simply edit here anything

@HofiOne
Copy link
Collaborator

HofiOne commented Jun 5, 2024

Please also fix all the copyrights too

The copyright is incorrect in most of the files, it needs a separate run that corrects all of them, what more, something automatic if we want to follow the actual date in each year.

@HofiOne HofiOne requested review from kovgeri01 and removed request for bazsi June 5, 2024 11:20
@kira-syslogng
Copy link
Contributor

Build FAILURE

alexb271 and others added 17 commits June 5, 2024 21:05
…the logproto proxied text server

Signed-off-by: Alex Becker <[email protected]>
Signed-off-by: Hofi <[email protected]>
Signed-off-by: Alex Becker <[email protected]>
Signed-off-by: Hofi <[email protected]>
…ansport and use regular and tls transports

Signed-off-by: Alex Becker <[email protected]>
Signed-off-by: Hofi <[email protected]>
Signed-off-by: Alex Becker <[email protected]>
Signed-off-by: Hofi <[email protected]>
… class itself, not inherited from LogTransport anymore

Only the network() source is tested and working yet, syslog() is a TODO
Signed-off-by: Hofi <[email protected]>
…e loggen with proper `proxied` switches

Signed-off-by: Hofi <[email protected]>
@kira-syslogng
Copy link
Contributor

Build FAILURE

@kovgeri01
Copy link
Collaborator

@kira-syslogng test this please;

@HofiOne HofiOne merged commit 53ba917 into syslog-ng:master Jun 7, 2024
20 checks passed
HofiOne pushed a commit to HofiOne/syslog-ng that referenced this pull request Jun 10, 2024
Signed-off-by: Alex Becker <[email protected]>
Signed-off-by: Hofi <[email protected]>
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.

The syslog source driver does not work with the transport(proxied-tcp) option
8 participants