X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fwebsites%2Frichie%2Fproduction.nix;h=dc2a36fb7342ff083f578f6d7a2f72874d633ffe;hb=420ca31ba31007c6802389ad01e7b04be7f1f618;hp=a6957af13937cf9b6620a64bef4e49f603a7da73;hpb=db343436f0e678ef3a97e6f8ac559ffa0507e422;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/websites/richie/production.nix b/modules/private/websites/richie/production.nix index a6957af..dc2a36f 100644 --- a/modules/private/websites/richie/production.nix +++ b/modules/private/websites/richie/production.nix @@ -17,7 +17,6 @@ let sed -i "s@localedef --list-archive@localedef --list-archive /run/current-system/sw/lib/locale/locale-archive@" $out/admin/parametres.php ''; }; - webappdir = config.services.websites.webappDirsPaths.richie_production; secretPath = config.secrets.fullPaths."websites/richie/production"; apacheUser = config.services.httpd.Prod.user; apacheGroup = config.services.httpd.Prod.group; @@ -25,11 +24,9 @@ in { options.myServices.websites.richie.production.enable = lib.mkEnableOption "enable Richie's website"; config = lib.mkIf cfg.enable { - services.duplyBackup.profiles.richie_production.rootDir = vardir; services.webstats.sites = [ { name = "europe-richie.org"; } ]; - secrets.keys = [{ - dest = "websites/richie/production"; + secrets.keys."websites/richie/production" = { user = apacheUser; group = apacheGroup; permissions = "0400"; @@ -47,12 +44,10 @@ in $smtp_mailer->Auth('${smtp_mailer.user}', '${smtp_mailer.password}'); ?> ''; - }]; - services.websites.webappDirs.richie_production = richieSrc; + }; system.activationScripts.richie_production = { deps = [ "httpd" ]; text = '' - install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d /var/lib/php/sessions/richie_production install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d ${vardir} ''; }; @@ -63,12 +58,15 @@ in "listen.owner" = apacheUser; "listen.group" = apacheGroup; - "pm" = "ondemand"; - "pm.max_children" = "5"; - "pm.process_idle_timeout" = "60"; + "pm" = "dynamic"; + "pm.max_children" = "20"; + "pm.start_servers" = "2"; + "pm.min_spare_servers" = "1"; + "pm.max_spare_servers" = "3"; - "php_admin_value[open_basedir]" = "${vardir}:/var/lib/php/sessions/richie_production:${secretPath}:${richieSrc}:/tmp"; - "php_admin_value[session.save_path]" = "/var/lib/php/sessions/richie_production"; + "php_admin_value[open_basedir]" = "${vardir}:${secretPath}:${richieSrc}:/tmp"; + "php_admin_value[session.save_handler]" = "redis"; + "php_admin_value[session.save_path]" = "'unix:///run/redis-php-sessions/redis.sock?persistent=1&prefix=Richie:Production:'"; }; phpEnv = { PATH = "/run/current-system/sw/bin:${lib.makeBinPath [ pkgs.imagemagick ]}"; @@ -77,7 +75,7 @@ in phpOptions = config.services.phpfpm.phpOptions + '' date.timezone = 'Europe/Paris' ''; - phpPackage = pkgs.php72; + phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [all.redis]); }; services.websites.env.production.modules = [ "proxy_fcgi" ]; services.websites.env.production.vhostConfs.richie_production = { @@ -85,7 +83,7 @@ in addToCerts = true; certMainHost = "europe-richie.org"; hosts = [ "europe-richie.org" "www.europe-richie.org" ]; - root = webappdir; + root = richieSrc; extraConfig = [ '' Use Stats europe-richie.org @@ -93,7 +91,7 @@ in Require all denied - + DirectoryIndex index.php index.htm index.html Options Indexes FollowSymLinks MultiViews Includes AllowOverride None