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

sshd: add custom options #41792

Closed
wants to merge 1 commit into from
Closed

sshd: add custom options #41792

wants to merge 1 commit into from

Conversation

Izorkin
Copy link
Contributor

@Izorkin Izorkin commented Jun 10, 2018

Motivation for this change

Add custom options - TCPKeepAlive, clientAliveCountMax and clientAliveInterval.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • 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.

@@ -290,13 +290,71 @@ in
type = types.bool;
default = false;
description = ''
Specifies whether sshd(8) should look up the remote host name, and to check that the resolved host name for
Specifies whether sshd should look up the remote host name, and to check that the resolved host name for
Copy link
Contributor

Choose a reason for hiding this comment

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

That (8) is desirable there and can just stay there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Revert

the remote IP address maps back to the very same IP address.
If this option is set to no (the default) then only addresses and not host names may be used in
~/.ssh/authorized_keys from and sshd_config Match Host directives.
'';
};

useTCPKeepAlive = mkOption {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is problematic from a maintenance point of view. I'd expect this to be auto-generated from some sources, which you don't seem to provide, which means that in two years it will be out of date and broken for someone.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Me use official documentation - https://man.openbsd.org/sshd_config#TCPKeepAlive Renamed to tcpKeepAlive

Copy link
Contributor

Choose a reason for hiding this comment

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

The concern is that you did a manual copy/paste of documentation, which means that if the source ever updates their data, that our module is out of date (and won't be updated unless someone does manual work).

Renaming it doesn't address my raised concern.

You might be lucky and it will still be merged regardless, but I'd count it as an increase in technical debt for the project.

'' else ''
X11Forwarding no
''}
${if cfg.forwardX11
Copy link
Contributor

Choose a reason for hiding this comment

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

You are now just deleting newlines, which might mean the subsequent configuration is concatenated resulting in invalid configuration (didn't check, but that's why I believe it was done like that).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Me tested to local VM - the configuration is generated normally

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, thanks for the confirmation.

Copy link
Contributor

@coretemp coretemp left a comment

Choose a reason for hiding this comment

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

Improving the module is great, but I think it should be done in a sustainable fashion, which this is not.

@oxij
Copy link
Member

oxij commented Jun 14, 2018 via email

@FRidh
Copy link
Member

FRidh commented Jul 21, 2018

NixOS options are only added when they add value, not when they just shadow the options provided by the tool. Providing all options is just code bloat and we will always be behind upstream.

@FRidh FRidh closed this Jul 21, 2018
@Izorkin Izorkin deleted the sshd-custom branch July 21, 2018 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants