-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: SetupChecks for mjs does not work behind proxy with overwritewebroot #43453
Comments
To be clear, the only bug is that (a) checksetup takes a long time because it has to wait for the curl to redacted.com (not accessible on the internal network) to timeout, and (b) after the timeout, the app issues a warning. The manual check in my case does pass (so the warning can be ignored):
|
This may be my configuration error (not a bug). It seem that from the php app container, curl can connect to hosts on the internet, but cannot connect to the proxy server. |
Probably does not help you much, but I have the same issue with an apache2 Nextcloud instance behind a NGINX proxy. |
OK - my app container can curl off remote hosts, but not off the proxy container. I'm going to chalk this up to a configuration problem in docker. If I set the ip of the proxy host in /etc/hosts on the php app container, it does work, the app is happy, and the warning message is gone:
That's not a very robust workaround, though, since the gateway net number changes on every boot. Is there a better way to allow the php app container to curl to the proxy container? |
Sorry if I am misunderstanding your problem, maybe I am confusing it with mine. And I also don't know anything about Docker, but to me it seems like this is a DNS problem right? |
Ugh. I figured it out (probably of use to no one, but I'll leave it here for the google foo). My redacted.com host IP address actually a wireguard ip address (it is internal to a VPN), and wireguard's default networking setup drops non-local packets destined to the wireguard ip address if they don't come in through the wireguard gateway. So the docker container sends a packet to the vpn IP address on the host, and it comes through the docker0 bridge, and gets dropped as non-local. The only thing that is broken is when the nextcloud app tries to fetch from itself using the proxy trusted_domain, and the only place I've seen that happen is in the SetupCheck that validates mjs content-type. Closing this. |
Bug description
Using the configuration suggested in https://github.com/nextcloud/docker/blob/master/.examples/docker-compose/with-nginx-proxy/mariadb, with the addition of an overwritewebroot (so that my nextcloud appears at https://redacted.com/nextcloud) the SetupChecks for mjs (new in Nextcloud 7 Hub 28.0.2) configuration fails as in #42989 even with the fix provided by #42999.
Debug log entry (redacting server name):
Steps to reproduce
Expected behavior
The server is properly configured, so I'd expect the MJS warning to not appear.
Installation method
Community Docker image
Nextcloud Server version
28
Operating system
None
PHP engine version
None
Web server
Nginx
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
Configuration report
No response
List of activated Apps
No response
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
The new warning message, while well-intentioned, is guaranteed to be fragile, since it attempts to determine from inside the php app host what the content-type that the end-user browser sees, and in the face of "client browser to proxy to web server to fpm" transformations (which is the docker configuration in the example) and server configuration flexibility (e.g. overwritereboot), that is simply impossible to guarantee if executed from inside the php app.
Another, perhaps more robust, approach could call /settings/ajax/checksetup with a block of data that assesses what the client sees (for example,
{"client-observed-mjs-content-type":"application/javascript", etc.}
, which the checksetup script could reflect back as warnings where the client-side observation(s) are incorrect.The text was updated successfully, but these errors were encountered: