From 3b3d223beba6412afaeaeb857bff46c55012d5ba Mon Sep 17 00:00:00 2001 From: cwivagg Date: Sat, 24 Dec 2022 07:29:02 -0500 Subject: [PATCH 1/4] Fix for Issue #3441 --- roles/matomo/tasks/install.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/roles/matomo/tasks/install.yml b/roles/matomo/tasks/install.yml index e5d22fcfb..dabac9274 100644 --- a/roles/matomo/tasks/install.yml +++ b/roles/matomo/tasks/install.yml @@ -180,6 +180,13 @@ body_format: form-urlencoded status_code: 302 +- name: Set Matomo Directory Permissions + file: + path: "{{ matomo_path }}/matomo" + recurse: yes + owner: "{{ apache_user }}" # e.g. www-data + group: "{{ apache_user }}" + - name: Start Collecting Matomo Data cron: name: "MatomoDataIngestionOnReboot" From dd5c1818070a062410fc920ef338f58cd44ef601 Mon Sep 17 00:00:00 2001 From: cwivagg Date: Sat, 24 Dec 2022 08:19:22 -0500 Subject: [PATCH 2/4] Add permissions fix as cronjob --- roles/matomo/tasks/install.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/matomo/tasks/install.yml b/roles/matomo/tasks/install.yml index dabac9274..66e3be188 100644 --- a/roles/matomo/tasks/install.yml +++ b/roles/matomo/tasks/install.yml @@ -205,6 +205,14 @@ cron_file: "matomo_daily" +- name: Start Collecting Matomo Data + cron: + name: "MatomoDataIngestionOnReboot2" + special_time: reboot + job: "sudo chown -R www-data:www-data /library/www/matomo" + user: root + cron_file: "matomo_reboot2" + # RECORD Matomo AS INSTALLED - name: "Set 'matomo_installed: True'" From b968fd40f5a78ec1557c250a7c4f1c834b485469 Mon Sep 17 00:00:00 2001 From: cwivagg Date: Sat, 24 Dec 2022 08:52:14 -0500 Subject: [PATCH 3/4] changes to cronjob hack as test --- roles/matomo/tasks/install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/matomo/tasks/install.yml b/roles/matomo/tasks/install.yml index 66e3be188..b05060e54 100644 --- a/roles/matomo/tasks/install.yml +++ b/roles/matomo/tasks/install.yml @@ -209,7 +209,7 @@ cron: name: "MatomoDataIngestionOnReboot2" special_time: reboot - job: "sudo chown -R www-data:www-data /library/www/matomo" + job: "sudo touch /library/www/matomo/tmp/cache/token.php && sudo mkdir /library/www/matomo/tmp/cache/tracker && sudo chown -R www-data:www-data /library/www/matomo" user: root cron_file: "matomo_reboot2" From 4823353dd957aecb42443caa1f0431e09dec92d7 Mon Sep 17 00:00:00 2001 From: cwivagg Date: Sat, 24 Dec 2022 10:30:47 -0500 Subject: [PATCH 4/4] Replace shell commands with ansible --- roles/matomo/tasks/install.yml | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/roles/matomo/tasks/install.yml b/roles/matomo/tasks/install.yml index b05060e54..4edb9ce65 100644 --- a/roles/matomo/tasks/install.yml +++ b/roles/matomo/tasks/install.yml @@ -180,13 +180,6 @@ body_format: form-urlencoded status_code: 302 -- name: Set Matomo Directory Permissions - file: - path: "{{ matomo_path }}/matomo" - recurse: yes - owner: "{{ apache_user }}" # e.g. www-data - group: "{{ apache_user }}" - - name: Start Collecting Matomo Data cron: name: "MatomoDataIngestionOnReboot" @@ -204,14 +197,19 @@ user: root cron_file: "matomo_daily" +- name: Set Permissions for token.php + copy: + content: "" + dest: "{{ matomo_path }}/matomo/tmp/cache/token.php" + group: "{{ apache_user }}" + owner: "{{ apache_user }}" -- name: Start Collecting Matomo Data - cron: - name: "MatomoDataIngestionOnReboot2" - special_time: reboot - job: "sudo touch /library/www/matomo/tmp/cache/token.php && sudo mkdir /library/www/matomo/tmp/cache/tracker && sudo chown -R www-data:www-data /library/www/matomo" - user: root - cron_file: "matomo_reboot2" +- name: Set Permissions for tracker Directory + file: + path: "{{ matomo_path }}/matomo/tmp/cache/tracker" + state: directory + owner: "{{ apache_user }}" + group: "{{ apache_user }}" # RECORD Matomo AS INSTALLED