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