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

Redsocks #22356

Merged
merged 2 commits into from
Feb 9, 2017
Merged

Redsocks #22356

merged 2 commits into from
Feb 9, 2017

Conversation

Ekleog
Copy link
Member

@Ekleog Ekleog commented Feb 2, 2017

Motivation for this change

This change adds package redsocks and a module for it, allowing to do transparent proxifying of applications via iptables.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Hope this helps!

@mention-bot
Copy link

@Ekleog, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @bjornfor and @offlinehacker to be potential reviewers.

src = fetchFromGitHub {
owner = "darkk";
repo = "redsocks";
rev = "release-0.5";
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider factoring out the version so that it can be shared between name and rev.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, thanks!

'';
};

user = mkOption {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this need to be configurable?

Copy link
Member Author

Choose a reason for hiding this comment

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

log strictly-speaking doesn't need to be configurable, but I thought it may come in handy to people doing centralized log management to be able to directly send logs to syslog, instead of to journalctl via stderr. As it didn't add any complexity (redsocks also has this option), I decided to add it.

Do you think it would be better left out?

Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking of the user/group options; unless there's a realistic use case for using anything other than the default, please consider whether they need to be configurable.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh indeed, the email github sent me started with the line defining log, so I thought that was what you were reacting about.

I just pushed a new commit adding a redsocks user (in order to avoid horizontal privilege escalation among nobody:nogroup daemons) and making this user the user for redsocks while removing the option, is this OK with you?

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense


##### implementation
config =
let redsocks_blocks = concatMapStrings (block:
Copy link
Contributor

Choose a reason for hiding this comment

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

A small stylistic note: You can have more than one binding per let; as it is, having so many levels of strictly unnecessary lets is a bit unusual and so makes the code a bit harder to follow.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's better in latest push -f, thanks!

@Ekleog
Copy link
Member Author

Ekleog commented Feb 8, 2017

Just wanted to check current status, as I think the issues mentioned are now fixed?

@joachifm
Copy link
Contributor

joachifm commented Feb 9, 2017

Would you mind squashing into two commits, one the package and one for the module?

redsocks module: use separate user for redsocks daemon
@Ekleog
Copy link
Member Author

Ekleog commented Feb 9, 2017

Not at all, here it is!

@joachifm joachifm merged commit ca8fb93 into NixOS:master Feb 9, 2017
@joachifm
Copy link
Contributor

joachifm commented Feb 9, 2017

Thank you

@Ekleog
Copy link
Member Author

Ekleog commented Feb 9, 2017

Thanks for your feedback! 😄

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.

None yet

3 participants