fix: small ssh-proxy fixes
This commit is contained in:
4 files changed
+61
-6
No files matched your search
+41
-4
@@ -190,6 +190,7 @@ Update module option docs there instead of editing this file by hand.
|
|||||||
- [knownHostsFile](#services-proxy-suite-sshproxy-knownhostsfile)
|
- [knownHostsFile](#services-proxy-suite-sshproxy-knownhostsfile)
|
||||||
- [listenAddress](#services-proxy-suite-sshproxy-listenaddress)
|
- [listenAddress](#services-proxy-suite-sshproxy-listenaddress)
|
||||||
- [listenPort](#services-proxy-suite-sshproxy-listenport)
|
- [listenPort](#services-proxy-suite-sshproxy-listenport)
|
||||||
|
- [serviceUser](#services-proxy-suite-sshproxy-serviceuser)
|
||||||
- [sshPort](#services-proxy-suite-sshproxy-sshport)
|
- [sshPort](#services-proxy-suite-sshproxy-sshport)
|
||||||
- [strictHostKeyChecking](#services-proxy-suite-sshproxy-stricthostkeychecking)
|
- [strictHostKeyChecking](#services-proxy-suite-sshproxy-stricthostkeychecking)
|
||||||
- [user](#services-proxy-suite-sshproxy-user)
|
- [user](#services-proxy-suite-sshproxy-user)
|
||||||
@@ -387,7 +388,8 @@ services.proxy-suite = {
|
|||||||
identityFile = null;
|
identityFile = null;
|
||||||
knownHostsFile = null;
|
knownHostsFile = null;
|
||||||
listenAddress = "127.0.0.1";
|
listenAddress = "127.0.0.1";
|
||||||
listenPort = 1085;
|
listenPort = 1091;
|
||||||
|
serviceUser = null;
|
||||||
sshPort = 22;
|
sshPort = 22;
|
||||||
strictHostKeyChecking = "accept-new";
|
strictHostKeyChecking = "accept-new";
|
||||||
user = null;
|
user = null;
|
||||||
@@ -670,7 +672,8 @@ services.proxy-suite = {
|
|||||||
identityFile = "/run/secrets/proxy-suite-ssh-key";
|
identityFile = "/run/secrets/proxy-suite-ssh-key";
|
||||||
knownHostsFile = "/run/secrets/proxy-suite-ssh-known-hosts";
|
knownHostsFile = "/run/secrets/proxy-suite-ssh-known-hosts";
|
||||||
listenAddress = "127.0.0.1";
|
listenAddress = "127.0.0.1";
|
||||||
listenPort = 1085;
|
listenPort = 1091;
|
||||||
|
serviceUser = "proxy";
|
||||||
sshPort = 22;
|
sshPort = 22;
|
||||||
strictHostKeyChecking = "yes";
|
strictHostKeyChecking = "yes";
|
||||||
user = "root";
|
user = "root";
|
||||||
@@ -5823,7 +5826,7 @@ Local port for the SSH-created SOCKS5 listener\.
|
|||||||
*Default:*
|
*Default:*
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
1085
|
1091
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -5831,7 +5834,41 @@ Local port for the SSH-created SOCKS5 listener\.
|
|||||||
*Example:*
|
*Example:*
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
1085
|
1091
|
||||||
|
```
|
||||||
|
|
||||||
|
*Declared by:*
|
||||||
|
- [modules/proxy-suite/options/ssh-proxy\.nix](https://github.com/FUFSoB/proxy-suite-flake/blob/main/modules/proxy-suite/options/ssh-proxy.nix)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a id="services-proxy-suite-sshproxy-serviceuser"></a>
|
||||||
|
## services\.proxy-suite\.sshProxy\.serviceUser
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Unix user for the systemd SSH proxy service\. Leave unset to use
|
||||||
|
systemd’s default user\.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
*Type:*
|
||||||
|
null or string matching the pattern \[^\[:space:]]+
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
*Default:*
|
||||||
|
|
||||||
|
```nix
|
||||||
|
null
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
*Example:*
|
||||||
|
|
||||||
|
```nix
|
||||||
|
"proxy"
|
||||||
```
|
```
|
||||||
|
|
||||||
*Declared by:*
|
*Declared by:*
|
||||||
|
|||||||
@@ -17,6 +17,16 @@ in
|
|||||||
example = "root";
|
example = "root";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
serviceUser = mkOption {
|
||||||
|
type = types.nullOr (types.strMatching "[^[:space:]]+");
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Unix user for the systemd SSH proxy service. Leave unset to use
|
||||||
|
systemd's default user.
|
||||||
|
'';
|
||||||
|
example = "proxy";
|
||||||
|
};
|
||||||
|
|
||||||
host = mkOption {
|
host = mkOption {
|
||||||
type = types.nullOr (types.strMatching "[^[:space:]]+");
|
type = types.nullOr (types.strMatching "[^[:space:]]+");
|
||||||
default = null;
|
default = null;
|
||||||
@@ -42,9 +52,9 @@ in
|
|||||||
|
|
||||||
listenPort = mkOption {
|
listenPort = mkOption {
|
||||||
type = types.port;
|
type = types.port;
|
||||||
default = 1085;
|
default = 1091;
|
||||||
description = "Local port for the SSH-created SOCKS5 listener.";
|
description = "Local port for the SSH-created SOCKS5 listener.";
|
||||||
example = 1085;
|
example = 1091;
|
||||||
};
|
};
|
||||||
|
|
||||||
identityFile = mkOption {
|
identityFile = mkOption {
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ in
|
|||||||
ExecStart = startScript;
|
ExecStart = startScript;
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
RestartSec = 5;
|
RestartSec = 5;
|
||||||
|
}
|
||||||
|
// lib.optionalAttrs (s.serviceUser != null) {
|
||||||
|
User = s.serviceUser;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -20,6 +20,7 @@ let
|
|||||||
user = "root";
|
user = "root";
|
||||||
host = "ssh.example.com";
|
host = "ssh.example.com";
|
||||||
asOutbound = true;
|
asOutbound = true;
|
||||||
|
serviceUser = "proxy";
|
||||||
identityFile = "/run/secrets/ssh-key";
|
identityFile = "/run/secrets/ssh-key";
|
||||||
knownHostsFile = "/run/secrets/ssh-known-hosts";
|
knownHostsFile = "/run/secrets/ssh-known-hosts";
|
||||||
extraArgs = [
|
extraArgs = [
|
||||||
@@ -245,6 +246,10 @@ let
|
|||||||
assert pkgs.lib.hasInfix "ServerAliveInterval=30" sshStartScript;
|
assert pkgs.lib.hasInfix "ServerAliveInterval=30" sshStartScript;
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
|
(
|
||||||
|
assert sshService.serviceConfig.User == "proxy";
|
||||||
|
true
|
||||||
|
)
|
||||||
(
|
(
|
||||||
assert !(sshService.serviceConfig ? SocketMark);
|
assert !(sshService.serviceConfig ? SocketMark);
|
||||||
true
|
true
|
||||||
|
|||||||
Reference in new issue
Block a user