]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Add website for AtelierFringant
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 29 Sep 2021 22:20:41 +0000 (00:20 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 29 Sep 2021 22:38:14 +0000 (00:38 +0200)
modules/private/default.nix
modules/private/websites/default.nix
modules/private/websites/emilia/atelierfringant.nix [new file with mode: 0644]
nixops/secrets

index 6b64e6076cd5522276321192089fc644442647e6..5bb650743155cd7a58d45acb192f335775856e1d 100644 (file)
@@ -40,6 +40,7 @@ set = {
   deniseProduction = ./websites/denise/production.nix;
 
   emiliaMoodle = ./websites/emilia/moodle.nix;
+  emiliaAtelierFringant = ./websites/emilia/atelierfringant.nix;
 
   florianApp = ./websites/florian/app.nix;
   florianInte = ./websites/florian/integration.nix;
index ba2dde0707dc1b5d2de627a045753369854f8ab2..809f6159eb0dd035335af198557faf4402bb2798 100644 (file)
@@ -248,7 +248,10 @@ in
         production.enable = true;
       };
 
-      emilia.moodle.enable = false;
+      emilia = {
+        moodle.enable = false;
+        atelierfringant.enable = true;
+      };
 
       florian = {
         app.enable = true;
diff --git a/modules/private/websites/emilia/atelierfringant.nix b/modules/private/websites/emilia/atelierfringant.nix
new file mode 100644 (file)
index 0000000..b47452f
--- /dev/null
@@ -0,0 +1,65 @@
+{ lib, pkgs, config,  ... }:
+let
+  cfg = config.myServices.websites.emilia.atelierfringant;
+  varDir = "/var/lib/ftp/emilia/atelierfringant";
+  apacheUser = config.services.httpd.Prod.user;
+  apacheGroup = config.services.httpd.Prod.group;
+in {
+  options.myServices.websites.emilia.atelierfringant.enable = lib.mkEnableOption "enable Émilia's website";
+
+  config = lib.mkIf cfg.enable {
+    system.activationScripts.emilia_atelierfringant = {
+      deps = [ "httpd" ];
+      text = ''
+        install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d /var/lib/ftp/emilia/atelierfringant
+        install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d /var/lib/php/sessions/emilia
+        '';
+    };
+    systemd.services.phpfpm-emilia_atelierfringant.after = lib.mkAfter [ "mysql.service" ];
+    systemd.services.phpfpm-emilia_atelierfringant.wants = [ "mysql.service" ];
+    services.phpfpm.pools.emilia_atelierfringant = {
+      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/emilia:${varDir}:/tmp";
+        "php_admin_value[session.save_path]" = "/var/lib/php/sessions/emilia";
+      };
+      phpOptions = config.services.phpfpm.phpOptions + ''
+        disable_functions = "mail"
+      '';
+      phpPackage = pkgs.php72;
+    };
+    services.websites.env.production.modules = [ "proxy_fcgi" ];
+    services.websites.env.production.vhostConfs.emilia_atelierfringant = {
+      certName     = "emilia";
+      certMainHost = "atelierfringant.org";
+      hosts        = ["atelierfringant.org" "www.atelierfringant.org" ];
+      root         = varDir;
+      extraConfig  = [
+        ''
+        <FilesMatch "\.php$">
+          SetHandler "proxy:unix:${config.services.phpfpm.pools.emilia_atelierfringant.socket}|fcgi://localhost"
+        </FilesMatch>
+
+        <Location /xmlrpc.php>
+          AllowOverride None
+          Require all denied
+        </Location>
+        <Directory ${varDir}>
+          DirectoryIndex index.php index.htm index.html
+          Options Indexes FollowSymLinks MultiViews Includes
+          AllowOverride all
+          Require all granted
+        </Directory>
+          ''
+      ];
+    };
+  };
+}
index e241d6ee177132dc1847b37b900d0897a984a2e2..d5068b2f6e4a8aa7e6e487b34eef0d90e7f547ca 160000 (submodule)
@@ -1 +1 @@
-Subproject commit e241d6ee177132dc1847b37b900d0897a984a2e2
+Subproject commit d5068b2f6e4a8aa7e6e487b34eef0d90e7f547ca