#!/bin/bash set -eo pipefail restorecon -R {{ kimai_root_dir }} chown root:root {{ kimai_root_dir }} chown -R root:root {{ kimai_root_dir }}/app/ chmod 755 {{ kimai_root_dir }} setfacl -R -k -b {{ kimai_root_dir }} setfacl -m u:{{ kimai_php_user | default('apache') }}:rx,u:{{ httpd_user | default('apache') }}:x {{ kimai_root_dir }} find {{ kimai_root_dir }}/app -type f -exec chmod 644 "{}" \; -type d -exec chmod 755 "{}" \; chown root:{{ kimai_php_user }} {{ kimai_root_dir }}/app/.env {{ kimai_root_dir }}/app/config/packages/local.yaml chmod 640 {{ kimai_root_dir }}/app/.env {{ kimai_root_dir }}/app/config/packages/local.yaml chown -R {{ kimai_php_user }} {{ kimai_root_dir }}/data chmod 700 {{ kimai_root_dir }}/data setfacl -R -m u:{{ httpd_user | default('apache') }}:rX {{ kimai_root_dir }}/app/public find {{ kimai_root_dir }} -name .htaccess -exec chmod 644 "{}" \;