aboutsummaryrefslogtreecommitdiffstats
path: root/roles/jails/12_goaccess/templates
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2026-07-09 22:13:03 +0300
committerJan Tuomi <jan@jantuomi.fi>2026-07-09 22:13:03 +0300
commitbadf52135e97531e6c91743322bdbe16105b43e5 (patch)
tree17a847f3f6f047cceea03267d26273532e711dcf /roles/jails/12_goaccess/templates
parent9f55f450e6422e8da29ee94bd0ffeabdff1d3eaa (diff)
Refactor jails
Diffstat (limited to 'roles/jails/12_goaccess/templates')
-rw-r--r--roles/jails/12_goaccess/templates/etc_crontab5
-rw-r--r--roles/jails/12_goaccess/templates/usr_local_bin_gen_goaccess.sh3
-rw-r--r--roles/jails/12_goaccess/templates/usr_local_etc_nginx_nginx.conf23
3 files changed, 31 insertions, 0 deletions
diff --git a/roles/jails/12_goaccess/templates/etc_crontab b/roles/jails/12_goaccess/templates/etc_crontab
new file mode 100644
index 0000000..9984f47
--- /dev/null
+++ b/roles/jails/12_goaccess/templates/etc_crontab
@@ -0,0 +1,5 @@
+SHELL=/bin/sh
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
+
+# Update goaccess report HTML every hour
+0 * * * * root /usr/local/bin/gen_goaccess.sh
diff --git a/roles/jails/12_goaccess/templates/usr_local_bin_gen_goaccess.sh b/roles/jails/12_goaccess/templates/usr_local_bin_gen_goaccess.sh
new file mode 100644
index 0000000..08ede58
--- /dev/null
+++ b/roles/jails/12_goaccess/templates/usr_local_bin_gen_goaccess.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+mkdir -p /var/db/goaccess/html
+cat /mnt/nginx_logs/access.log | goaccess --log-format=VCOMBINED -a -o /var/db/goaccess/html/index.html --restore --db-path /var/db/goaccess --persist
diff --git a/roles/jails/12_goaccess/templates/usr_local_etc_nginx_nginx.conf b/roles/jails/12_goaccess/templates/usr_local_etc_nginx_nginx.conf
new file mode 100644
index 0000000..fa6c329
--- /dev/null
+++ b/roles/jails/12_goaccess/templates/usr_local_etc_nginx_nginx.conf
@@ -0,0 +1,23 @@
+worker_processes 1;
+
+events {
+ worker_connections 128;
+}
+
+http {
+ include mime.types;
+ default_type application/octet-stream;
+ sendfile on;
+
+ server {
+ listen 80;
+ server_name _;
+
+ root /var/db/goaccess/html;
+ index index.html;
+
+ location / {
+ try_files $uri $uri/ =404;
+ }
+ }
+}