From 5a28e1ddf9494ebc16e2e42e9d029837807084e3 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Sat, 24 Aug 2024 18:01:30 +0300 Subject: [PATCH] Git : Enable ssh. --- container/Git.nix | 8 +++++++- host/x86_64-linux/home/Network.nix | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/container/Git.nix b/container/Git.nix index 23c8311..3628c7b 100644 --- a/container/Git.nix +++ b/container/Git.nix @@ -12,6 +12,10 @@ in { default = 3000; type = types.int; }; + portSsh = mkOption { + default = 22144; + type = types.int; + }; domain = mkOption { default = "git.${config.container.domain}"; type = types.str; @@ -61,7 +65,9 @@ in { "service".DISABLE_REGISTRATION = true; "log".LEVEL = "Error"; "server" = { - DISABLE_SSH = true; + DISABLE_SSH = false; + SSH_PORT = cfg.portSsh; + START_SSH_SERVER = true; DOMAIN = cfg.domain; HTTP_ADDR = cfg.address; ROOT_URL = "https://${cfg.domain}"; diff --git a/host/x86_64-linux/home/Network.nix b/host/x86_64-linux/home/Network.nix index 2e95f3d..282b642 100644 --- a/host/x86_64-linux/home/Network.nix +++ b/host/x86_64-linux/home/Network.nix @@ -80,6 +80,10 @@ in { + (mkForward external 54631 cfg.download.address 54631 tcp) + (mkForward external 54630 cfg.download.address 54630 udp) + (mkForward external 54631 cfg.download.address 54631 udp) + + # Git ssh connections. + + (mkForward external cfg.git.portSsh cfg.git.address cfg.git.portSsh tcp) + + (mkForward internal cfg.git.portSsh cfg.git.address cfg.git.portSsh tcp) ; };