Hello Vaish,
I've been using CRL for a fleet of Drupal sites to great effect.
One problem we were running into was rate limiting being applied to our team of editors who were all working from the same IP address, using browsers with identical user agents.
When enough editors were working on the site at the same time, CRL limited them, which wasn't ideal.
The attached patch allows an administrator to specify IP addresses (either as individual addresses, or a range) which should never be rate limited, as a comma-separated list - e.g.:
1.2.3.4,1.2.3.0/8,5.4.3.2
The patch also updates the Readme accordingly.
Hopefully this will be useful to someone!
/Alex
Issue fork crawler_rate_limit-3409793
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
alexgreyhead commentedComment #3
alexgreyhead commentedComment #4
vaish commentedHello Alex,
I'm really glad to hear you are finding the module useful. Thanks for the patch. I still didn't have time to review it but this feature is something that I find useful addition to the module. Would you mind creating a merge request. It might be easier for me to review it that way.
Best,
Vaish
Comment #5
mgaskey commentedRe-rolling patch in #3 for latest updates in beta2 release.
Comment #7
mgaskey commentedHi Vaish
I've added an MR with Alex's changes, and my re-roll for the latest version.
Comment #8
roman.haluska commentedSmall doc fix
Comment #9
vaish commentedComment #11
vaish commentedThanks everyone. Please note that merged version contains some important changes compared to the initial MR.
1. Allowlist setting has been changed to an array and renamed:
2. Function
updateClientIpXForwardedFor()has been removed. I believe that this functionality does not belong here. Figuring out real IP address should be handled for the whole Drupal install and not for a single module. Additionally, this particular implementation has been focused on Cloudflare and may or may not work with other proxies. Note that Symfony'sgetClientIp()method can read the client IP address from the "X-Forwarded-For" header when trusted proxies were set via "setTrustedProxies()". Drupal exposes this as a setting in the settings.php file. See:Comment #12
vaish commentedThanks for the patch, @roman.haluska. Note that your patch came in at the same time I made some changes and removed the function you patched from the final version. See my previous comment for more details.