Skip to content

IP prefix module for Caddy that combines the output of other IP prefix modules.

License

Notifications You must be signed in to change notification settings

fvbommel/caddy-combine-ip-ranges

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IP prefix combining module for Caddy

This module retrieves IP prefixes from other modules and combines them into a single list of IP prefixes for use in Caddy trusted_proxies directives.

NOTE: it doesn't actually merge adjacent or overlapping prefixes, it just puts all of the sub-results into a big list and returns that.

Available sub-directives

This Caddy documentation page lists all known modules that should theoretically work as sub-directives of this one, though not all of those have been tested in that configuration.

Example config

An example configuration you might use while experimenting with different ways to put your site behind Cloudflare:

trusted_proxies combine {
    # For access via Cloudflare directly, using github.com/WeidiDeng/caddy-cloudflare-ip
    cloudflare
    # For access using cloudflared container on the local Docker bridge network, using github.com/fvbommel/caddy-dns-ip-range
    dns cloudflared
}

This will trust both public Cloudflare IPs and the one cloudflared is "borrowing" on your internal network (assuming it's registered in the local DNS).

There are no other settings, though you can of course pass settings to each individual sub-directive:

trusted_proxies combine {
    cloudflare {
        interval 12h
        timeout 15s
    }
    dns cloudflared {
        interval 1m
    }
}

About

IP prefix module for Caddy that combines the output of other IP prefix modules.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages