-
Notifications
You must be signed in to change notification settings - Fork 467
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
local api unix socket support #2213
Conversation
@cyberb: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
@cyberb: There are no area labels on this PR. You can add as many areas as you see fit.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
/kind feature |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2213 +/- ##
==========================================
- Coverage 58.22% 56.20% -2.03%
==========================================
Files 201 182 -19
Lines 27048 25433 -1615
==========================================
- Hits 15750 14295 -1455
+ Misses 9753 9613 -140
+ Partials 1545 1525 -20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Link to feature request #2197 |
I do not think I changed anything which may affect this test on windows |
@LaurenceJJones I tested this on my running instance seems ok (no tcp involved in local api). Do you have any comments? This is just a step towards total no tcp mode which involves future PRs in:
|
No, the current windows tests are not the best. I will rerun them now. |
I am going to test the PR on my system now and get back to you with any feedback. I do note currently it will all be scoped to CrowdSec as there is no bouncer integrated but it a massive first step thank you! 🎆 |
|
Is there any news or do you want me to help? |
I am reviewing, the above snippet is to fix the current version after merging to master. And here is a functional test (09_socket.bats)
Can I prepare a PR for your branch with my suggestions? |
@cyberb I'd rather have unix:///path/to/socket instead of a plain path. What do you think? |
sure, you will still need a pure path later in the code, but I am fine, I do not actually know what is the standard here, looking at other servers they all I think do pure path but in a separate config field mongo:
postgres:
|
sure, whatever is the easiest |
mmetc I think I saw somewhere that it is possible to add commits to someone else's PR (never done this myself) |
Hello, sorry for lack of reviews. Could you bring the branch up to date with latest. |
Sure np |
@LaurenceJJones done |
added functional test and version fixes |
Sorry for the delay, this will surely be merged but we'll review again and do more tests |
Merged master and solved conflicts, tested working fine. I want to add support to lua-cs-bouncer as I use i personally and want to switch across to sockets. Little bit of lua refactoring is needed but the build works, we could merge and then add support for bouncers without it hindering master. |
And to @mmetc comment about adding However, I always have a problem with add
The basic principle is no matter how many slashes you put between |
I have ported this on top of 1.5.6 changes and allow both TCP and socket at the same time, I'm preparing the PR but will be merged after release to allow some more testing |
Done in 1.6.1 |
All good thank you very much! |
Initial unix socket support, tested on my running instance.
config.yaml
Also
local_api_credentials.yaml
Will check if there are http test server tests so I can add a unix socket unit test.
Some comments:
pkg/csconfig/api.go contains too many structs in one file, it is better to split into multiple files.