2024-04-19 17:11:03 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2022-04-30 20:43:12 +00:00
|
|
|
|
2023-09-27 21:24:23 +00:00
|
|
|
{
|
2024-04-19 17:11:03 +00:00
|
|
|
hacc.containers.uffd = {
|
|
|
|
config = { config, lib, pkgs, ... }: {
|
2022-04-30 20:43:12 +00:00
|
|
|
services.uwsgi = {
|
|
|
|
enable = true;
|
|
|
|
plugins = [ "python3" ];
|
|
|
|
instance = {
|
|
|
|
type = "normal";
|
2023-09-27 21:24:23 +00:00
|
|
|
pythonPackages = _: [ pkgs.uffd ];
|
2022-04-30 20:43:12 +00:00
|
|
|
module = "uffd:create_app()";
|
|
|
|
# socket = "${config.services.uwsgi.runDir}/uwsgi.sock";
|
|
|
|
http = ":8080";
|
|
|
|
env = [
|
|
|
|
"CONFIG_PATH=/persist/uffd/uffd.conf"
|
|
|
|
];
|
2023-09-27 21:24:23 +00:00
|
|
|
hook-pre-app = "exec:FLASK_APP=${pkgs.uffd}/lib/python3.10/site-packages/uffd flask db upgrade";
|
2022-04-30 20:43:12 +00:00
|
|
|
};
|
|
|
|
};
|
2024-04-19 17:11:03 +00:00
|
|
|
};
|
2022-04-30 20:43:12 +00:00
|
|
|
};
|
|
|
|
services.nginx.virtualHosts."login.infra4future.de" = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
locations = {
|
|
|
|
"/".proxyPass = "http://${config.containers.uffd.localAddress}:8080";
|
2023-09-27 21:24:23 +00:00
|
|
|
"/static".root = "${pkgs.uffd}/lib/python3.10/site-packages/uffd";
|
2022-05-02 15:53:27 +00:00
|
|
|
"/static/hacc.png".return = "302 https://infra4future.de/assets/img/logo_vernetzung.png";
|
|
|
|
"/static/infra4future.svg".return = "302 https://infra4future.de/assets/img/infra4future.svg";
|
2022-05-02 16:28:37 +00:00
|
|
|
"/static/hedgedoc.svg".return = "302 https://infra4future.de/assets/img/icons/hedgedoc.svg";
|
|
|
|
"/static/mattermost.svg".return = "302 https://infra4future.de/assets/img/icons/mattermost.svg";
|
|
|
|
"/static/nextcloud.svg".return = "302 https://infra4future.de/assets/img/icons/nextcloud.svg";
|
|
|
|
"/static/hot_shit.svg".return = "302 https://infra4future.de/assets/img/icons/hot_shit.svg";
|
2022-04-30 20:43:12 +00:00
|
|
|
};
|
|
|
|
};
|
2022-07-09 08:40:36 +00:00
|
|
|
|
|
|
|
systemd.services.auamost = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
description = "mattermost aua gruppensync";
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
after = [ "network.target" ];
|
|
|
|
serviceConfig.Type = "simple";
|
2023-09-27 16:24:18 +00:00
|
|
|
path = [ pkgs.fish pkgs.curl pkgs.jq ];
|
2024-11-11 00:12:22 +00:00
|
|
|
script = "${pkgs.hacc-scripts}/bin/uffd-sync-mattermost-groups.fish";
|
2022-07-09 17:11:30 +00:00
|
|
|
startAt = "*:0/15";
|
2022-07-09 08:40:36 +00:00
|
|
|
};
|
2023-09-27 21:33:13 +00:00
|
|
|
|
2024-10-25 16:49:04 +00:00
|
|
|
systemd.services.uffd-account-expiry-notification = {
|
|
|
|
enable = true;
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
after = [ "network.target" ];
|
|
|
|
serviceConfig.Type = "simple";
|
|
|
|
path = [ pkgs.hacc-scripts pkgs.sqlite-interactive pkgs.postfix ];
|
|
|
|
script = ''
|
|
|
|
uffd-unused-accounts-notification.scm -v admin
|
|
|
|
'';
|
|
|
|
startAt = "weekly";
|
2024-10-28 10:22:17 +00:00
|
|
|
restartIfChanged = false;
|
2024-10-25 16:49:04 +00:00
|
|
|
};
|
|
|
|
|
2023-12-30 18:03:25 +00:00
|
|
|
sops.secrets."auamost/secrets.fish" = { };
|
|
|
|
|
2023-09-27 21:33:13 +00:00
|
|
|
environment.systemPackages = with pkgs; [ curl jq ];
|
2022-04-30 20:43:12 +00:00
|
|
|
}
|