From f759f52e50c1099724c0a172cbebfdcb0823a25f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Wed, 30 Jan 2019 09:54:43 +0100 Subject: [PATCH] Add Immae's website Fixes https://git.immae.eu/mantisbt/view.php?id=76 --- nixops/modules/websites/default.nix | 2 + nixops/modules/websites/ftp/immae.nix | 69 +++++++++++++ .../modules/websites/ftp/immae_goaccess.conf | 99 +++++++++++++++++++ 3 files changed, 170 insertions(+) create mode 100644 nixops/modules/websites/ftp/immae.nix create mode 100644 nixops/modules/websites/ftp/immae_goaccess.conf diff --git a/nixops/modules/websites/default.nix b/nixops/modules/websites/default.nix index 1093617..4c9c7fe 100644 --- a/nixops/modules/websites/default.nix +++ b/nixops/modules/websites/default.nix @@ -97,6 +97,7 @@ in ./ftp/nassime.nix ./ftp/florian.nix ./ftp/denisejerome.nix + ./ftp/immae.nix ./tools/db ./tools/tools ./tools/dav @@ -199,6 +200,7 @@ in services.myWebsites.DeniseJerome.production.enable = cfg.production.enable; services.myWebsites.Emilia.production.enable = cfg.production.enable; services.myWebsites.Capitaines.production.enable = cfg.production.enable; + services.myWebsites.Immae.production.enable = cfg.production.enable; services.myWebsites.Chloe.integration.enable = cfg.integration.enable; services.myWebsites.Ludivine.integration.enable = cfg.integration.enable; diff --git a/nixops/modules/websites/ftp/immae.nix b/nixops/modules/websites/ftp/immae.nix new file mode 100644 index 0000000..6acfe44 --- /dev/null +++ b/nixops/modules/websites/ftp/immae.nix @@ -0,0 +1,69 @@ +{ lib, pkgs, config, myconfig, mylibs, ... }: +let + cfg = config.services.myWebsites.Immae; + varDir = "/var/lib/ftp/immae"; + env = myconfig.env.websites.immae; +in { + options.services.myWebsites.Immae = { + production = { + enable = lib.mkEnableOption "enable Immae's website"; + }; + }; + + imports = [ + ../commons/stats.nix + ]; + + config = lib.mkIf cfg.production.enable { + services.myWebsites.commons.stats.enable = true; + services.myWebsites.commons.stats.sites = [ + { + name = "www.immae.eu"; + conf = ./immae_goaccess.conf; + } + ]; + + security.acme.certs."eldiron".extraDomains."www.immae.eu" = null; + + services.myPhpfpm.poolConfigs.immae = '' + listen = /run/phpfpm/immae.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.production.modules = [ "proxy_fcgi" ]; + services.myWebsites.production.vhostConfs.immae = { + certName = "eldiron"; + hosts = [ "www.immae.eu" ]; + root = varDir; + extraConfig = [ + '' + Use Stats www.immae.eu + + + SetHandler "proxy:unix:/run/phpfpm/immae.sock|fcgi://localhost" + + + + DirectoryIndex index.php index.htm index.html + Options Indexes FollowSymLinks MultiViews Includes + AllowOverride All + Require all granted + + + + Use LDAPConnect + Require ldap-group cn=blog,cn=immae.eu,ou=services,dc=immae,dc=eu + + '' + ]; + }; + }; +} diff --git a/nixops/modules/websites/ftp/immae_goaccess.conf b/nixops/modules/websites/ftp/immae_goaccess.conf new file mode 100644 index 0000000..db65335 --- /dev/null +++ b/nixops/modules/websites/ftp/immae_goaccess.conf @@ -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/www.immae.eu + +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 + + -- 2.41.0