feat/wip: ssh-proxy

This commit is contained in:
FUFSoB committed 2026-09-08 23:36:47 +05:00
1 parent 9a1604554d
commit 7a106326ea
16 files changed
+990 -22

No files matched your search

+1
View File
@@ -3,6 +3,7 @@
{
imports = [
./other.nix
./ssh-proxy.nix
./amnezia-wg.nix
./legacy-sing-box.nix
./sing-box.nix
@@ -20,13 +20,13 @@ in
port = mkOption {
type = types.port;
default = 1081;
default = 1085;
description = ''
Local listen port for the proxy backend's TProxy inbound.
nftables redirection created by proxy-suite-tproxy sends intercepted
TCP/UDP traffic to this port.
'';
example = 1081;
example = 1085;
};
fwmark = mkOption {
+107
View File
@@ -0,0 +1,107 @@
# SSH dynamic SOCKS5 proxy options.
{ lib, ... }:
let
inherit (lib) mkEnableOption mkOption types;
in
{
options.services.proxy-suite.sshProxy = {
enable = mkEnableOption "SSH dynamic SOCKS5 proxy";
user = mkOption {
type = types.nullOr (types.strMatching "[^[:space:]]+");
default = null;
description = ''
SSH login user. Required when sshProxy.enable is true.
'';
example = "root";
};
host = mkOption {
type = types.nullOr (types.strMatching "[^[:space:]]+");
default = null;
description = ''
SSH server hostname or address. Required when sshProxy.enable is true.
'';
example = "ssh.example.com";
};
sshPort = mkOption {
type = types.port;
default = 22;
description = "Remote SSH server port.";
example = 22;
};
listenAddress = mkOption {
type = types.strMatching "[^[:space:]]+";
default = "127.0.0.1";
description = "Local address for the SSH-created SOCKS5 listener.";
example = "127.0.0.1";
};
listenPort = mkOption {
type = types.port;
default = 1085;
description = "Local port for the SSH-created SOCKS5 listener.";
example = 1085;
};
identityFile = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
Runtime path to the SSH private key. Leave unset to use the SSH agent
or OpenSSH's normal identity-file lookup.
'';
example = "/run/secrets/proxy-suite-ssh-key";
};
knownHostsFile = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
Optional runtime path to the known-hosts file passed to OpenSSH.
'';
example = "/run/secrets/proxy-suite-ssh-known-hosts";
};
strictHostKeyChecking = mkOption {
type = types.enum [
"yes"
"accept-new"
"no"
];
default = "accept-new";
description = ''
OpenSSH host-key verification policy. Use "yes" with pinned
knownHostsFile contents for strict verification.
'';
example = "yes";
};
extraArgs = mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
Additional arguments passed to OpenSSH before the destination.
This can be used for options such as jump hosts or agent forwarding.
'';
example = [
"-o"
"ServerAliveInterval=30"
];
};
asOutbound = mkOption {
type = types.bool;
default = false;
description = ''
Add the local SSH SOCKS5 listener as a proxy-suite outbound tagged
"ssh-proxy". Requires proxy.enable and an active SingBox or XRay
backend.
'';
example = true;
};
};
}