enable gitea to listen on the default ssh port for nicer clone urls
This commit is contained in:
parent
f6fe541f34
commit
ac9b3a55b8
1 changed files with 13 additions and 9 deletions
|
@ -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; }; };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue