nextcloud / all-in-one

📦 The official Nextcloud installation method. Provides easy deployment and maintenance with most features included in this one Nextcloud instance.
https://hub.docker.com/r/nextcloud/all-in-one
GNU Affero General Public License v3.0
5.3k stars 616 forks source link

"trusted_proxies" setting is not correctly set #5221

Closed ozboss closed 3 weeks ago

ozboss commented 4 weeks ago

Steps to reproduce

Create manual-install instance of nextcloud-aio.

Expected behavior

No errors in admin overview.

Actual behavior

Error in admin overview: Your "trusted_proxies" setting is not correctly set, it should be an array of IP addresses - optionally with range in CIDR notation.

Other information

The entrypoint.sh script of the nextcloud container automatically creates a trusted_proxies entry:

IPv4_ADDRESS="$(dig nextcloud-aio-nextcloud A +short +search | head -1)" 
IPv4_ADDRESS="$(echo "$IPv4_ADDRESS" | sed 's|[0-9]\+$|0/16|')" 
php /var/www/html/occ config:system:set trusted_proxies 10 --value="$IPv4_ADDRESS"

The problem is the result of the dig command is empty and the entry for trusted_proxies become an empty string. The IP for nextcloud-aio-nextcloud is resolved by the entry in /etc/hosts that is created by docker and does not result in a dns lookup that dig can report on.

The error disappears from the admin overview after running this command: php occ config:system:delete trusted_proxies 10

I am using podman but the behavior should be the same for docker.

Zoey2936 commented 4 weeks ago

this problem should only exist in podman, which is not supported

szaimen commented 3 weeks ago

this problem should only exist in podman, which is not supported

Indeed.

See https://github.com/nextcloud/all-in-one?tab=readme-ov-file#can-i-run-this-with-podman-instead-of-docker