This commit is contained in:
Jana Dönszelmann 2026-01-02 22:05:00 +01:00
parent 08eb2d41db
commit a3289c777e
No known key found for this signature in database
9 changed files with 73 additions and 7 deletions

View file

@ -2,5 +2,7 @@ _: {
imports = [
./kanidm.nix
./oauth2-proxy.nix
./pocketid.nix
];
}

View file

@ -0,0 +1,52 @@
{ config, ... }:
{
sops.secrets.pocketid = {
owner = config.services.pocket-id.user;
sopsFile = ../../../secrets/pocketid.env;
};
services.nginx.virtualHosts."auth2.donsz.nl" = {
forceSSL = true;
enableACME = true;
extraConfig = ''
proxy_busy_buffers_size 512k;
proxy_buffers 4 512k;
proxy_buffer_size 256k;
'';
locations."/".proxyPass = "http://[::1]:${toString config.services.pocket-id.settings.PORT}";
};
services.pocket-id = {
enable = true;
user = "pocket-id";
environmentFile = config.sops.secrets.pocketid.path;
settings = {
PORT = 1411;
TRUST_PROXY = true;
APP_URL = "https://auth2.donsz.nl";
ALLOW_USER_SIGNUPS = "disabled";
UI_CONFIG_DISABLED = true;
ALLOW_OWN_ACCOUNT_EDIT = true;
DB_PROVIDER = "postgres";
DB_CONNECTION_STRING = "postgres://pocketid:pocketid@localhost:5432/pocketid";
KEYS_STORAGE = "database";
METRICS_ENABLED = false;
TRACING_ENABLED = false;
ANALYTICS_DISABLED = true;
SESSION_DURATION = 1440;
SMTP_HOST = "smtp.fastmail.com";
SMTP_PORT = "587";
SMTP_FROM = "auth@donsz.nl";
SMTP_USER = "pocketid-auth";
SMTP_TLS = "starttls";
EMAIL_LOGIN_NOTIFICATION_ENABLED = true;
EMAIL_API_KEY_EXPIRATION_ENABLED = true;
EMAIL_ONE_TIME_ACCESS_AS_ADMIN_ENABLED = true;
};
};
}

View file

@ -50,6 +50,10 @@
name = "forgejo";
ensureDBOwnership = true;
}
{
name = "pocketid";
ensureDBOwnership = true;
}
];
ensureDatabases = map (i: i.name) ensureUsers;
};