Files
computer-playbook/roles/web-app-nextcloud/tasks/02_manager_ops.yml
kevinveenbirkenbachandClaude Opus 5 c215aca058 fix(nextcloud): route sociallogin through the tor proxy, fail fast on a refused login callback, stop leaking plugin config
Run 34421944328 Nextcloud#1 timed out "waiting for a signed-in Nextcloud
shell after the login redirect". 4164f37981 turned sso on in variant 1
while ldap stays off there, so that round logs in through sociallogin
instead of oidc_login - the first variant, on this branch or on main,
that runs sociallogin against an onion issuer. oidc_login goes through
Nextcloud's HTTP client, which honours the proxy in proxy.config.php;
sociallogin builds its own client and reads only
social_login_http_client['proxy'], so its token exchange never reached
the onion Keycloak. The template now sets the same tor SOCKS proxy for
it, inside the existing "sso on and the OIDC host is an onion" branch.

The spec only treated 5xx documents as a page failure, so a refused
callback surfaced as a 60s (x5 over tor) wait for a shell that could not
come. A 4xx on /apps/sociallogin/ or /apps/oidc_login/ now counts as
the page itself failing, reported without the query so no code leaks.

The plugin loop printed every item, including the OIDC client secret,
into the include line of a public CI log; it now labels by plugin key and
honours MASK_CREDENTIALS_IN_LOGS.

_shared.js grew past 250 lines; its page and modal helpers move to
_page.js and _shared.js re-exports them, with an identical export
surface.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-11 13:21:39 +02:00

70 lines
2.2 KiB
YAML

---
- name: 🚿 Flush handlers so Nextcloud container is restarted and ready
meta: flush_handlers
- name: 🔍 Resolve the Nextcloud hosting node and container id
include_tasks: "{{ lookup('path_absolute', 'roles/sys-svc-compose/tasks/utils/swarm/resolve_host_cid.yml') }}"
vars:
resolve_service_key: "{{ NEXTCLOUD_SERVICE }}"
resolve_output_prefix: NEXTCLOUD
resolve_compose_cid: "{{ NEXTCLOUD_CONTAINER_ADDRESS }}"
- name: 🔧 Setup config.php
include_tasks:
file: 02_manager_ops/01_config.yml
apply:
delegate_to: "{{ NEXTCLOUD_HOST_NODE }}"
- name: ⏳ Wait for Redis
include_tasks: 02_manager_ops/02_redis.yml
- name: 🔄 Update\Upgrade Nextcloud
include_tasks:
file: 02_manager_ops/03_upgrade.yml
apply:
delegate_to: "{{ NEXTCLOUD_HOST_NODE }}"
- name: 🔍 Re-resolve the hosting node after the upgrade
include_tasks: "{{ lookup('path_absolute', 'roles/sys-svc-compose/tasks/utils/swarm/resolve_host_cid.yml') }}"
vars:
resolve_service_key: "{{ NEXTCLOUD_SERVICE }}"
resolve_output_prefix: NEXTCLOUD
resolve_compose_cid: "{{ NEXTCLOUD_CONTAINER_ADDRESS }}"
- name: 👤 Setup the administrator account
include_tasks:
file: 02_manager_ops/04_admin.yml
apply:
delegate_to: "{{ NEXTCLOUD_HOST_NODE }}"
- name: ⚙️ Apply the system configuration
include_tasks:
file: 02_manager_ops/05_system_config.yml
apply:
delegate_to: "{{ NEXTCLOUD_HOST_NODE }}"
- name: 🔧 Setup Nextcloud Plugins
include_tasks:
file: 02_manager_ops/06_plugin.yml
apply:
delegate_to: "{{ NEXTCLOUD_HOST_NODE }}"
loop: "{{ NEXTCLOUD_PLUGIN_ITEMS }}"
loop_control:
loop_var: plugin_item
label: "{{ plugin_item.key }}"
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
vars:
plugin_key: "{{ plugin_item.key }}"
plugin_value: "{{ plugin_item.value }}"
when: NEXTCLOUD_PLUGINS_ENABLED | bool
- name: 🔧 Reconcile administrator identities after plugin setup
include_tasks:
file: 02_manager_ops/07_admin_identities.yml
apply:
delegate_to: "{{ NEXTCLOUD_HOST_NODE }}"
- name: "🔌 Provision the MCP server surface"
include_tasks: utils/mcp.yml
when: NEXTCLOUD_MCP_ENABLED | bool