Skip to content

caddytls: Implement remote IP connection matcher#4123

Merged
mholt merged 2 commits intomasterfrom
match-conn-remote-ip
Apr 30, 2021
Merged

caddytls: Implement remote IP connection matcher#4123
mholt merged 2 commits intomasterfrom
match-conn-remote-ip

Conversation

@mholt
Copy link
Member

@mholt mholt commented Apr 19, 2021

I'm not sure this is a good idea as a replacement for auth, but I think this could still be useful. See https://caddy.community/t/best-solution-for-mixing-lan-and-cloudflare-authenticated-origin-pulls/12139/8

@mholt mholt added this to the v2.4.0 milestone Apr 19, 2021
@mholt mholt added the under review 🧐 Review is pending before merging label Apr 19, 2021
If both Ranges and NotRanges are specified, both must match.
@mholt mholt force-pushed the match-conn-remote-ip branch from 4df46e2 to 200e622 Compare April 29, 2021 22:08
@mholt
Copy link
Member Author

mholt commented Apr 30, 2021

I know this implementation using NotRanges might be disappointing, @francislavoie, but I realized that the connection policy matchers aren't really designed to be composed like the HTTP request matchers (conn policy matchers are only a list, whereas HTTP request matchers are a list of maps of lists). So I just went ahead with the simplest possible implementation to negate IP ranges.

@francislavoie
Copy link
Member

That's ok 👍

@mholt mholt removed the under review 🧐 Review is pending before merging label Apr 30, 2021
@mholt mholt merged commit 956f011 into master Apr 30, 2021
@mholt mholt deleted the match-conn-remote-ip branch April 30, 2021 16:14
@wazerstar
Copy link

Hey was this nuked again? I'm actually in this boat now, want to use same domain and when on lan with origin destination would avoid getting out on cloudflare and back in again before reaching internal.

@francislavoie
Copy link
Member

@wazerstar this isn't the right place to ask questions. Please ask on the forums instead, and fill out the help topic template: https://caddy.community

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants