From 092824585382f06abf4597a5d59e6801eeaaa7f8 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 21 Mar 2025 18:43:06 +0100 Subject: [PATCH] Solved nextcloud plugin bugs in context ldap --- group_vars/all/00_general.yml | 2 +- group_vars/all/14_service_provider.yml | 4 ++-- roles/docker-nextcloud/tasks/plugin.yml | 25 +++++++++++++++++++------ roles/docker-nextcloud/vars/main.yml | 5 +++-- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/group_vars/all/00_general.yml b/group_vars/all/00_general.yml index 866ac6ee..5e0db945 100644 --- a/group_vars/all/00_general.yml +++ b/group_vars/all/00_general.yml @@ -70,4 +70,4 @@ css_enabled_default: true # Enables\Disables Global CSS o ## iframe for primary domain # Enables\Disables the possibility to be embedded via iframe by default. # Enable conciously on every app in which it makes sense, due to that this a potential security risk -landingpage_iframe_enabled_default: false \ No newline at end of file +landingpage_iframe_enabled_default: false \ No newline at end of file diff --git a/group_vars/all/14_service_provider.yml b/group_vars/all/14_service_provider.yml index 87b8c178..69a8f4bd 100644 --- a/group_vars/all/14_service_provider.yml +++ b/group_vars/all/14_service_provider.yml @@ -13,8 +13,8 @@ defaults_service_provider: platform: titel: "CyMaIS Plattform Demo" subtitel: "Demo of the Cyber Master Infrastructur Solution Plattform" - logo: "{{applications.assets_server.url}}/logo.png" - favicon: "{{applications.assets_server.url}}/favicon.ico" + logo: "{{applications.assets_server.url}}/img/logo.png" + favicon: "{{applications.assets_server.url}}/img/favicon.ico" contact: bluesky: "{{ '@' ~ users.administrator.username ~ '.' ~ domains.bluesky_api if 'bluesky' in group_names else '' }}" email: "contact@{{ primary_domain }}" diff --git a/roles/docker-nextcloud/tasks/plugin.yml b/roles/docker-nextcloud/tasks/plugin.yml index 96f979d6..ca453710 100644 --- a/roles/docker-nextcloud/tasks/plugin.yml +++ b/roles/docker-nextcloud/tasks/plugin.yml @@ -28,20 +28,33 @@ changed_when: enable_result.rc == 0 and ("already enabled" not in enable_result.stdout) when: plugin_value.enabled | bool -- name: Check if {{nextcloud_localhost_plugin_configuration_directory}}{{ plugin_key }}.yml exists +- name: Check if {{nextcloud_control_node_plugin_vars_directory}}{{ plugin_key }}.yml exists stat: - path: "{{nextcloud_localhost_plugin_configuration_directory}}{{ plugin_key }}.yml" - register: plugin_config_file + path: "{{nextcloud_control_node_plugin_vars_directory}}{{ plugin_key }}.yml" + delegate_to: localhost + become: false + register: plugin_vars_file - name: Apply configuration to {{ plugin_key }} block: - name: Load {{ plugin_key }} configuration variables include_vars: - file: "{{nextcloud_localhost_plugin_configuration_directory}}{{ plugin_key }}.yml" + file: "{{nextcloud_control_node_plugin_vars_directory}}{{ plugin_key }}.yml" - name: "Set {{ item.configkey }} for {{ item.appid }}" loop: "{{ plugin_configuration }}" command: > {{ nextcloud_docker_exec_occ }} config:app:set {{ item.appid }} {{ item.configkey }} --value '{{ item.configvalue | to_json if item.configvalue is mapping else item.configvalue }}' - - when: plugin_config_file.stat.exists + + when: plugin_vars_file.stat.exists + +- name: Check if {{nextcloud_control_node_plugin_tasks_directory}}{{ plugin_key }}.yml exists + stat: + path: "{{nextcloud_control_node_plugin_tasks_directory}}{{ plugin_key }}.yml" + delegate_to: localhost + become: false + register: plugin_tasks_file + +- name: "include {{nextcloud_control_node_plugin_tasks_directory}}{{ plugin_key }}.yml" + include_tasks: "{{nextcloud_control_node_plugin_tasks_directory}}{{ plugin_key }}.yml" + when: plugin_tasks_file.stat.exists diff --git a/roles/docker-nextcloud/vars/main.yml b/roles/docker-nextcloud/vars/main.yml index 73a35409..94032ff2 100644 --- a/roles/docker-nextcloud/vars/main.yml +++ b/roles/docker-nextcloud/vars/main.yml @@ -10,8 +10,9 @@ database_type: "mariadb" domain: "{{domains[application_id]}}" # Public domain at which Nextcloud will be accessable http_port: "{{ ports.localhost.http[application_id] }}" # Port at which nextcloud is reachable in the local network -# Localhost -nextcloud_localhost_plugin_configuration_directory: "{{role_path}}/vars/plugins/" # Folder in which the files for the plugin configuration are stored +# Control Node +nextcloud_control_node_plugin_vars_directory: "{{role_path}}/vars/plugins/" # Folder in which the files for the plugin configuration are stored +nextcloud_control_node_plugin_tasks_directory: "{{role_path}}/tasks/plugins/" # Folder which contains the files for extra plugin configuration tasks # Host