enable gitea to listen on the default ssh port for nicer clone urls

This commit is contained in:
Cyryl Płotnicki 2022-10-29 22:44:34 +01:00
parent f6fe541f34
commit ac9b3a55b8

View file

@ -1,14 +1,15 @@
{ config, pkgs, inputs, lib, ... }:
let
httpPort = 8083;
sshPort = 2222;
sshContainerPort = 22222;
sshHostPort = 22;
domain = "git.cyplo.dev";
baseurl = "https://${domain}";
path = "/var/lib/gitea";
in {
imports = [ ../nginx.nix ];
networking.firewall.allowedTCPPorts = [ sshPort ];
networking.firewall.allowedTCPPorts = [ sshHostPort ];
services.nginx = {
virtualHosts = {
"${domain}" = {
@ -29,8 +30,8 @@ in {
hostPort = httpPort;
}
{
containerPort = sshPort;
hostPort = sshPort;
containerPort = sshContainerPort;
hostPort = sshHostPort;
}
];
bindMounts = {
@ -39,7 +40,7 @@ in {
isReadOnly = false;
};
};
config = { config, pkgs, ... }: {
config = { config, pkgs, lib, ... }: {
system.stateVersion = "22.05";
services.gitea = {
enable = true;
@ -48,11 +49,14 @@ in {
httpPort = httpPort;
disableRegistration = true;
stateDir = path;
ssh = {
enable = true;
clonePort = sshPort;
settings = {
server = {
START_SSH_SERVER = true;
SSH_PORT = sshHostPort;
SSH_LISTEN_PORT = sshContainerPort;
DISABLE_SSH = false;
};
};
settings = { server = { START_SSH_SERVER = true; }; };
};
};
};