]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Add Leila’s website
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 9 Apr 2019 23:47:07 +0000 (01:47 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 9 Apr 2019 23:47:07 +0000 (01:47 +0200)
nixops/modules/websites/default.nix
nixops/modules/websites/ftp/leila.nix [new file with mode: 0644]
nixops/modules/websites/ftp/leila_chorale_goaccess.conf [new file with mode: 0644]
nixops/modules/websites/ftp/leila_goaccess.conf [new file with mode: 0644]

index 228966f77b208a717969aeeb10217d7efa433855..49dc5f7d0e55a338dff8ea102bb2fe9b79720bbd 100644 (file)
@@ -116,6 +116,7 @@ in
     ./ftp/nassime.nix
     ./ftp/florian.nix
     ./ftp/denisejerome.nix
+    ./ftp/leila.nix
     ./ftp/immae.nix
     ./ftp/release.nix
     ./ftp/temp.nix
@@ -210,6 +211,7 @@ in
     services.myWebsites.Jerome.production.enable = cfg.production.enable;
     services.myWebsites.Nassime.production.enable = cfg.production.enable;
     services.myWebsites.Florian.production.enable = cfg.production.enable;
+    services.myWebsites.Leila.production.enable = cfg.production.enable;
     services.myWebsites.DeniseJerome.production.enable = cfg.production.enable;
     services.myWebsites.Emilia.production.enable = cfg.production.enable;
     services.myWebsites.Capitaines.production.enable = cfg.production.enable;
diff --git a/nixops/modules/websites/ftp/leila.nix b/nixops/modules/websites/ftp/leila.nix
new file mode 100644 (file)
index 0000000..ae917ba
--- /dev/null
@@ -0,0 +1,104 @@
+{ lib, config, ... }:
+let
+    cfg = config.services.myWebsites.Leila;
+    varDir = "/var/lib/ftp/leila";
+in {
+  options.services.myWebsites.Leila = {
+    production = {
+      enable = lib.mkEnableOption "enable Leila's website in production";
+    };
+  };
+
+  imports = [
+    ../commons/stats.nix
+  ];
+
+  config = (lib.mkIf cfg.production.enable {
+      security.acme.certs."leila" = config.services.myCertificates.certConfig // {
+        domain = "leila.bouya.org";
+        extraDomains = {
+          "chorale.leila.bouya.org" = null;
+          "chorale-vocanta.fr.nf" = null;
+          "www.chorale-vocanta.fr.nf" = null;
+        };
+      };
+
+      services.myPhpfpm.poolConfigs.leila = ''
+        listen = /run/phpfpm/leila.sock
+        user = wwwrun
+        group = wwwrun
+        listen.owner = wwwrun
+        listen.group = wwwrun
+
+        pm = ondemand
+        pm.max_children = 5
+        pm.process_idle_timeout = 60
+
+        php_admin_value[open_basedir] = "${varDir}:/tmp"
+        '';
+
+      services.myWebsites.commons.stats.enable = true;
+      services.myWebsites.commons.stats.sites = [
+        {
+          name = "leila.bouya.org";
+          conf = ./leila_goaccess.conf;
+        }
+        {
+          name = "chorale.leila.bouya.org";
+          conf = ./leila_chorale_goaccess.conf;
+        }
+      ];
+
+      services.myWebsites.production.modules = [ "proxy_fcgi" ];
+      services.myWebsites.production.vhostConfs.leila_chorale = {
+        certName    = "leila";
+        hosts       = [ "chorale.leila.bouya.org" "chorale-vocanta.fr.nf" "www.chorale-vocanta.fr.nf" ];
+        root        = "${varDir}/Chorale";
+        extraConfig = [
+          ''
+          Use Stats chorale.leila.bouya.org
+          <Directory ${varDir}/Chorale>
+            DirectoryIndex index.php index.htm index.html
+            Options Indexes FollowSymLinks MultiViews Includes
+            AllowOverride None
+
+            Use LDAPConnect
+            Require ldap-group cn=chorale.leila.bouya.org,cn=httpd,ou=services,dc=immae,dc=eu
+
+            <FilesMatch "\.php$">
+              SetHandler "proxy:unix:/run/phpfpm/leila.sock|fcgi://localhost"
+            </FilesMatch>
+          </Directory>
+            ''
+        ];
+      };
+      services.myWebsites.production.vhostConfs.leila = {
+        certName    = "leila";
+        hosts       = [ "leila.bouya.org" ];
+        root        = varDir;
+        extraConfig = [
+          ''
+          Use Stats leila.bouya.org
+          <Directory ${varDir}/Chorale>
+            DirectoryIndex index.htm index.html
+            Options Indexes FollowSymLinks MultiViews Includes
+            AllowOverride None
+
+            Use LDAPConnect
+            Require ldap-group cn=chorale.leila.bouya.org,cn=httpd,ou=services,dc=immae,dc=eu
+
+            <FilesMatch "\.php$">
+              SetHandler "proxy:unix:/run/phpfpm/leila.sock|fcgi://localhost"
+            </FilesMatch>
+          </Directory>
+          <Directory ${varDir}>
+            DirectoryIndex index.htm index.html
+            Options Indexes FollowSymLinks MultiViews Includes
+            AllowOverride None
+            Require all granted
+          </Directory>
+            ''
+        ];
+      };
+    });
+}
diff --git a/nixops/modules/websites/ftp/leila_chorale_goaccess.conf b/nixops/modules/websites/ftp/leila_chorale_goaccess.conf
new file mode 100644 (file)
index 0000000..2c73b26
--- /dev/null
@@ -0,0 +1,99 @@
+time-format %H:%M:%S
+date-format %d/%b/%Y
+
+#sur immae.eu
+#log-format %v %h %^[%d:%t %^] "%r" %s %b "%R" "%u" $^
+
+log-format VCOMBINED
+#= %v:%^ %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
+
+html-prefs {"theme":"bright","layout":"vertical"}
+
+exclude-ip 188.165.209.148
+exclude-ip 178.33.252.96
+exclude-ip 2001:41d0:2:9c94::1
+exclude-ip 2001:41d0:2:9c94::
+exclude-ip 176.9.151.89
+exclude-ip 2a01:4f8:160:3445::
+exclude-ip 82.255.56.72
+
+no-query-string true
+
+keep-db-files true
+load-from-disk true
+db-path /var/lib/goaccess/chorale.leila.bouya.org
+
+ignore-panel REFERRERS
+ignore-panel KEYPHRASES
+
+static-file .css
+static-file .js
+static-file .jpg
+static-file .png
+static-file .gif
+static-file .ico
+static-file .jpeg
+static-file .pdf
+static-file .csv
+static-file .mpeg
+static-file .mpg
+static-file .swf
+static-file .woff
+static-file .woff2
+static-file .xls
+static-file .xlsx
+static-file .doc
+static-file .docx
+static-file .ppt
+static-file .pptx
+static-file .txt
+static-file .zip
+static-file .ogg
+static-file .mp3
+static-file .mp4
+static-file .exe
+static-file .iso
+static-file .gz
+static-file .rar
+static-file .svg
+static-file .bmp
+static-file .tar
+static-file .tgz
+static-file .tiff
+static-file .tif
+static-file .ttf
+static-file .flv
+#static-file .less
+#static-file .ac3
+#static-file .avi
+#static-file .bz2
+#static-file .class
+#static-file .cue
+#static-file .dae
+#static-file .dat
+#static-file .dts
+#static-file .ejs
+#static-file .eot
+#static-file .eps
+#static-file .img
+#static-file .jar
+#static-file .map
+#static-file .mid
+#static-file .midi
+#static-file .ogv
+#static-file .webm
+#static-file .mkv
+#static-file .odp
+#static-file .ods
+#static-file .odt
+#static-file .otf
+#static-file .pict
+#static-file .pls
+#static-file .ps
+#static-file .qt
+#static-file .rm
+#static-file .svgz
+#static-file .wav
+#static-file .webp
+
+
diff --git a/nixops/modules/websites/ftp/leila_goaccess.conf b/nixops/modules/websites/ftp/leila_goaccess.conf
new file mode 100644 (file)
index 0000000..0c508bb
--- /dev/null
@@ -0,0 +1,99 @@
+time-format %H:%M:%S
+date-format %d/%b/%Y
+
+#sur immae.eu
+#log-format %v %h %^[%d:%t %^] "%r" %s %b "%R" "%u" $^
+
+log-format VCOMBINED
+#= %v:%^ %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
+
+html-prefs {"theme":"bright","layout":"vertical"}
+
+exclude-ip 188.165.209.148
+exclude-ip 178.33.252.96
+exclude-ip 2001:41d0:2:9c94::1
+exclude-ip 2001:41d0:2:9c94::
+exclude-ip 176.9.151.89
+exclude-ip 2a01:4f8:160:3445::
+exclude-ip 82.255.56.72
+
+no-query-string true
+
+keep-db-files true
+load-from-disk true
+db-path /var/lib/goaccess/leila.bouya.org
+
+ignore-panel REFERRERS
+ignore-panel KEYPHRASES
+
+static-file .css
+static-file .js
+static-file .jpg
+static-file .png
+static-file .gif
+static-file .ico
+static-file .jpeg
+static-file .pdf
+static-file .csv
+static-file .mpeg
+static-file .mpg
+static-file .swf
+static-file .woff
+static-file .woff2
+static-file .xls
+static-file .xlsx
+static-file .doc
+static-file .docx
+static-file .ppt
+static-file .pptx
+static-file .txt
+static-file .zip
+static-file .ogg
+static-file .mp3
+static-file .mp4
+static-file .exe
+static-file .iso
+static-file .gz
+static-file .rar
+static-file .svg
+static-file .bmp
+static-file .tar
+static-file .tgz
+static-file .tiff
+static-file .tif
+static-file .ttf
+static-file .flv
+#static-file .less
+#static-file .ac3
+#static-file .avi
+#static-file .bz2
+#static-file .class
+#static-file .cue
+#static-file .dae
+#static-file .dat
+#static-file .dts
+#static-file .ejs
+#static-file .eot
+#static-file .eps
+#static-file .img
+#static-file .jar
+#static-file .map
+#static-file .mid
+#static-file .midi
+#static-file .ogv
+#static-file .webm
+#static-file .mkv
+#static-file .odp
+#static-file .ods
+#static-file .odt
+#static-file .otf
+#static-file .pict
+#static-file .pls
+#static-file .ps
+#static-file .qt
+#static-file .rm
+#static-file .svgz
+#static-file .wav
+#static-file .webp
+
+