mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-05-03 16:52:40 +02:00
Add denyHosts flag to deny URLs for certain hosts
For example, when running in a Docker swarm cluster we dont want it to have access to our internal services available under *.weave.local Closes #85
This commit is contained in:
parent
127a621c8a
commit
7264d177a1
3 changed files with 29 additions and 8 deletions
|
|
@ -44,6 +44,7 @@ const defaultMemorySize = 100
|
|||
var addr = flag.String("addr", "localhost:8080", "TCP address to listen on")
|
||||
var allowHosts = flag.String("allowHosts", "", "comma separated list of allowed remote hosts")
|
||||
var whitelist = flag.String("whitelist", "", "deprecated. use 'allowHosts' instead")
|
||||
var denyHosts = flag.String("denyHosts", "", "comma separated list of denied remote hosts")
|
||||
var referrers = flag.String("referrers", "", "comma separated list of allowed referring hosts")
|
||||
var baseURL = flag.String("baseURL", "", "default base URL for relative remote URLs")
|
||||
var cache tieredCache
|
||||
|
|
@ -70,6 +71,9 @@ func main() {
|
|||
if *allowHosts != "" {
|
||||
p.AllowHosts = strings.Split(*allowHosts, ",")
|
||||
}
|
||||
if *denyHosts != "" {
|
||||
p.DenyHosts = strings.Split(*denyHosts, ",")
|
||||
}
|
||||
if *referrers != "" {
|
||||
p.Referrers = strings.Split(*referrers, ",")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue