mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-02-21 12:09:39 +01:00
Optimized Matomo
This commit is contained in:
parent
f84774a390
commit
2c4ee620c1
@ -10,14 +10,10 @@
|
||||
ignore_errors: yes
|
||||
when: run_once_docker_matomo is not defined
|
||||
|
||||
# @todo optimize this code. If global_matomo_tracking_enabled is active it doesn't have any impact.
|
||||
- name: implement matomo tracking for matomo if matomo is up and tracking enabled
|
||||
- name: "Determine global_matomo_tracking_enabled based on current value and site reachability"
|
||||
set_fact:
|
||||
global_matomo_tracking_enabled: true
|
||||
when:
|
||||
- site_check is defined and site_check.status == 200
|
||||
- global_matomo_tracking_enabled | bool
|
||||
- run_once_docker_matomo is not defined
|
||||
global_matomo_tracking_enabled: "{{ (global_matomo_tracking_enabled | bool) and (site_check is defined and site_check.status == 200) }}"
|
||||
when: run_once_docker_matomo is not defined
|
||||
|
||||
- name: "include docker-central-database"
|
||||
include_role:
|
||||
|
@ -31,10 +31,8 @@ for filename in os.listdir(config_path):
|
||||
# Determine expected status codes based on the domain
|
||||
if domain == '{{domains.listmonk}}':
|
||||
expected_statuses = [404]
|
||||
{% if global_matomo_tracking_enabled | bool %}
|
||||
elif parts[0] == 'www' or domain in redirected_domains:
|
||||
expected_statuses = [301]
|
||||
{% endif %}
|
||||
elif domain == '{{domains.yourls}}':
|
||||
expected_statuses = [403]
|
||||
|
||||
|
@ -4,6 +4,9 @@
|
||||
notify: restart nginx
|
||||
when: run_once_nginx is not defined
|
||||
|
||||
# I assume the following can be deleted
|
||||
# @todo Delete
|
||||
|
||||
- name: install nginx-mod-headers-more for matomo
|
||||
pacman:
|
||||
name: nginx-mod-headers-more
|
||||
|
@ -1,4 +1,5 @@
|
||||
{% if global_matomo_tracking_enabled | bool %}
|
||||
# @todo Assume this can be removed. Remove.
|
||||
load_module /usr/lib/nginx/modules/ngx_http_headers_more_filter_module.so;
|
||||
{% endif %}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user