aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--virtual/eldiron.nix27
-rw-r--r--virtual/packages/chloe.json6
-rw-r--r--virtual/packages/chloe.nix4
-rw-r--r--virtual/packages/chloe_goaccess.conf99
4 files changed, 128 insertions, 8 deletions
diff --git a/virtual/eldiron.nix b/virtual/eldiron.nix
index 3f2ba27..2e1e68d 100644
--- a/virtual/eldiron.nix
+++ b/virtual/eldiron.nix
@@ -99,9 +99,11 @@
99 occ 99 occ
100 ]; 100 ];
101 101
102 # FIXME: doesn't work with httpd?
103 security.acme.preliminarySelfsigned = true;
102 security.acme.certs = { 104 security.acme.certs = {
103 # /!\ To create a new certificate, add first the domain to an 105 # FIXME: /!\ To create a new certificate, create it before using
104 # existing certificate, deploy, and then use it in httpd. 106 # it in httpd
105 "eldiron" = { 107 "eldiron" = {
106 webroot = "/var/lib/acme/acme-challenge"; 108 webroot = "/var/lib/acme/acme-challenge";
107 email = "ismael@bouya.org"; 109 email = "ismael@bouya.org";
@@ -159,6 +161,18 @@
159 "www.piedsjaloux.fr" = null; 161 "www.piedsjaloux.fr" = null;
160 }; 162 };
161 }; 163 };
164 "chloe" = {
165 webroot = "/var/lib/acme/acme-challenge";
166 email = "ismael@bouya.org";
167 domain = "osteopathe-cc.fr";
168 plugins = [ "cert.pem" "chain.pem" "fullchain.pem" "full.pem" "key.pem" "account_key.json" ];
169 postRun = ''
170 systemctl reload httpd.service
171 '';
172 extraDomains = {
173 "www.osteopathe-cc.fr" = null;
174 };
175 };
162 # "connexionswing" = { 176 # "connexionswing" = {
163 # webroot = "/var/lib/acme/acme-challenge"; 177 # webroot = "/var/lib/acme/acme-challenge";
164 # email = "ismael@bouya.org"; 178 # email = "ismael@bouya.org";
@@ -280,11 +294,13 @@
280 fi 294 fi
281 ''; 295 '';
282 }; 296 };
297 # FIXME: initial sync
283 goaccess = '' 298 goaccess = ''
284 mkdir -p /var/lib/goaccess 299 mkdir -p /var/lib/goaccess
285 mkdir -p /var/lib/goaccess/aten.pro 300 mkdir -p /var/lib/goaccess/aten.pro
286 mkdir -p /var/lib/goaccess/ludivinecassal.com 301 mkdir -p /var/lib/goaccess/ludivinecassal.com
287 mkdir -p /var/lib/goaccess/piedsjaloux.fr 302 mkdir -p /var/lib/goaccess/piedsjaloux.fr
303 mkdir -p /var/lib/goaccess/osteopathe-cc.fr
288 ''; 304 '';
289 }; 305 };
290 306
@@ -474,7 +490,7 @@
474 mypkgs.chloe_dev.apache.vhostConf 490 mypkgs.chloe_dev.apache.vhostConf
475 ]; 491 ];
476 }) 492 })
477 (withConf "eldiron" // { 493 (withConf "chloe" // {
478 hostName = "osteopathe-cc.fr"; 494 hostName = "osteopathe-cc.fr";
479 serverAliases = [ "www.osteopathe-cc.fr" ]; 495 serverAliases = [ "www.osteopathe-cc.fr" ];
480 documentRoot = mypkgs.chloe_prod.webRoot; 496 documentRoot = mypkgs.chloe_prod.webRoot;
@@ -615,11 +631,14 @@
615 services.cron = { 631 services.cron = {
616 enable = true; 632 enable = true;
617 systemCronJobs = let 633 systemCronJobs = let
618 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}"; 634 stats = domain: conf: let
635 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}";
636 in "${d}/bin/stats-${domain}";
619 in [ 637 in [
620 "5 0 * * * root ${stats "aten.pro" ./packages/aten_goaccess.conf}" 638 "5 0 * * * root ${stats "aten.pro" ./packages/aten_goaccess.conf}"
621 "5 0 * * * root ${stats "ludivinecassal.com" ./packages/ludivinecassal_goaccess.conf}" 639 "5 0 * * * root ${stats "ludivinecassal.com" ./packages/ludivinecassal_goaccess.conf}"
622 "5 0 * * * root ${stats "piedsjaloux.fr" ./packages/piedsjaloux_goaccess.conf}" 640 "5 0 * * * root ${stats "piedsjaloux.fr" ./packages/piedsjaloux_goaccess.conf}"
641 "5 0 * * * root ${stats "osteopathe-cc.fr" ./packages/chloe_goaccess.conf}"
623 ]; 642 ];
624 }; 643 };
625 }; 644 };
diff --git a/virtual/packages/chloe.json b/virtual/packages/chloe.json
index d9cf651..686d751 100644
--- a/virtual/packages/chloe.json
+++ b/virtual/packages/chloe.json
@@ -1,5 +1,5 @@
1{ 1{
2 "tag": "1a2ef9a-master", 2 "tag": "96fc4eb-master",
3 "meta": { 3 "meta": {
4 "name": "chloe", 4 "name": "chloe",
5 "url": "gitolite@git.immae.eu:perso/Immae/Sites/Chloe", 5 "url": "gitolite@git.immae.eu:perso/Immae/Sites/Chloe",
@@ -7,8 +7,8 @@
7 }, 7 },
8 "git": { 8 "git": {
9 "url": "gitolite@git.immae.eu:perso/Immae/Sites/Chloe", 9 "url": "gitolite@git.immae.eu:perso/Immae/Sites/Chloe",
10 "rev": "1a2ef9acee91792e8096854919f0a2f005a3f481", 10 "rev": "96fc4eb0099a29b0f9a58fb4eaec4bf14ac65f0a",
11 "sha256": "1h10d2bgvpkm7yi7sbshfi3h50fx202jgnfwiarq5wm947f9phrn", 11 "sha256": "0mf15j6z86j2smm2k360cmm5djhcjbs9949pznwi57kw97vkm1s3",
12 "fetchSubmodules": true 12 "fetchSubmodules": true
13 } 13 }
14} 14}
diff --git a/virtual/packages/chloe.nix b/virtual/packages/chloe.nix
index 2ca1d6f..7288558 100644
--- a/virtual/packages/chloe.nix
+++ b/virtual/packages/chloe.nix
@@ -85,7 +85,9 @@ let
85 Require ldap-group cn=chloe.immae.eu,cn=httpd,ou=services,dc=immae,dc=eu 85 Require ldap-group cn=chloe.immae.eu,cn=httpd,ou=services,dc=immae,dc=eu
86 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://osteopathe-cc.fr\"></html>" 86 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://osteopathe-cc.fr\"></html>"
87 </Location> 87 </Location>
88 '' else ""} 88 '' else ''
89 Use Stats osteopathe-cc.fr
90 ''}
89 ''; 91 '';
90 }; 92 };
91 activationScript = { 93 activationScript = {
diff --git a/virtual/packages/chloe_goaccess.conf b/virtual/packages/chloe_goaccess.conf
new file mode 100644
index 0000000..89cff6d
--- /dev/null
+++ b/virtual/packages/chloe_goaccess.conf
@@ -0,0 +1,99 @@
1time-format %H:%M:%S
2date-format %d/%b/%Y
3
4#sur immae.eu
5#log-format %v %h %^[%d:%t %^] "%r" %s %b "%R" "%u" $^
6
7log-format VCOMBINED
8#= %v:%^ %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
9
10html-prefs {"theme":"bright","layout":"vertical"}
11
12exclude-ip 188.165.209.148
13exclude-ip 178.33.252.96
14exclude-ip 2001:41d0:2:9c94::1
15exclude-ip 2001:41d0:2:9c94::
16exclude-ip 176.9.151.89
17exclude-ip 2a01:4f8:160:3445::
18exclude-ip 82.255.56.72
19
20no-query-string true
21
22keep-db-files true
23load-from-disk true
24db-path /var/lib/goaccess/osteopathe-cc.fr
25
26ignore-panel REFERRERS
27ignore-panel KEYPHRASES
28
29static-file .css
30static-file .js
31static-file .jpg
32static-file .png
33static-file .gif
34static-file .ico
35static-file .jpeg
36static-file .pdf
37static-file .csv
38static-file .mpeg
39static-file .mpg
40static-file .swf
41static-file .woff
42static-file .woff2
43static-file .xls
44static-file .xlsx
45static-file .doc
46static-file .docx
47static-file .ppt
48static-file .pptx
49static-file .txt
50static-file .zip
51static-file .ogg
52static-file .mp3
53static-file .mp4
54static-file .exe
55static-file .iso
56static-file .gz
57static-file .rar
58static-file .svg
59static-file .bmp
60static-file .tar
61static-file .tgz
62static-file .tiff
63static-file .tif
64static-file .ttf
65static-file .flv
66#static-file .less
67#static-file .ac3
68#static-file .avi
69#static-file .bz2
70#static-file .class
71#static-file .cue
72#static-file .dae
73#static-file .dat
74#static-file .dts
75#static-file .ejs
76#static-file .eot
77#static-file .eps
78#static-file .img
79#static-file .jar
80#static-file .map
81#static-file .mid
82#static-file .midi
83#static-file .ogv
84#static-file .webm
85#static-file .mkv
86#static-file .odp
87#static-file .ods
88#static-file .odt
89#static-file .otf
90#static-file .pict
91#static-file .pls
92#static-file .ps
93#static-file .qt
94#static-file .rm
95#static-file .svgz
96#static-file .wav
97#static-file .webp
98
99