mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-08 05:39:49 -05:00
[GH-ISSUE #518] GeoBlock per Resource #1485
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Sf298 on GitHub (Apr 12, 2025).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/518
Issue Description
Hello! I am loving the GeoBlock plugin, however there are some Resources that I do want to expose to the global community. This does not seem to be currently possible
Ideal Solution
It would be amazing if, once the GeoBlock plugin is enabled, we could have a new option in the "Match Type" dropdown in the Resource > Rules section. The new option could be called 'Countries', and accept a comma separated list of country codes.
More Realistic Solution
If it is difficult to update the UI to handle this, then we could use a custom version of the GeoBlock plugin (or create a PR to enhance GeoBlock), that lets you apply different filters based on subdomain.
Implementation Suggestion
Looking at it's code, it seems easy to modify GeoBlock to add the ability to consider subdomains (by checking the URL parameter of the http.Request, in the allowDenyIPAddress functions).
I am quite keen on finding some kind of per Resource geo-blocking solution, so let me know if you need help with the plugin and I'll try to find the time.
@hhftechnology commented on GitHub (Apr 14, 2025):
https://forum.hhf.technology/t/enhancing-your-pangolin-deployment-with-middleware-manager/
With this you can set it per resources any middlwares
https://github.com/hhftechnology/middleware-manager
@mightyjens commented on GitHub (Apr 14, 2025):
This is so good, @hhftechnology !
My geoblocking-template:
traefik_config.yml
templates.yaml
@hhftechnology commented on GitHub (Apr 14, 2025):
glad it worked for you
@hhftechnology commented on GitHub (Apr 17, 2025):
@miloschwartz please close this as well