diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2026-07-09 22:13:03 +0300 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2026-07-09 22:13:03 +0300 |
| commit | badf52135e97531e6c91743322bdbe16105b43e5 (patch) | |
| tree | 17a847f3f6f047cceea03267d26273532e711dcf /roles/jails/12_goaccess/templates | |
| parent | 9f55f450e6422e8da29ee94bd0ffeabdff1d3eaa (diff) | |
Refactor jails
Diffstat (limited to 'roles/jails/12_goaccess/templates')
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; + } + } +} |
