Solved more matomo bugs

This commit is contained in:
Kevin Veen-Birkenbach 2025-02-19 03:20:34 +01:00
parent bd1395926b
commit f84774a390
5 changed files with 44 additions and 27 deletions

View File

@ -100,7 +100,7 @@ defaults_applications:
## Listmonk ## Listmonk
listmonk: listmonk:
administrator_username: "{{administrator_username}}" administrator_username: "{{administrator_username}}" # Listmonk administrator account username
public_api_activated: False # Security hole. Can be used for spaming public_api_activated: False # Security hole. Can be used for spaming
version: "latest" # Docker Image version version: "latest" # Docker Image version
setup: false # Set true in inventory file to execute the setup and initializing procedures setup: false # Set true in inventory file to execute the setup and initializing procedures

View File

@ -8,19 +8,34 @@
validate_certs: yes validate_certs: yes
register: site_check register: site_check
ignore_errors: yes 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: implement matomo tracking for matomo if matomo is up and tracking enabled
set_fact: set_fact:
global_matomo_tracking_enabled: true global_matomo_tracking_enabled: true
when: site_check is defined and site_check.status == 200 and global_matomo_tracking_enabled | bool when:
- site_check is defined and site_check.status == 200
- global_matomo_tracking_enabled | bool
- run_once_docker_matomo is not defined
- name: "include docker-central-database" - name: "include docker-central-database"
include_role: include_role:
name: docker-central-database name: docker-central-database
when: run_once_docker_matomo is not defined
- name: "include role nginx-domain-setup for {{application_id}}" - name: "include role nginx-domain-setup for {{application_id}}"
include_role: include_role:
name: nginx-domain-setup name: nginx-domain-setup
vars:
oauth2_proxy_active: false # Deactivate prox, in case it got activated by another app
when: run_once_docker_matomo is not defined
- name: "copy docker-compose.yml and env file" - name: "copy docker-compose.yml and env file"
include_tasks: copy-docker-compose-and-env.yml include_tasks: copy-docker-compose-and-env.yml
when: run_once_docker_matomo is not defined
- name: run the docker matomo tasks once
set_fact:
run_once_docker_matomo: true
when: run_once_docker_matomo is not defined

View File

@ -6,10 +6,18 @@
include_role: include_role:
name: nginx-https-recieve-certificate name: nginx-https-recieve-certificate
- name: "copy nginx domain configuration to {{nginx.directories.http.servers}}{{domain}}.conf" - name: "Relevant variables for role: {{ role_path | basename }}"
debug:
msg:
oauth2_proxy_active: "{{oauth2_proxy_active}}"
domains: "{{domains}}"
applications: "{{applications}}"
when: enable_debug | bool
- name: "copy nginx domain configuration to {{configuration_destination}}"
template: template:
src: "roles/nginx-docker-reverse-proxy/templates/domain.conf.j2" src: "roles/nginx-docker-reverse-proxy/templates/domain.conf.j2"
dest: "{{nginx.directories.http.servers}}{{domain}}.conf" dest: "{{configuration_destination}}"
notify: restart nginx notify: restart nginx
- name: "include the docker-oauth2-proxy role {{domain}}" - name: "include the docker-oauth2-proxy role {{domain}}"

View File

@ -0,0 +1 @@
configuration_destination: "{{nginx.directories.http.servers}}{{domain}}.conf"

View File

@ -14,22 +14,12 @@
domain_regex: "^{{nginx.directories.http.servers}}(?!www\\.)[^/]+\\.conf$" domain_regex: "^{{nginx.directories.http.servers}}(?!www\\.)[^/]+\\.conf$"
path_regex: "^{{nginx.directories.http.servers}}" path_regex: "^{{nginx.directories.http.servers}}"
- name: The domains for which a www. redirect will be implemented
debug:
var: filtered_domains
when: enable_debug | bool
# Routine for domains with primary domain included # Routine for domains with primary domain included
- name: Set filtered_domains_with_primary_domain - name: Set filtered_domains_with_primary_domain
set_fact: set_fact:
filtered_domains_with_primary_domain: "{{ filtered_domains | select('search', primary_domain + '$') | list }}" filtered_domains_with_primary_domain: "{{ filtered_domains | select('search', primary_domain + '$') | list }}"
- name: Debug with primary domain
debug:
var: filtered_domains_with_primary_domain
when: enable_debug | bool
- name: Include nginx-redirect-domain role with dynamic domain mappings for domains with {{primary_domain}} included - name: Include nginx-redirect-domain role with dynamic domain mappings for domains with {{primary_domain}} included
include_role: include_role:
name: nginx-redirect-domain name: nginx-redirect-domain
@ -52,9 +42,12 @@
set_fact: set_fact:
filtered_domains_without_primary_domain: "{{ filtered_domains | reject('search', primary_domain + '$') | list }}" filtered_domains_without_primary_domain: "{{ filtered_domains | reject('search', primary_domain + '$') | list }}"
- name: Debug domains without primary domain - name: "Relevant variables for role: {{ role_path | basename }}"
debug: debug:
var: filtered_domains_without_primary_domain msg:
filtered_domains_with_primary_domain: "{{filtered_domains_with_primary_domain}}"
filtered_domains: "{{filtered_domains}}"
filtered_domains_without_primary_domain: "{{filtered_domains_without_primary_domain}}"
when: enable_debug | bool when: enable_debug | bool
- name: Include nginx-redirect-domain role with dynamic domain mappings for domains without primary domain - name: Include nginx-redirect-domain role with dynamic domain mappings for domains without primary domain