Allow to pass env variables to python runtime for Changedetection
-
Hey
I notice some watches in my changedetection instance are errored with a message about an environment variable to set somewhere

After I set this variable in env.sh, the variable is available in the container but is not passed to the context of the python3 runtime / changedetection.py, if someone can confirm my assumption?
https://git.cloudron.io/packages/changedetection-app/-/blob/master/start.sh?ref_type=heads so the error persists in changedetectionIf I'm not mistaken then, it could be enough to adapt the package's Dockerfile around https://git.cloudron.io/packages/changedetection-app/-/blob/master/start.sh?ref_type=heads#L25 so the env variables sourced from env.sh are taken into account by the python runtime?
Refs / examples usage
- https://github.com/dgtlmoon/changedetection.io/commit/bf3f8eae45b2be7bb54e10cf74f8bf8456456b42
- https://github.com/dgtlmoon/changedetection.io/commit/fe7aa38c651d73fe5f41ce09855fa8f97193747b
Thanks for reading and review/feedback! I hope this is not a case of a https://xyproblem.info/
-
@james I've sent you in PM an example problematic url
-
changedetection watch fails with:
Fetch blocked: '
https://my.domain.tld/' resolves to a private/reserved IP addressHowever the domain resolves to public IPs:
A <redacted public ipv4>
AAAA <redacted public ipv6>Inside the container:
dig my.domain.tld -> <redacted public ipv4>
getent hosts -> <redacted public ipv6>Both IPv4 and IPv6 connectivity work (curl -4 and curl -6 succeed).
So DNS and networking are fine. The issue appears to be the SSRF protection in changedetection misclassifying the resolved IPv6 address as private/reserved.
Setting:
ALLOW_IANA_RESTRICTED_ADDRESSES=true
should bypass the block and the fetch works but if I set that in env.sh, nothing changes because the changedetection python command that is run does not read those env
Looks like a false positive triggered when the resolver prefers the IPv6 address.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login