summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/bgt/download.binaergewitter.de.nix
diff options
context:
space:
mode:
authorjeschli <jeschli@gmail.com>2019-01-29 19:17:43 +0100
committerjeschli <jeschli@gmail.com>2019-01-29 19:17:43 +0100
commit924c8fb748a92720c75750cee528ac2f4b7c5c8e (patch)
tree1a3b956f7f8527e533040cee1138810fe304bbc9 /makefu/2configs/bgt/download.binaergewitter.de.nix
parent06b6454af78e8236a67d69cab94f62c32054be47 (diff)
parente64bbd8d6864e21f9e7b6b9a11cf95c976bdc109 (diff)
Merge branch 'master' of prism.r:stockholm
Diffstat (limited to 'makefu/2configs/bgt/download.binaergewitter.de.nix')
-rw-r--r--makefu/2configs/bgt/download.binaergewitter.de.nix30
1 files changed, 28 insertions, 2 deletions
diff --git a/makefu/2configs/bgt/download.binaergewitter.de.nix b/makefu/2configs/bgt/download.binaergewitter.de.nix
index 6d64848f5..f223081e9 100644
--- a/makefu/2configs/bgt/download.binaergewitter.de.nix
+++ b/makefu/2configs/bgt/download.binaergewitter.de.nix
@@ -3,6 +3,8 @@
with import <stockholm/lib>;
let
ident = (builtins.readFile ./auphonic.pub);
+ bgtaccess = "/var/spool/nginx/logs/binaergewitter.access.log";
+ bgterror = "/var/spool/nginx/logs/binaergewitter.error.log";
in {
services.openssh = {
allowSFTP = true;
@@ -21,6 +23,19 @@ in {
useDefaultShell = true;
openssh.authorizedKeys.keys = [ ident config.krebs.users.makefu.pubkey ];
};
+ services.logrotate = {
+ enable = true;
+ config = ''
+ ${bgtaccess} ${bgterror} {
+ rotate 5
+ weekly
+ create 600 nginx nginx
+ postrotate
+ ${pkgs.systemd}/bin/systemctl reload nginx
+ endscript
+ }
+ '';
+ };
services.nginx = {
enable = lib.mkDefault true;
recommendedGzipSettings = true;
@@ -29,10 +44,21 @@ in {
serverAliases = [ "dl2.binaergewitter.de" ];
root = "/var/www/binaergewitter";
extraConfig = ''
- access_log /var/spool/nginx/logs/binaergewitter.access.log combined;
- error_log /var/spool/nginx/logs/binaergewitter.error.log error;
+ access_log ${bgtaccess} combined;
+ error_log ${bgterror} error;
autoindex on;
'';
};
};
+ environment.etc."netdata/python.d/web_log.conf".text = ''
+ nginx_log3:
+ name: 'nginx'
+ path: '/var/spool/nginx/logs/access.log'
+ nginx_log4:
+ name: 'bgt'
+ path: '${bgtaccess}'
+ '';
+
+ users.users.netdata.extraGroups = [ "nginx" ];
+
}