Add ssh support to gitea
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
services.gitea = {
|
||||
enable = true;
|
||||
appName = "Git Server"; # A name for your Gitea instance
|
||||
|
||||
user = "git";
|
||||
group = "git";
|
||||
|
||||
settings = {
|
||||
server = {
|
||||
PROTOCOL = "http"; # Use http for now, caddy will handle https
|
||||
@@ -10,7 +14,10 @@
|
||||
ROOT_URL = "https://git.jelles.net/";
|
||||
HTTP_ADDR = "127.0.0.1";
|
||||
HTTP_PORT = 3001;
|
||||
DISABLE_SSH = true; # Disable the built-in SSH server, use HTTPS for cloning
|
||||
|
||||
START_SSH_SERVER = false;
|
||||
DISABLE_SSH = false; # Disable the built-in SSH server, use HTTPS for cloning
|
||||
SSH_PORT = 22;
|
||||
};
|
||||
|
||||
service = {
|
||||
@@ -20,4 +27,20 @@
|
||||
};
|
||||
|
||||
services.caddy.virtualHosts."git.jelles.net".extraConfig = "reverse_proxy :3001";
|
||||
|
||||
users.users.git = {
|
||||
isSystemUser = true;
|
||||
description = "Gitea Service User";
|
||||
home = config.services.gitea.stateDir;
|
||||
createHome = true;
|
||||
homeMode = "750";
|
||||
useDefaultShell = true;
|
||||
group = "git";
|
||||
};
|
||||
|
||||
users.groups.git = { };
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"Z /var/lib/gitea 0750 git git - -"
|
||||
];
|
||||
}
|
||||
|
||||
@@ -10,7 +10,10 @@ in
|
||||
settings = {
|
||||
PermitRootLogin = "no";
|
||||
PasswordAuthentication = false;
|
||||
AllowUsers = [ username ];
|
||||
AllowUsers = [
|
||||
username
|
||||
"git"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user