Mitigate risk of disk space issues somewhat #92
					 2 changed files with 18 additions and 10 deletions
				
			
		|  | @ -153,16 +153,21 @@ | ||||||
|   services.logrotate = { |   services.logrotate = { | ||||||
|     enable = true; |     enable = true; | ||||||
| 
 | 
 | ||||||
|     settings = lib.mapAttrs' (virtualHost: _: |     settings = | ||||||
|       lib.nameValuePair "/var/log/nginx/${virtualHost}/access.log" { |       { | ||||||
|         frequency = "daily"; |         # Override the default, just keep fewer logs | ||||||
|         rotate = 2; |         nginx.rotate = 6; | ||||||
|         compress = true; |       } | ||||||
|         delaycompress = true; |       // lib.mapAttrs' (virtualHost: _: | ||||||
|         su = "${config.services.nginx.user} ${config.services.nginx.group}"; |         lib.nameValuePair "/var/log/nginx/${virtualHost}/access.log" { | ||||||
|         postrotate = "[ ! -f /var/run/nginx/nginx.pid ] || kill -USR1 `cat /var/run/nginx/nginx.pid`"; |           frequency = "daily"; | ||||||
|       }) |           rotate = 2; | ||||||
|     config.services.nginx.virtualHosts; |           compress = true; | ||||||
|  |           delaycompress = true; | ||||||
|  |           su = "${config.services.nginx.user} ${config.services.nginx.group}"; | ||||||
|  |           postrotate = "[ ! -f /var/run/nginx/nginx.pid ] || kill -USR1 `cat /var/run/nginx/nginx.pid`"; | ||||||
|  |         }) | ||||||
|  |       config.services.nginx.virtualHosts; | ||||||
|   }; |   }; | ||||||
|   systemd.tmpfiles.rules = |   systemd.tmpfiles.rules = | ||||||
|     lib.mapAttrsToList ( |     lib.mapAttrsToList ( | ||||||
|  |  | ||||||
|  | @ -1,6 +1,9 @@ | ||||||
| {config, ...}: { | {config, ...}: { | ||||||
|   config.services.victoriametrics = { |   config.services.victoriametrics = { | ||||||
|     enable = true; |     enable = true; | ||||||
|  |     extraOptions = [ | ||||||
|  |       "-storage.minFreeDiskSpaceBytes=5GB" | ||||||
|  |     ]; | ||||||
| 
 | 
 | ||||||
|     scrapeConfigs = { |     scrapeConfigs = { | ||||||
|       gitea = { |       gitea = { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue