Repository navigation
Conversation
Signed-off-by: YvesCesar <[email protected]>
Signed-off-by: YvesCesar <[email protected]>
vitormattos
left a comment
There was a problem hiding this comment.
Thanks for investigating the fresh-clone startup problems. The issues identified in this PR are valid, but I think we should revise the solution before merging.
The main goal of this repository is straightforward: a developer should be able to start the complete LibreSign SaaS environment, including the site, WordPress, Nextcloud, and their integrations, with a single make up command.
Since the nextcloud-development submodule was last updated, NCDD has introduced improvements that make part of the implementation proposed here unnecessary.
1. Update the NCDD submodule
The current submodule is pinned to commit 56660f4 from August 2026.
Since then, NCDD has introduced:
- A shared reverse proxy managed by
proxy-coordinator. - Canonical Nextcloud URLs configured through
NEXTCLOUD_HOSTandNEXTCLOUD_PROTOCOL. - Automatic configuration of
trusted_domains,overwritehost, andoverwriteprotocol. - Internal Docker network routing to the shared proxy.
- An updated startup lifecycle.
References:
- https://github.com/LibreCodeCoop/nextcloud-docker-development/blob/main/docs/advanced-setup.md
- LibreCodeCoop/nextcloud-docker-development#152
- LibreCodeCoop/nextcloud-docker-development#153
Please update the submodule to a tested revision and adapt the SaaS startup commands to the current NCDD interfaces.
Keep the submodule pinned to an explicit commit.
2. Remove the unnecessary Nextcloud networking workaround
The newly introduced docker-compose.nextcloud.override.yml publishes an additional nginx port through the Docker host gateway.
This workaround targets the older NCDD architecture. The current implementation uses a shared proxy and supports container access through Docker network aliases.
Please:
- Remove
docker-compose.nextcloud.override.yml. - Remove
DOCKER_HOST_GATEWAY_IPand the related gateway detection logic. - Use the existing NCDD proxy mechanisms for WordPress → Nextcloud communication.
- Review
_connect-networksand remove or adjust the manual network connection if it is no longer necessary.
There is an additional issue to resolve: the SaaS WordPress Compose override currently publishes host port 80, which conflicts with the port used by the NCDD shared proxy.
Please find the simplest configuration that allows WordPress, the site, and Nextcloud to coexist without conflicting host ports.
We do not need to introduce another reverse proxy or redesign the entire SaaS networking architecture. We only need the existing components to communicate reliably.
3. Reuse the canonical Nextcloud configuration
The new _set-trusted-domains target should not be necessary.
NCDD already configures the canonical hostname, trusted domains, and overwrite settings.
Please remove this target and avoid reading config/config.php directly from the Makefile.
Review NEXTCLOUD_LOCAL_URL, NEXTCLOUD_BASE_URL, and NEXTCLOUD_HTTP_PORT so that SaaS does not maintain unnecessary or conflicting Nextcloud URL configuration.
The WordPress integration should receive the correct Nextcloud URL derived from the NCDD configuration.
Since NCDD uses HTTPS by default, also verify that WordPress can reach the shared proxy with proper TLS certificate validation. We should not disable certificate verification to make the integration work.
4. Adjust only the affected Makefile targets
Please review the existing Nextcloud startup and integration targets against the updated NCDD.
In particular:
_refresh-nextcloud-images_start-nextcloud_wait-nextcloud_connect-networks_setup-apps_provision-user
Prefer the standard NCDD Compose lifecycle rather than maintaining an explicit list of infrastructure services that may become outdated.
Keep the responsibility boundaries clear:
- NCDD manages the Nextcloud runtime, proxy, networking, and canonical URL configuration.
- SaaS manages the integration between the site, WordPress, and Nextcloud, including application-specific setup and provisioning.
Preserve the existing make up, make down, and component-specific commands.
Do not refactor unrelated functionality.
5. Preserve the valid fixes and address startup failures
The env UID=... fix is valid and should stay.
The mysql → database service rename is also valid, although the startup command should be reconsidered based on the current NCDD lifecycle.
One additional problem was identified in the PR description: woocommerce-nextcloud-admin-group-manager cannot be activated because of a WordPress version incompatibility, and the failure is currently ignored.
Since this plugin is part of the SaaS integration, please verify its actual compatibility and fix the underlying issue. Do not bypass plugin version requirements or silently ignore activation failures.
The same principle applies to required provisioning steps: make up should not report success if an essential integration failed.
Keep this review limited to errors that affect the expected startup and integration behavior.
6. Add focused regression tests
The original problem was discovered when running make up on a fresh clone. We should prevent that regression from returning.
Please add automated coverage for the relevant startup and integration behavior.
At minimum, verify:
- The Compose configuration is valid with the updated NCDD.
- The required services start successfully.
- WordPress can reach Nextcloud through the configured hostname and protocol.
- An authenticated Nextcloud API request succeeds.
- Required applications and plugins are enabled.
- Running the setup again does not break existing configuration.
Keep tests proportional to this change. Prefer lightweight checks where possible and a focused Docker integration test for the actual connectivity.
There is no need to introduce a new testing framework or adopt NCDD's dev-worker functionality solely for this PR.
Expected outcome
The revised PR should:
- Update NCDD to a tested revision.
- Remove the unnecessary nginx override and host gateway workaround.
- Reuse NCDD's existing proxy and canonical URL configuration.
- Resolve the WordPress/Nextcloud networking and compatibility problems.
- Simplify the affected Makefile targets without expanding their responsibilities.
- Preserve the valid
UIDand database service fixes. - Ensure
make upstarts a functional environment and reports meaningful failures. - Include focused automated regression coverage.
The objective is to make use of improvements already available in NCDD, not to introduce new infrastructure functionality into SaaS.
Please keep the changes focused on making the existing single-command startup reliable. Any unrelated improvements can be handled in separate issues.
Signed-off-by: YvesCesar <[email protected]>
Signed-off-by: YvesCesar <[email protected]>
Signed-off-by: YvesCesar <[email protected]>
|
Thanks for the review! I reworked the PR on top of the current NCDD:
Could you take another look? |
Signed-off-by: YvesCesar <[email protected]>
…ution Signed-off-by: YvesCesar <[email protected]>
On a fresh clone of
main,make upfails for the site and Nextcloud stacks, and the WordPress → Nextcloud integration cannot reach Nextcloud. This PR fixes the startup on top of the currentnextcloud-development(NCDD) and reuses its shared proxy instead of adding networking workarounds.Changes
812fe2d. Nextcloud starts with the standard NCDD lifecycle (pull --ignore-buildable,up -d) instead of an explicit service list.SITE_COMPOSEusesenv UID=... docker compose ....UIDis readonly in bash, soUID=... docker composefailed withUID: readonly variable.https://nextcloud-development.localhostby default), read from the Nextcloud container. NCDD already managestrusted_domainsand the overwrite settings, so SaaS no longer sets them.mailpit,nginx) keep resolving to its own services._connect-networksconnects the NCDD shared proxy to the WordPress network with the Nextcloud hostname as an alias, which is the same mechanism NCDD uses for its own network. Only the WordPress database joins the NCDD network, aswordpress-mariadb, forwordpress_dsn.make downdisconnects both before removing the stacks.*.localhostto the loopback and skips Docker DNS, so the proxy alias is not reachable by name from PHP containers. A small mu-plugin, scoped to the Nextcloud host, resolves that hostname to the proxy and validates the certificate against the shared proxy's local CA. Certificate verification stays enabled. The CA volume is mounted as an external volume and created by the Makefile when missing, sodocker compose down -von the WordPress stack never deletes it.80and443, so WordPress now listens on8080(WORDPRESS_HTTP_PORT) athttp://127.0.0.1:8080. It uses127.0.0.1instead oflocalhostbecause the proxy sends HSTS forhttps://localhost. After visiting the proxy dashboard, browsers upgradehttp://localhost:8080to HTTPS and WordPress stops loading. Existing installs that still usehttp://localhostforhomeandsiteurlare moved to the new URL bymake up.make upstops when a component or the integration fails.docker-compose.nextcloud.override.yml,DOCKER_HOST_GATEWAY_IP,NEXTCLOUD_HTTP_PORT,NEXTCLOUD_BASE_URL,NEXTCLOUD_LOCAL_URLand_set-trusted-domains.Tests
make test-configvalidates the Compose configuration with the updated NCDD. It runs in CI.make test-integrationchecks the running environment and is run locally:mailpitto its own service;make upagain keeps the existing configuration.Validation
make up wordpress nextcloudandmake testpassed on a fresh clone (Fedora 44). The run used a WordPress 7.1 image built fromwordpress-docker(see notes). With the image currently published (WordPress 6.9.4),make upnow fails explicitly on the plugin activation instead of ignoring it.Notes
woocommerce-nextcloud-admin-group-managerrequires WordPress 7.0, but the publishedwordpress-dockerimage ships 6.9.4. The fix belongs towordpress-docker(bumpVERSION_WORDPRESSto 7.1), followed by a submodule bump here.wordpress_login_backend,admin_group_managerandgroupquotadeclare support up to Nextcloud 35, while NCDD runsmaster. They are enabled with--force. Before this PR,wordpress_login_backendwas silently never enabled.