fix(xwiki): enable superadmin flag in xwiki.cfg and always force Distribution Wizard

- Added 'xwiki.superadmin=1' alongside the password in 'xwiki.cfg' to properly activate the superadmin account during bootstrap.
- Simplified 'xwiki.properties': Distribution Wizard config is now always present instead of conditional on the superadmin switch.
- Ensures that the Distribution Wizard ('distribution.wizard.enabled=true') and flavor bootstrap run automatically on first startup.
- This fixes the issue where REST endpoints (/rest/jobs, /repositories) stayed at 404 because the DW never executed.

Ref: https://chat.openai.com/share/7a5d58d2-8e91-4e34-8fa0-8b7d62494e4a
This commit is contained in:
2025-09-16 23:29:07 +02:00
parent 364f4799bc
commit def6dc96d8
2 changed files with 4 additions and 5 deletions

View File

@@ -17,7 +17,9 @@ xwiki.authentication.ldap.update_user=1
{% else %} {% else %}
xwiki.authentication.authclass=com.xpn.xwiki.user.impl.xwiki.XWikiAuthServiceImpl xwiki.authentication.authclass=com.xpn.xwiki.user.impl.xwiki.XWikiAuthServiceImpl
{% endif %} {% endif %}
{% if xwiki_superadmin_enabled_switch | bool %} {% if xwiki_superadmin_enabled_switch | bool %}
# ---- Superadmin must live in xwiki.cfg (not in xwiki.properties) # ---- Superadmin must live in xwiki.cfg (not in xwiki.properties)
xwiki.superadminpassword={{ XWIKI_SUPERADMIN_PASSWORD }} xwiki.superadminpassword={{ XWIKI_SUPERADMIN_PASSWORD }}
xwiki.superadmin=1
{% endif %} {% endif %}

View File

@@ -17,17 +17,14 @@ oidc.groups.claim={{ XWIKI_OIDC_GROUPS_CLAIM }}
oidc.groups.mapping=XWiki.XWikiAdminGroup={{ XWIKI_OIDC_ADMIN_PROVIDER_GROUP }} oidc.groups.mapping=XWiki.XWikiAdminGroup={{ XWIKI_OIDC_ADMIN_PROVIDER_GROUP }}
{% endif %} {% endif %}
############################################
# Distribution Wizard (bootstrap)
# Render this block only during bootstrap when we temporarily enable the superadmin.
{% if xwiki_superadmin_enabled_switch | bool %}
# Start DW automatically and non-interactively # Start DW automatically and non-interactively
distribution.automaticStartOnMainWiki=true distribution.automaticStartOnMainWiki=true
distribution.automaticStartOnWiki=true distribution.automaticStartOnWiki=true
distribution.job.interactive=false distribution.job.interactive=false
# Default flavor for main wiki # Default flavor for main wiki
distribution.defaultUI=org.xwiki.platform:xwiki-platform-distribution-flavor-mainwiki distribution.defaultUI=org.xwiki.platform:xwiki-platform-distribution-flavor-mainwiki
{% endif %} distribution.skip=false
distribution.wizard.enabled=true
# Persist data in the Docker volume # Persist data in the Docker volume
environment.permanentDirectory={{ XWIKI_DOCK_DATA_DIR }} environment.permanentDirectory={{ XWIKI_DOCK_DATA_DIR }}