notify_push
notify_push copied to clipboard
Enhancement: use gethostbyname for dynamic trusted_proxies (like php of nextcloud does)
Hi, I have setup all correctly, but I get:
push server is not a trusted proxy, please add '172.22.1.1' to the list of trusted proxies or configure any existing reverse proxy to forward the 'x-forwarded-for' send by the push server.
As you can see, is 172.22.1.1 a dynamic ip from docker, I use multiple docker-compose files and and multiple networks (dynamic ips), is there any way to dynamically. Setting the ip of this docker network to static would make it less flexible, so something like gethostbyname would be great, if it would work also for notify_push:
https://github.com/nextcloud/documentation/issues/7005#issuecomment-845993541
the push daemon doesn't check the trusted proxies itself, it just adds itself to the list of proxies the request has passed trough. So any trick that can be used by nextcloud should work fine with notify_push to
Here is the error in my docker container:
Error:
nextcloud-notify_push | 0: Failed to parse config
nextcloud-notify_push | 1: Failed to parse nextcloud config
nextcloud-notify_push | 2: Error while parsing php literal:
nextcloud-notify_push | 2: .. |
nextcloud-notify_push | 2: 79 | 'trusted_proxies' =>
nextcloud-notify_push | 2: 80 | array (
nextcloud-notify_push | 2: 81 | 0 => gethostbyname('nginx'),
nextcloud-notify_push | 2: | ^^ No valid token found, expected one of [Bool, Integer, Float, LiteralString, Null, Array, SquareOpen]
nextcloud-notify_push | 2: 82 | ),
nextcloud-notify_push | 2: 83 | );
nextcloud-notify_push | 2:
I am facing the same issue. I need gethostbyname() in trusted_proxies for dynamic docker IPs which change on container recreation. Thats currently not possible with notify_push and results in the above error.
this would be great!
I would like to see this as well. I am currently in the process of trying to follow this after upgrading to Nextcloud 29. And it feels like it might be a major piece to getting notify_push working within docker
I recently switched my Docker stacks from static IPs to hostnames, as this is much easier to maintain. Unfortunately, I also realized that push_notify no longer works in this case.