Closed anandslab closed 4 years ago
Hi @htpcBeginner,
Inspired by your tutorial, I've investigated further: there is no variable "API_KEY_FILE" defined in the scripts.
I've built a custom docker image, @oznu in file root/app/cloudflare.sh I've added, in the first line of the cloudflare function this code:
if [ -f "$API_KEY_FILE" ]; then API_KEY=$(cat $API_KEY_FILE) fi
So that API_KEY is populated every time cloudflare function is called, by the content of the file, in this case the docker secret.
Hope I helped,
GZ
Wonderful. Can you upload the image or share the dockerfile?
Also a suggestion, a scoped api token would be better than api key.
Hi @htpcBeginner,
I forked the repo, applied the changes and pushed the image to Docker Hub: https://hub.docker.com/r/gzecchi/cloudflare-ddns.
I've tested the container with a Scoped API Token as well and it works because the API calls to the DNS are the same, it's just a change in the header of the call.
GZ
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I could not pass Cloudflare api token via Docker secrets. With .env variables, this image works perfectly. With secrets, I get:
Here is my Docker Compose:
Any help would be much appreciated.