2023-09-27 21:24:23 +00:00
|
|
|
{ config, lib, pkgs, evalConfig, ... }:
|
2022-04-30 20:43:12 +00:00
|
|
|
|
2023-09-27 21:24:23 +00:00
|
|
|
{
|
2022-04-30 20:43:12 +00:00
|
|
|
containers.uffd = {
|
|
|
|
privateNetwork = true;
|
|
|
|
hostAddress = "192.168.100.1";
|
|
|
|
localAddress = "192.168.100.9";
|
|
|
|
autoStart = true;
|
|
|
|
bindMounts = {
|
|
|
|
"/persist" = {
|
|
|
|
hostPath = "/persist/containers/uffd";
|
|
|
|
isReadOnly = false;
|
|
|
|
};
|
|
|
|
};
|
2023-09-27 21:24:23 +00:00
|
|
|
path = evalConfig ({ 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
|
|
|
};
|
|
|
|
};
|
2023-02-18 13:45:14 +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 ];
|
|
|
|
script = "/persist/magic/mattermost-groupsync.fish";
|
2022-07-09 17:11:30 +00:00
|
|
|
startAt = "*:0/15";
|
2022-07-09 08:40:36 +00:00
|
|
|
};
|
2022-04-30 20:43:12 +00:00
|
|
|
}
|