feat(koi): tgauth

This commit is contained in:
alina 🌸 2024-12-29 00:05:57 +03:00
parent 6fcca6ab72
commit 04c20be5b8
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
2 changed files with 43 additions and 0 deletions

View file

@ -5,6 +5,7 @@ let
in {
imports = [
./proxy.nix
./telegram-oauth.nix
];
users.users.zitadel = {

View file

@ -0,0 +1,42 @@
{ config, ... }:
let
UID = 1123;
in {
desu.secrets.telegram-oauth-env.owner = "telegram-oauth";
users.groups.telegram-oauth = {};
users.users.telegram-oauth = {
group = "telegram-oauth";
isNormalUser = true;
uid = UID;
};
virtualisation.oci-containers.containers.telegram-oauth = {
image = "ghcr.io/teidesu/telegram-oauth:latest";
environment = {
PUBLIC_URL = "https://tgauth.stupid.fish";
REDIRECT_URL = "https://id.stupid.fish/ui/login/login/externalidp/callback";
};
environmentFiles = [
config.desu.secrets.telegram-oauth-env.path
];
user = builtins.toString UID;
extraOptions = [
"--mount=type=bind,source=/srv/telegram-oauth,target=/app/data"
];
};
systemd.tmpfiles.rules = [
"d /srv/telegram-oauth 700 ${builtins.toString UID} ${builtins.toString UID} -"
];
services.nginx.virtualHosts."tgauth.stupid.fish" = {
forceSSL = true;
useACMEHost = "stupid.fish";
locations."/" = {
proxyPass = "http://telegram-oauth.docker:3000$request_uri";
};
};
}