move to gitea from cgit

This commit is contained in:
Mike Cugini 2021-03-11 14:28:28 -05:00
parent 41de6bbd8a
commit c7d4d3de1a

View File

@ -13,7 +13,7 @@ in
}; };
environment.systemPackages = with pkgs; environment.systemPackages = with pkgs;
[ jq git gitolite lighttpd cgit ]; [ jq git gitolite gitea nginx ];
services.openssh.enable = true; services.openssh.enable = true;
networking.firewall.allowedTCPPorts = [ 22 80 443 ]; networking.firewall.allowedTCPPorts = [ 22 80 443 ];
@ -29,15 +29,44 @@ in
dataDir = "${storage-dir}/data/gitolite"; dataDir = "${storage-dir}/data/gitolite";
}; };
users.users.lighttpd.extraGroups = [ "gitolite" ]; services.gitea = {
services.lighttpd.enable = true;
services.lighttpd.cgit = {
enable = true; enable = true;
configText = '' stateDir = "${storage-dir}/data/gitea";
source-filter=${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py domain = "code.betamike.com";
project-list=/srv/data/gitolite/projects.list rootUrl = "https://code.betamike.com";
scan-path=/srv/data/gitolite/repositories
''; # will be reverse proxied through nginx for TLS termination
httpAddress = "localhost";
httpPort = 3000;
# only send cookies over tls
cookieSecure = true;
# TODO: enable after initial setup
disableRegistration = false;
};
services.nginx = {
enable = true;
recommendedTlsSettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedProxySettings = true;
virtualHosts = {
"code.betamike.com" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:3000";
};
};
};
};
security.acme.acceptTerms = true;
security.acme.certs = {
"code.betamike.com".email = "mike@betamike.com";
}; };
} }