Comments (4)
Seems I'm having the same issue with LetsEncrypt and Traefik. From what I can tell, the request handler is using "r.RemoteAddr" which is not looking at the actual forwarded headers. It should look for X-Forwarded-For
This makes it kind of difficult to run behind a reverse proxy, unless I'm missing something here. There do seem to be a few methods for accomplishing this with Go.
from docker-ddns.
I'm running docker-ddns behind Caddy as well, there's nothing special:
asd {
header / {
Strict-Transport-Security "max-age=31536000;"
Referrer-Policy "strict-origin-when-cross-origin"
X-Content-Type-Options "nosniff"
X-Frame-Options "DENY"
X-XSS-Protection "1; mode=block"
-Server
}
proxy / ddns:8080 {
transparent
}
}
Since docker-ddns does not use the REMOTE_ADDR request header but you have to pass you address manually (see the &addr=
part in your example that is empty in your case), it does not matter what docker-ddns sees as origin IP address. Just send alongside your IP address and it will work.
Hope this helps.
I don't know why in your case it takes the Docker network's IP address when the addr query param is empty but I didn't work with the code base for a longer time and I'm short in time so I cannot check right now.
from docker-ddns.
Thanks for your reply! I do understand that the IP can be defined in the request manually, it does read the IP if you leave the addr= empty. If I run this without a reverse proxy, it works fine. Similar issue here:
After some research into this, it seems that RemoteAddr only looks at the "last hop", which is going to be whatever the docker net IP of Caddy is.
https://husobee.github.io/golang/ip-address/2015/12/17/remote-ip-go.html
It does appear that "request_handler.go" is using RemoteAddr on line 56:
ip, _, err := net.SplitHostPort(r.RemoteAddr)
I'm using this to manage a number of edge computing devices as part of a larger project, so the ability to remotely detect and update the A record for each FQDN is fantastic. I could request the IP a dozen other ways and simply add it to the curl, but that's no fun. :)
I may sit down this weekend and brush up on some Go. If I something put together to read the "X-Forwarded-For", "X-Real-Ip" headers I'll submit a PR.
from docker-ddns.
This does not need any code change. You can just pass the value in the right place on your reverse proxy.
I'm not familiar with Caddy, but on Apache you'd do:
RewriteRule /update /update?addr=%{CONN_REMOTE_IP} [QSA,P]
The idea is that you can take out the header you are interested in at the proxy level and append it to the query string.
from docker-ddns.
Related Issues (20)
- Update TXT record HOT 3
- Trouble trying to use FreeNAS with docker-ddns HOT 1
- new REST api port and curl feature HOT 2
- Chellenge with Resolving my NS HOT 1
- [Question] Need help with configuration - Domain doesn't point to the correct IP from outside the server HOT 5
- badauth when trying to use DynDNS API HOT 3
- [Feature Request] Per Subdomain Secret HOT 1
- help with docker stack and dns record setup
- Linked guide in README is not accessible HOT 1
- Create a separate repository for the go source
- Update Dockerhub Image frequently
- filter for domains that use the fqdn (Zone) in the submit
- A-record timestamp as TXT-record
- Auto start docker
- HTTPS support for REST API
- Help for address already in use HOT 2
- Help HOT 2
- ddns behind nginx proxy
- Multiple domains HOT 2
- Port mapping
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-ddns.