]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Add Chloe production and stats
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 7 Jan 2019 16:30:20 +0000 (17:30 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 7 Jan 2019 16:30:20 +0000 (17:30 +0100)
virtual/eldiron.nix
virtual/packages/chloe.json
virtual/packages/chloe.nix
virtual/packages/chloe_goaccess.conf [new file with mode: 0644]

index 3f2ba27886f188a9712cdacdced60c79789ce7ba..2e1e68db35d885703236326d88cdb9a450c55da4 100644 (file)
       occ
     ];
 
+    # FIXME: doesn't work with httpd?
+    security.acme.preliminarySelfsigned = true;
     security.acme.certs = {
-      # /!\ To create a new certificate, add first the domain to an
-      # existing certificate, deploy, and then use it in httpd.
+      # FIXME: /!\ To create a new certificate, create it before using
+      # it in httpd
       "eldiron" = {
         webroot = "/var/lib/acme/acme-challenge";
         email = "ismael@bouya.org";
           "www.piedsjaloux.fr" = null;
         };
       };
+      "chloe" = {
+        webroot = "/var/lib/acme/acme-challenge";
+        email = "ismael@bouya.org";
+        domain = "osteopathe-cc.fr";
+        plugins = [ "cert.pem" "chain.pem" "fullchain.pem" "full.pem" "key.pem" "account_key.json" ];
+        postRun = ''
+          systemctl reload httpd.service
+        '';
+        extraDomains = {
+          "www.osteopathe-cc.fr" = null;
+        };
+      };
       # "connexionswing" = {
       #   webroot = "/var/lib/acme/acme-challenge";
       #   email = "ismael@bouya.org";
           fi
         '';
       };
+      # FIXME: initial sync
       goaccess = ''
         mkdir -p /var/lib/goaccess
         mkdir -p /var/lib/goaccess/aten.pro
         mkdir -p /var/lib/goaccess/ludivinecassal.com
         mkdir -p /var/lib/goaccess/piedsjaloux.fr
+        mkdir -p /var/lib/goaccess/osteopathe-cc.fr
         '';
     };
 
             mypkgs.chloe_dev.apache.vhostConf
           ];
         })
-        (withConf "eldiron" // {
+        (withConf "chloe" // {
           hostName = "osteopathe-cc.fr";
           serverAliases = [ "www.osteopathe-cc.fr" ];
           documentRoot = mypkgs.chloe_prod.webRoot;
     services.cron = {
       enable = true;
       systemCronJobs = let
-        stats = domain: conf: "${pkgs.gnused}/bin/sed -n '/\\['$(LC_ALL=C ${pkgs.coreutils}/bin/date -d yesterday +'%d\\/%b\\/%Y')'/ p' /var/log/httpd/access_log-${domain} | ${pkgs.goaccess}/bin/goaccess -o /var/lib/goaccess/${domain}/index.html -p ${conf}";
+        stats = domain: conf: let
+          d = pkgs.writeScriptBin "stats-${domain}" "${pkgs.gnused}/bin/sed -n '/\\['$(LC_ALL=C ${pkgs.coreutils}/bin/date -d yesterday +'%d\\/%b\\/%Y')'/ p' /var/log/httpd/access_log-${domain} | ${pkgs.goaccess}/bin/goaccess -o /var/lib/goaccess/${domain}/index.html -p ${conf}";
+          in "${d}/bin/stats-${domain}";
       in [
         "5 0 * * * root ${stats "aten.pro" ./packages/aten_goaccess.conf}"
         "5 0 * * * root ${stats "ludivinecassal.com" ./packages/ludivinecassal_goaccess.conf}"
         "5 0 * * * root ${stats "piedsjaloux.fr" ./packages/piedsjaloux_goaccess.conf}"
+        "5 0 * * * root ${stats "osteopathe-cc.fr" ./packages/chloe_goaccess.conf}"
         ];
     };
   };
index d9cf6514fbe135309406b76d2c5c80396c313443..686d751e55a2e76ab59a563f0fe0ecf40782c160 100644 (file)
@@ -1,5 +1,5 @@
 {
-  "tag": "1a2ef9a-master",
+  "tag": "96fc4eb-master",
   "meta": {
     "name": "chloe",
     "url": "gitolite@git.immae.eu:perso/Immae/Sites/Chloe",
@@ -7,8 +7,8 @@
   },
   "git": {
     "url": "gitolite@git.immae.eu:perso/Immae/Sites/Chloe",
-    "rev": "1a2ef9acee91792e8096854919f0a2f005a3f481",
-    "sha256": "1h10d2bgvpkm7yi7sbshfi3h50fx202jgnfwiarq5wm947f9phrn",
+    "rev": "96fc4eb0099a29b0f9a58fb4eaec4bf14ac65f0a",
+    "sha256": "0mf15j6z86j2smm2k360cmm5djhcjbs9949pznwi57kw97vkm1s3",
     "fetchSubmodules": true
   }
 }
index 2ca1d6fa889bd6c1b136ff67be99acf6f3d966c5..728855839f758e4b6a0556f755d5ea68032c6aad 100644 (file)
@@ -85,7 +85,9 @@ let
           Require ldap-group cn=chloe.immae.eu,cn=httpd,ou=services,dc=immae,dc=eu
           ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://osteopathe-cc.fr\"></html>"
         </Location>
-        '' else ""}
+        '' else ''
+        Use Stats osteopathe-cc.fr
+        ''}
         '';
     };
     activationScript = {
diff --git a/virtual/packages/chloe_goaccess.conf b/virtual/packages/chloe_goaccess.conf
new file mode 100644 (file)
index 0000000..89cff6d
--- /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/osteopathe-cc.fr
+
+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
+
+