X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fprivate%2Fwebsites%2Fressourcerie_banon%2Fproduction.nix;fp=modules%2Fprivate%2Fwebsites%2Fressourcerie_banon%2Fproduction.nix;h=0000000000000000000000000000000000000000;hb=1a64deeb894dc95e2645a75771732c6cc53a79ad;hp=fa00d92c754925c44a55d1beb622878fbb6d94cc;hpb=fa25ffd4583cc362075cd5e1b4130f33306103f0;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/websites/ressourcerie_banon/production.nix b/modules/private/websites/ressourcerie_banon/production.nix deleted file mode 100644 index fa00d92..0000000 --- a/modules/private/websites/ressourcerie_banon/production.nix +++ /dev/null @@ -1,70 +0,0 @@ -{ lib, pkgs, config, ... }: -let - cfg = config.myServices.websites.ressourcerie_banon.production; - varDir = "/var/lib/ftp/ressourcerie_banon"; - apacheUser = config.services.httpd.Prod.user; - apacheGroup = config.services.httpd.Prod.group; -in { - options.myServices.websites.ressourcerie_banon.production.enable = lib.mkEnableOption "enable Ressourcerie Banon's website"; - - config = lib.mkIf cfg.enable { - services.webstats.sites = [ { name = "ressourcerie-banon.org"; } ]; - - system.activationScripts.ressourcerie_banon = { - deps = [ "httpd" ]; - text = '' - install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d /var/lib/php/sessions/ressourcerie_banon - ''; - }; - systemd.services.phpfpm-ressourcerie_banon.after = lib.mkAfter [ "mysql.service" ]; - systemd.services.phpfpm-ressourcerie_banon.wants = [ "mysql.service" ]; - services.phpfpm.pools.ressourcerie_banon = { - user = apacheUser; - group = apacheGroup; - settings = { - "listen.owner" = apacheUser; - "listen.group" = apacheGroup; - - "pm" = "ondemand"; - "pm.max_children" = "5"; - "pm.process_idle_timeout" = "60"; - - "php_admin_value[open_basedir]" = "/var/lib/php/sessions/ressourcerie_banon:${varDir}:/tmp"; - "php_admin_value[session.save_path]" = "/var/lib/php/sessions/ressourcerie_banon"; - }; - phpOptions = config.services.phpfpm.phpOptions + '' - disable_functions = "mail" - ''; - phpPackage = pkgs.php72; - }; - services.websites.env.production.modules = [ "proxy_fcgi" ]; - services.websites.env.production.vhostConfs.ressourcerie_banon = { - certName = "ressourcerie_banon"; - certMainHost = "ressourcerie-banon.org"; - hosts = ["ressourcerie-banon.org" "www.ressourcerie-banon.org" "ressourcerie-sault.org" "www.ressourcerie-sault.org" "le-garage-autonome.org" - "www.le-garage-autonome.org"]; - root = varDir; - extraConfig = [ - '' - Use Stats ressourcerie-banon.org - - RewriteEngine on - RewriteCond "%{HTTP_HOST}" "!^ressourcerie-banon\.org$" [NC] - RewriteRule ^(.+)$ https://ressourcerie-banon.org$1 [R=302,L] - - - SetHandler "proxy:unix:${config.services.phpfpm.pools.ressourcerie_banon.socket}|fcgi://localhost" - - - - DirectoryIndex index.php index.htm index.html - Options Indexes FollowSymLinks MultiViews Includes - AllowOverride all - Require all granted - - '' - ]; - }; - }; -} -