lucaslorentz / caddy-docker-proxy

Caddy as a reverse proxy for Docker
MIT License
2.61k stars 163 forks source link

Enable localhost:2019/config/ #611

Closed sowinski closed 2 months ago

sowinski commented 2 months ago

Hi,

I currently trying to get the current config over the admin api.

I started to use curl "http://localhost:2019/config/" to see the current configuration. But it returns nothing.

When I go into the container to /config/caddy/Caddyfile.autosave I can see that there are my settings. Also they are working fine.

I currently want to print my config and add something dynamically during runtime. (I want to block some ips which ddos my server for example 24hours.)

Is this caddy feature turned of in caddy-docker-proxy?

francislavoie commented 2 months ago

You shouldn't try to use the admin API when using CDP, because any label changes will clobber any changes you make via the admin API. It's fundamentally incompatible.

What are you trying to do exactly? https://xyproblem.info/

sowinski commented 2 months ago

What are you trying to do exactly? https://xyproblem.info/

1.) I have currently a scammer which I trying to break into my system. He is producing a lot of traffic and I want to block his IP temporarily. (Without restarting the server if possible). What other option do I have? 2.) Next step would be to implement a rate limiter per IP which do not allow like 100 requests per minute or 10 POST per minute)

francislavoie commented 2 months ago

Use iptables to block the IP at the network level before it reaches Caddy.

I don't understand why this would require the use of the admin API.

sowinski commented 2 months ago

Okay thank you!

So I won't touch the admin API anymore.