X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fwebsites%2Ftools%2Ftools%2Fdefault.nix;h=97402f19176cdb0703681841793bb827f4bcf959;hb=ea3b46ee264fc1c01d62a7f3ee538b14cb6e3dca;hp=9fb2d0357858d5a6e8a5fdc1810c8912db540ff5;hpb=ea9c6fe8041faab128391a0c03ec3bde25e29fa3;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/websites/tools/tools/default.nix b/modules/private/websites/tools/tools/default.nix index 9fb2d03..97402f1 100644 --- a/modules/private/websites/tools/tools/default.nix +++ b/modules/private/websites/tools/tools/default.nix @@ -35,8 +35,12 @@ let inherit (pkgs.webapps) phpldapadmin; env = config.myEnv.tools.phpldapadmin; }; + grocy = pkgs.callPackage ./grocy.nix { + inherit (pkgs.webapps) grocy; + }; cfg = config.myServices.websites.tools.tools; + pcfg = config.services.phpfpm.pools; in { options.myServices.websites.tools.tools = { enable = lib.mkEnableOption "enable tools website"; @@ -53,6 +57,7 @@ in { services.duplyBackup.profiles = { dokuwiki = dokuwiki.backups; + grocy = grocy.backups; kanboard = kanboard.backups; rompr = rompr.backups; shaarli = shaarli.backups; @@ -88,7 +93,7 @@ in { AllowOverride all Require all granted - SetHandler "proxy:unix:/var/run/phpfpm/devtools.sock|fcgi://localhost" + SetHandler "proxy:unix:${pcfg.devtools.socket}|fcgi://localhost" '' @@ -111,20 +116,30 @@ in { AllowOverride all Require all granted - SetHandler "proxy:unix:/var/run/phpfpm/tools.sock|fcgi://localhost" + SetHandler "proxy:unix:${pcfg.tools.socket}|fcgi://localhost" '' - adminer.apache.vhostConf + (adminer.apache.vhostConf pcfg.adminer.socket) ympd.apache.vhostConf - ttrss.apache.vhostConf - wallabag.apache.vhostConf - yourls.apache.vhostConf - rompr.apache.vhostConf - shaarli.apache.vhostConf - dokuwiki.apache.vhostConf - ldap.apache.vhostConf - kanboard.apache.vhostConf + (ttrss.apache.vhostConf pcfg.ttrss.socket) + (wallabag.apache.vhostConf pcfg.wallabag.socket) + (yourls.apache.vhostConf pcfg.yourls.socket) + (rompr.apache.vhostConf pcfg.rompr.socket) + (shaarli.apache.vhostConf pcfg.shaarli.socket) + (dokuwiki.apache.vhostConf pcfg.dokuwiki.socket) + (ldap.apache.vhostConf pcfg.ldap.socket) + (kanboard.apache.vhostConf pcfg.kanboard.socket) + (grocy.apache.vhostConf pcfg.grocy.socket) + '' + Alias /paste /var/lib/fiche + + DirectoryIndex index.txt index.html + AllowOverride None + Require all granted + Options -Indexes + + '' ]; }; @@ -219,59 +234,97 @@ in { paths = [ "/var/secrets/mpd" ]; }; - services.phpfpm.pools.devtools = { - listen = "/var/run/phpfpm/devtools.sock"; - extraConfig = '' - user = wwwrun - group = wwwrun - listen.owner = wwwrun - listen.group = wwwrun - pm = dynamic - pm.max_children = 60 - pm.start_servers = 2 - pm.min_spare_servers = 1 - pm.max_spare_servers = 10 - - php_admin_value[open_basedir] = "/run/wrappers/bin/sendmail:/var/lib/ftp/devtools.immae.eu:/tmp" - ''; - phpOptions = config.services.phpfpm.phpOptions + '' - extension=${pkgs.php}/lib/php/extensions/mysqli.so - extension=${pkgs.phpPackages.redis}/lib/php/extensions/redis.so - extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so - zend_extension=${pkgs.php}/lib/php/extensions/opcache.so - ''; - }; + services.phpfpm.pools = { + tools = { + user = "wwwrun"; + group = "wwwrun"; + settings = { + "listen.owner" = "wwwrun"; + "listen.group" = "wwwrun"; + "pm" = "dynamic"; + "pm.max_children" = "60"; + "pm.start_servers" = "2"; + "pm.min_spare_servers" = "1"; + "pm.max_spare_servers" = "10"; - services.phpfpm.poolConfigs = { - adminer = adminer.phpFpm.pool; - ttrss = ttrss.phpFpm.pool; - wallabag = wallabag.phpFpm.pool; - yourls = yourls.phpFpm.pool; - rompr = rompr.phpFpm.pool; - shaarli = shaarli.phpFpm.pool; - dokuwiki = dokuwiki.phpFpm.pool; - ldap = ldap.phpFpm.pool; - kanboard = kanboard.phpFpm.pool; - tools = '' - listen = /var/run/phpfpm/tools.sock - user = wwwrun - group = wwwrun - listen.owner = wwwrun - listen.group = wwwrun - pm = dynamic - pm.max_children = 60 - pm.start_servers = 2 - pm.min_spare_servers = 1 - pm.max_spare_servers = 10 + # Needed to avoid clashes in browser cookies (same domain) + "php_value[session.name]" = "ToolsPHPSESSID"; + "php_admin_value[open_basedir]" = "/run/wrappers/bin/sendmail:/var/lib/ftp/tools.immae.eu:/tmp"; + }; + }; + devtools = { + user = "wwwrun"; + group = "wwwrun"; + settings = { + "listen.owner" = "wwwrun"; + "listen.group" = "wwwrun"; + "pm" = "dynamic"; + "pm.max_children" = "60"; + "pm.start_servers" = "2"; + "pm.min_spare_servers" = "1"; + "pm.max_spare_servers" = "10"; - ; Needed to avoid clashes in browser cookies (same domain) - php_value[session.name] = ToolsPHPSESSID - php_admin_value[open_basedir] = "/run/wrappers/bin/sendmail:/var/lib/ftp/tools.immae.eu:/tmp" - ''; + "php_admin_value[open_basedir]" = "/run/wrappers/bin/sendmail:/var/lib/ftp/devtools.immae.eu:/tmp"; + }; + phpOptions = config.services.phpfpm.phpOptions + '' + extension=${pkgs.php}/lib/php/extensions/mysqli.so + extension=${pkgs.phpPackages.redis}/lib/php/extensions/redis.so + extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so + zend_extension=${pkgs.php}/lib/php/extensions/opcache.so + ''; + }; + adminer = adminer.phpFpm; + ttrss = { + user = "wwwrun"; + group = "wwwrun"; + settings = ttrss.phpFpm.pool; + }; + wallabag = { + user = "wwwrun"; + group = "wwwrun"; + settings = wallabag.phpFpm.pool; + }; + yourls = { + user = "wwwrun"; + group = "wwwrun"; + settings = yourls.phpFpm.pool; + }; + rompr = { + user = "wwwrun"; + group = "wwwrun"; + settings = rompr.phpFpm.pool; + }; + shaarli = { + user = "wwwrun"; + group = "wwwrun"; + settings = shaarli.phpFpm.pool; + }; + dokuwiki = { + user = "wwwrun"; + group = "wwwrun"; + settings = dokuwiki.phpFpm.pool; + }; + ldap = { + user = "wwwrun"; + group = "wwwrun"; + settings = ldap.phpFpm.pool; + phpPackage = pkgs.php74; + }; + kanboard = { + user = "wwwrun"; + group = "wwwrun"; + settings = kanboard.phpFpm.pool; + }; + grocy = { + user = "wwwrun"; + group = "wwwrun"; + settings = grocy.phpFpm.pool; + }; }; system.activationScripts = { adminer = adminer.activationScript; + grocy = grocy.activationScript; ttrss = ttrss.activationScript; wallabag = wallabag.activationScript; yourls = yourls.activationScript; @@ -292,6 +345,7 @@ in { "${wallabag.apache.webappName}" = wallabag.webRoot; "${yourls.apache.webappName}" = yourls.webRoot; "${kanboard.apache.webappName}" = kanboard.webRoot; + "${grocy.apache.webappName}" = grocy.webRoot; }; services.websites.env.tools.watchPaths = [ @@ -301,6 +355,13 @@ in { restart = true; paths = [ "/var/secrets/webapps/tools-wallabag" ]; }; + + services.fiche = { + enable = true; + port = config.myEnv.ports.fiche; + domain = "tools.immae.eu/paste"; + https = true; + }; }; }