diff options
| -rw-r--r-- | playbook.yml | 3 | ||||
| -rw-r--r-- | templates/etc_jail.conf.d_[jailname].conf.j2 | 2 | ||||
| -rw-r--r-- | templates/ingress/usr_local_bin_gen_goaccess.sh.j2 | 10 | ||||
| -rw-r--r-- | templates/ingress/usr_local_etc_nginx_nginx.conf.j2 | 24 |
4 files changed, 10 insertions, 29 deletions
diff --git a/playbook.yml b/playbook.yml index 4314060..3a2a755 100644 --- a/playbook.yml +++ b/playbook.yml @@ -31,7 +31,9 @@ - { userland: "{{ jail_userland_14_3 }}", num: 7, name: aggro } - { userland: "{{ jail_userland_14_3 }}", num: 8, name: diddle } - { userland: "{{ jail_userland_15_0 }}", num: 9, name: redis } + - { userland: "{{ jail_userland_15_0 }}", num: 10, name: samba } - { userland: "{{ jail_userland_14_3 }}", num: 11, name: spliit } + - { userland: "{{ jail_userland_15_0 }}", num: 12, name: goaccess } - { userland: "{{ jail_userland_14_3 }}", num: 14, name: freshrss } - { userland: "{{ jail_userland_14_3 }}", num: 15, name: paste } ingress_routes: @@ -42,7 +44,6 @@ - { host: spliit.jan.systems, jail: spliit } - { host: freshrss.jan.systems, jail: freshrss } - { host: irc.jan.systems, jail: irc_thelounge } - - { host: goaccess.jan.systems, static: /var/www/goaccess } - { host: paste.jan.systems, jail: paste } - { host: immich.jan.systems, ip: 192.168.3.3, port: 2283 } # vms aren't configured in ansible cert_domains: diff --git a/templates/etc_jail.conf.d_[jailname].conf.j2 b/templates/etc_jail.conf.d_[jailname].conf.j2 index 3e11e4f..4c0bbc4 100644 --- a/templates/etc_jail.conf.d_[jailname].conf.j2 +++ b/templates/etc_jail.conf.d_[jailname].conf.j2 @@ -27,6 +27,8 @@ {% for ing in jails -%} {% if ing.name == "ingress" -%} exec.poststart += "jexec ${name} route add default 192.168.2.{{ ing.num }} || echo 'Failed to add default route'"; + exec.poststart += "jexec ${name} route add 10.6.210.0/24 192.168.0.1 || echo 'Failed to add Wireguard return route'"; + exec.poststart += "mount -t nullfs /usr/local/jails/containers/goaccess/var/www/goaccess /usr/local/jails/containers/ingress/mnt/www_goaccess" {% endif %} {% endfor %} {% else %} diff --git a/templates/ingress/usr_local_bin_gen_goaccess.sh.j2 b/templates/ingress/usr_local_bin_gen_goaccess.sh.j2 index fb7a7bc..2cfc93a 100644 --- a/templates/ingress/usr_local_bin_gen_goaccess.sh.j2 +++ b/templates/ingress/usr_local_bin_gen_goaccess.sh.j2 @@ -1,6 +1,8 @@ #!/bin/sh -cat /var/log/nginx/access.log | awk '$8=$1$8' | /usr/local/bin/goaccess --log-format=VCOMBINED -j "$(($(nproc) + 1))" --keep-last=30 -a -o /var/www/goaccess/index.html --persist --restore -chmod 644 /var/www/goaccess/index.html -chown www /var/www/goaccess/index.html -chgrp www /var/www/goaccess/index.html +TARGET=/mnt/www_goaccess/index.html + +cat /var/log/nginx/access.log | awk '$8=$1$8' | /usr/local/bin/goaccess --log-format=VCOMBINED -j "$(($(nproc) + 1))" --keep-last=30 -a -o $TARGET --restore --persist +chmod 644 $TARGET +chown www $TARGET +chgrp www $TARGET diff --git a/templates/ingress/usr_local_etc_nginx_nginx.conf.j2 b/templates/ingress/usr_local_etc_nginx_nginx.conf.j2 index e6e35b2..ae08d46 100644 --- a/templates/ingress/usr_local_etc_nginx_nginx.conf.j2 +++ b/templates/ingress/usr_local_etc_nginx_nginx.conf.j2 @@ -85,30 +85,6 @@ http { return 307 https://{{ route.redirect }}$request_uri; } - {% elif route.static is defined -%} - server { - server_name {{ route.host }}; - http2 on; - - listen 443 ssl; - listen [::]:443 ssl; - - # See https://ssl-config.mozilla.org/#server=nginx&version=1.28.0&config=intermediate&openssl=3.4.0&guideline=5.7 - add_header Strict-Transport-Security "max-age=63072000" always; - - ssl_certificate /usr/local/etc/letsencrypt/live/{{ cert_name }}/fullchain.pem; - ssl_certificate_key /usr/local/etc/letsencrypt/live/{{ cert_name }}/privkey.pem; - include /usr/local/etc/letsencrypt/options-ssl-nginx.conf; - ssl_dhparam /usr/local/etc/letsencrypt/ssl-dhparams.pem; - - # No error logging for static files - error_log off; - - location / { - root {{ route.static }}; - index index.html; - } - } {% elif route.ip is defined -%} server { server_name {{ route.host }}; |
