diff --git a/modules/packages/server/ssh/default.nix b/modules/packages/server/ssh/default.nix index 61f6a7d1..7a491a27 100644 --- a/modules/packages/server/ssh/default.nix +++ b/modules/packages/server/ssh/default.nix @@ -24,7 +24,7 @@ inputs: vps7 = { ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF5XkdilejDAlg5hZZD0oq69k8fQpe9hIJylTo/aLRgY"; - hostnames = [ "vps7.chn.moe" "wireguard.vps7.chn.moe" "95.111.228.40" "192.168.83.2" ]; + hostnames = [ "vps7.chn.moe" "wireguard.vps7.chn.moe" "ssh.git.chn.moe" "95.111.228.40" "192.168.83.2" ]; }; "initrd.vps7" = { @@ -138,6 +138,7 @@ inputs: // { xmupc1 = { host = "xmupc1"; hostname = "office.chn.moe"; port = 6007; }; nas = { host = "nas"; hostname = "office.chn.moe"; port = 5440; }; + gitea = { host = "gitea"; hostname = "ssh.git.chn.moe"; }; }; }; }]; diff --git a/modules/services/gitea.nix b/modules/services/gitea.nix index 8dcb712c..7a97ecfc 100644 --- a/modules/services/gitea.nix +++ b/modules/services/gitea.nix @@ -17,22 +17,16 @@ inputs: lfs.enable = true; mailerPasswordFile = inputs.config.sops.secrets."gitea/mail".path; database = - { - createDatabase = false; - type = "postgres"; - passwordFile = inputs.config.sops.secrets."gitea/db".path; - }; + { createDatabase = false; type = "postgres"; passwordFile = inputs.config.sops.secrets."gitea/db".path; }; settings = { - session = - { - COOKIE_SECURE = true; - }; + session.COOKIE_SECURE = true; server = { ROOT_URL = "https://${gitea.hostname}"; DOMAIN = gitea.hostname; HTTP_PORT = 3002; + SSH_DOMAIN = "ssh.${gitea.hostname}"; }; mailer = { @@ -47,11 +41,7 @@ inputs: }; nixos.services = { - nginx = - { - enable = true; - https."${gitea.hostname}".location."/".proxy.upstream = "http://127.0.0.1:3002"; - }; + nginx = { enable = true; https."${gitea.hostname}".location."/".proxy.upstream = "http://127.0.0.1:3002"; }; postgresql.instances.gitea = {}; }; sops.secrets =