2024-06-06 20:37:23 +08:00
|
|
|
{ config, ... }:
|
2024-06-03 21:05:04 +08:00
|
|
|
|
|
|
|
{
|
|
|
|
services.forgejo = {
|
|
|
|
enable = true;
|
|
|
|
stateDir = "/srv/services/forgejo";
|
|
|
|
settings = {
|
|
|
|
server = {
|
|
|
|
DOMAIN = "git.sajenim.dev";
|
|
|
|
ROOT_URL = "https://git.sajenim.dev";
|
|
|
|
HTTP_PORT = 3131;
|
|
|
|
LANDING_PAGE = "/jasmine";
|
|
|
|
};
|
|
|
|
service = {
|
|
|
|
DISABLE_REGISTRATION = true;
|
|
|
|
};
|
|
|
|
log.LEVEL = "Info";
|
|
|
|
};
|
|
|
|
};
|
2024-06-05 21:14:22 +08:00
|
|
|
|
|
|
|
services.traefik.dynamicConfigOptions.http.routers = {
|
|
|
|
forgejo = {
|
|
|
|
rule = "Host(`git.sajenim.dev`)";
|
|
|
|
entryPoints = [
|
|
|
|
"websecure"
|
|
|
|
];
|
|
|
|
middlewares = [
|
2024-06-20 22:16:50 +08:00
|
|
|
"crowdsec"
|
2024-06-05 21:14:22 +08:00
|
|
|
"geoblock"
|
|
|
|
];
|
|
|
|
service = "forgejo";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.traefik.dynamicConfigOptions.http.services = {
|
|
|
|
forgejo.loadBalancer.servers = [
|
2024-06-06 20:37:23 +08:00
|
|
|
{ url = "http://127.0.0.1:${toString config.services.forgejo.settings.server.HTTP_PORT}"; }
|
2024-06-05 21:14:22 +08:00
|
|
|
];
|
|
|
|
};
|
2024-06-03 21:05:04 +08:00
|
|
|
}
|
2024-06-05 21:14:22 +08:00
|
|
|
|