Wynne: setup forgejo
This commit is contained in:
parent
405abcfed3
commit
7c04f41412
3 changed files with 65 additions and 1 deletions
|
@ -2,6 +2,7 @@ _: {
|
||||||
imports = [
|
imports = [
|
||||||
./dendrite
|
./dendrite
|
||||||
./acomputer.lol.nix
|
./acomputer.lol.nix
|
||||||
|
./forgejo.nix
|
||||||
./ntfy.nix
|
./ntfy.nix
|
||||||
./postgresql.nix
|
./postgresql.nix
|
||||||
../../../shared/prometheus-exporters.nix
|
../../../shared/prometheus-exporters.nix
|
||||||
|
|
59
hosts/wynne/services/apps/forgejo.nix
Normal file
59
hosts/wynne/services/apps/forgejo.nix
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (import ../../../shared/caddy-helpers.nix) logFormat;
|
||||||
|
domainName = "forge.acomputer.lol";
|
||||||
|
cfg = config.services.forgejo;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services = {
|
||||||
|
caddy.virtualHosts."${domainName}" = {
|
||||||
|
logFormat = logFormat domainName;
|
||||||
|
extraConfig = ''
|
||||||
|
reverse_proxy ${cfg.settings.server.HTTP_ADDR}:${toString cfg.settings.server.HTTP_PORT}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
frp.settings.proxies = [
|
||||||
|
{
|
||||||
|
name = "http.${domainName}";
|
||||||
|
type = "http";
|
||||||
|
customDomains = [ "${domainName}" ];
|
||||||
|
localPort = 80;
|
||||||
|
transport.useCompression = true;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "https.${domainName}";
|
||||||
|
type = "https";
|
||||||
|
customDomains = [ "${domainName}" ];
|
||||||
|
localPort = 443;
|
||||||
|
transport.useCompression = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
forgejo = {
|
||||||
|
enable = true;
|
||||||
|
stateDir = "/mnt/data/Forgejo";
|
||||||
|
settings = {
|
||||||
|
database = {
|
||||||
|
DB_TYPE = lib.mkForce "postgres";
|
||||||
|
HOST = "127.0.0.1:5432";
|
||||||
|
USER = cfg.database.user;
|
||||||
|
NAME = cfg.database.name;
|
||||||
|
};
|
||||||
|
server = {
|
||||||
|
ROOT_URL = "https://${domainName}";
|
||||||
|
PROTOCOL = "http";
|
||||||
|
SSH_PORT = 42069;
|
||||||
|
HTTP_ADDR = "127.0.0.1";
|
||||||
|
HTTP_PORT = 3000;
|
||||||
|
DOMAIN = domainName;
|
||||||
|
};
|
||||||
|
session = {
|
||||||
|
COOKIE_SECURE = true;
|
||||||
|
};
|
||||||
|
service = {
|
||||||
|
DISABLE_REGISTRATION = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
database.createDatabase = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -16,12 +16,16 @@
|
||||||
host all all 10.10.10.0/24 trust
|
host all all 10.10.10.0/24 trust
|
||||||
host all all fd7c:585c:c4ae::0/64 trust
|
host all all fd7c:585c:c4ae::0/64 trust
|
||||||
'';
|
'';
|
||||||
ensureDatabases = [ "dendrite" ];
|
ensureDatabases = [ "dendrite" "forgejo" ];
|
||||||
ensureUsers = [
|
ensureUsers = [
|
||||||
{
|
{
|
||||||
name = "dendrite";
|
name = "dendrite";
|
||||||
ensureDBOwnership = true;
|
ensureDBOwnership = true;
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
name = "forgejo";
|
||||||
|
ensureDBOwnership = true;
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue