1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-12 11:12:06 +00:00

first try at moving matomo to doc base

This commit is contained in:
Carl Wivagg 2022-06-18 13:43:43 -04:00
parent bacef12a1f
commit c431400a7f
5 changed files with 40 additions and 3 deletions

View file

@ -5,7 +5,7 @@
# If nec, change them by editing /etc/iiab/local_vars.yml prior to installing!
matomo_dl_url: https://builds.matomo.org/matomo.tar.gz
matomo_path: "{{ doc_root }}" # e.g. /library/www/html
matomo_path: "{{ doc_base }}" # e.g. /library/www
matomo_db_name: matomodb
matomo_db_user: Admin

View file

@ -2,7 +2,7 @@
# Version 3 of the GNU General Public License. We modified this code and applied it here in April 2022. The derived sections correspond to the tasks running
# from "HTTP Get Welcome" through "Finish Matomo Setup", lines 45 through 156.
- name: "WARNING: './runrole --reinstall matomo' CAN FAIL AS OF 2022-06-15, e.g. if /library/www/html/matomo already exists"
- name: "WARNING: './runrole --reinstall matomo' CAN FAIL AS OF 2022-06-15, e.g. if /library/www/matomo already exists"
meta: noop
# EXAMPLE OF ABOVE ERROR:
@ -32,7 +32,7 @@
- name: Download and Extract Matomo (~1 min)
unarchive:
src: "{{ matomo_dl_url }}" # e.g. https://builds.matomo.org/matomo.tar.gz
dest: "{{ matomo_path }}" # e.g. /library/www/html
dest: "{{ matomo_path }}" # e.g. /library/www
remote_src: yes
- name: Set Matomo Directory Permissions

View file

@ -24,6 +24,10 @@
when: matomo_installed is undefined
- name: Enable/Disable/Reload NGINX for OSM, if nginx_enabled
include_tasks: nginx.yml
# LET'S ADD THIS "ON/OFF SWITCH" IF POSS!
# - include_tasks: enable-or-disable.yml

View file

@ -0,0 +1,16 @@
- name: Enable http://box/maps & http://box/matomo via NGINX, by installing {{ nginx_conf_dir }}/matomo-nginx.conf from template
template:
src: matomo-nginx.conf.j2
dest: "{{ nginx_conf_dir }}/matomo-nginx.conf" # /etc/nginx/conf.d
when: matomo_enabled
- name: Disable http://box/maps & http://box/matomo via NGINX, by removing {{ nginx_conf_dir }}/matomo-nginx.conf
file:
path: "{{ nginx_conf_dir }}/matomo-nginx.conf" # /etc/nginx/conf.d
state: absent
when: not matomo_enabled
- name: Reload 'nginx' systemd service
systemd:
name: nginx
state: reloaded

View file

@ -0,0 +1,17 @@
location ~ ^/matomo(.*)\.php(.*)$ {
alias /library/www/matomo$1.php$2; # /library/www/matomo
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
fastcgi_pass php;
fastcgi_index index.html;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param PATH_INFO $2;
}
location ~ ^/matomo/ {
root /library/www;
}