kanboard: move away from podman because of nftables and podman bug

This commit is contained in:
quitte 2024-09-02 11:14:02 +02:00
parent 23a5062f7b
commit 6416be37f5

View file

@ -1,33 +1,65 @@
{ config, pkgs, ... }: { pkgs, config, lib, ... }:
let let
domain = "kanboard.${config.networking.domain}"; domain = "kanboard.${config.networking.domain}";
domain_short = "kb.${config.networking.domain}"; domain_short = "kb.${config.networking.domain}";
user = "kanboard";
group = "kanboard";
in in
{ {
sops.secrets."kanboard_env" = { }; users.users.${user} = {
group = group;
isSystemUser = true;
};
users.groups.${group} = { };
virtualisation.oci-containers = { services.phpfpm.pools.kanboard = {
containers.kanboard = { user = "kanboard";
image = "ghcr.io/kanboard/kanboard:v1.2.39"; group = "kanboard";
volumes = [ settings = {
"kanboard_data:/var/www/app/data" "listen.owner" = config.services.nginx.user;
"kanboard_plugins:/var/www/app/plugins" "pm" = "dynamic";
]; "pm.max_children" = 32;
ports = [ "127.0.0.1:8045:80" ]; "pm.max_requests" = 500;
environmentFiles = [ "pm.start_servers" = 2;
config.sops.secrets."kanboard_env".path "pm.min_spare_servers" = 2;
]; "pm.max_spare_servers" = 5;
"php_admin_value[error_log]" = "stderr";
"php_admin_flag[log_errors]" = true;
"catch_workers_output" = true;
}; };
phpEnv."PATH" = lib.makeBinPath [ pkgs.php ];
}; };
services.nginx.enable = true;
services.nginx = { services.nginx = {
virtualHosts."${domain_short}" = { virtualHosts."${domain_short}" = {
locations."/".return = "301 $scheme://${domain}$request_uri"; locations."/".return = "301 $scheme://${domain}$request_uri";
}; };
virtualHosts."${domain}" = { virtualHosts."${domain}" = {
locations."/" = { root = "/srv/web/kanboard";
proxyPass = "http://127.0.0.1:8045"; extraConfig = ''
index index.html index.php;
'';
locations = {
"/" = {
tryFiles = "$uri $uri/ =404";
};
"~ \.php$" = {
extraConfig = ''
try_files $uri =404;
fastcgi_pass unix:${config.services.phpfpm.pools.kanboard.socket};
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
include ${pkgs.nginx}/conf/fastcgi_params;
include ${pkgs.nginx}/conf/fastcgi.conf;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
'';
};
"/data".return = "403";
}; };
}; };
}; };