6b3c9b95d5
* Change of preview generation default values. According to the [docs](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/previews_configuration.html), some variables are unsupported, while the default of others have changed. * is defined is not used, changing "null" handling Luckily it works as numbers as string are accepted. * check for unused NC variables * this is an app setting, not a system setting * Deprecate nextcloud_preview_system_jpeg_quality, not nextcloud_preview_app_jpeg_quality Ref: https://github.com/mother-of-all-self-hosting/ansible-role-nextcloud/pull/20#discussion_r1686902142 --------- Co-authored-by: Slavi Pantaleev <slavi@devture.com>
70 lines
3.4 KiB
YAML
70 lines
3.4 KiB
YAML
---
|
|
|
|
- when: nextcloud_container_labels_traefik_enabled | bool
|
|
name: Ensure trusted_proxies is correctly set when reverse-proxying via Traefik
|
|
block:
|
|
- name: Determine Nextcloud container network subnet
|
|
ansible.builtin.command:
|
|
cmd: "{{ devture_systemd_docker_base_host_command_docker }} network inspect {{ nextcloud_container_labels_traefik_docker_network }} -f '{% raw %}{{ (index .IPAM.Config 0).Subnet }}{% endraw %}'"
|
|
register: nextcloud_reverse_proxy_container_network_subnet_result
|
|
changed_when: false
|
|
|
|
- name: Adjust Nextcloud configuration (set trusted_proxies)
|
|
ansible.builtin.command:
|
|
cmd: |-
|
|
docker exec --user={{ nextcloud_uid }}:{{ nextcloud_gid }} {{ nextcloud_identifier }}-server php /var/www/html/occ --no-warnings config:system:set trusted_proxies 0 --type=string --value={{ nextcloud_reverse_proxy_container_network_subnet_result.stdout }}
|
|
|
|
- name: Adjust Nextcloud configuration (custom parameters)
|
|
ansible.builtin.command:
|
|
cmd: |-
|
|
docker exec --user={{ nextcloud_uid }}:{{ nextcloud_gid }} {{ nextcloud_identifier }}-server php /var/www/html/occ --no-warnings config:system:set {{ item.key }} --type="{{ item.type }}" --value={{ item.value }}
|
|
with_items: "{{ nextcloud_config_parameters }}"
|
|
|
|
- name: Update database indices
|
|
ansible.builtin.command:
|
|
cmd: |-
|
|
docker exec --user={{ nextcloud_uid }}:{{ nextcloud_gid }} {{ nextcloud_identifier }}-server php /var/www/html/occ db:add-missing-indices
|
|
|
|
- when: nextcloud_preview_enabled | bool
|
|
block:
|
|
- name: Adjust Nextcloud configuration values related to preview generator
|
|
ansible.builtin.command:
|
|
cmd: |-
|
|
docker exec --user={{ nextcloud_uid }}:{{ nextcloud_gid }} {{ nextcloud_identifier }}-server php /var/www/html/occ {{ item.appType }} --type={{ item.type }} --value={{ item.value }} -- {{ item.appConfig }} {{ item.configName }}
|
|
with_items:
|
|
- appType: "config:system:set"
|
|
appConfig: ""
|
|
configName: "preview_max_x"
|
|
type: "string"
|
|
value: "{{ nextcloud_preview_preview_max_x }}"
|
|
- appType: "config:system:set"
|
|
appConfig: ""
|
|
configName: "preview_max_y"
|
|
type: "string"
|
|
value: "{{ nextcloud_preview_preview_max_y }}"
|
|
- appType: "config:app:set"
|
|
appConfig: ""
|
|
configName: "jpeg_quality"
|
|
type: int
|
|
value: "{{ nextcloud_preview_app_jpeg_quality }}"
|
|
|
|
- name: "Check if {{ nextcloud_preview_first_run_finished_filename }} exists"
|
|
ansible.builtin.stat:
|
|
path: "{{ nextcloud_preview_host_folder }}/{{ nextcloud_preview_first_run_finished_filename }}"
|
|
register: nextcloud_preview_file_stats
|
|
|
|
- when: not nextcloud_preview_file_stats.stat.exists
|
|
name: Start preview generate-all
|
|
ansible.builtin.command:
|
|
cmd: |-
|
|
docker exec --user={{ nextcloud_uid }}:{{ nextcloud_gid }} {{ nextcloud_identifier }}-server php /var/www/html/occ preview:generate-all
|
|
async: 100000
|
|
poll: 10
|
|
|
|
- name: "Create {{ nextcloud_preview_first_run_finished_filename }} to signal, that preview generate-all is finished"
|
|
ansible.builtin.file:
|
|
path: "{{ nextcloud_preview_host_folder }}/{{ nextcloud_preview_first_run_finished_filename }}"
|
|
state: "touch"
|
|
mode: 0644
|
|
owner: "{{ nextcloud_uid }}"
|
|
group: "{{ nextcloud_gid }}"
|