cloudflare

Preventing Abuse: Cloud Functions for Firebase

有些话、适合烂在心里 提交于 2020-01-01 16:09:11
问题 What is the best way to stop an attacker from triggering a Cloud Function repeatedly, causing a huge bill or causing the project to run into quota limits? Some ideas: Use RTDB or Cloud Storage triggers as much as possible, since writes to those are protected by those products' security rules Put functions behind a service like Cloudflare Set up billing alerts, so a notification is sent if the monthly bill is unusually large 回答1: Check my answer here. Short breakdown of items from my answer :

Bypassing CloudFlare's time-out of 100 seconds

三世轮回 提交于 2020-01-01 03:39:34
问题 I am attempting to AJAX-ify my reports in order to bypass the 100 seconds time-out that CloudFlare imposes on requests that run through its site. See Is it possible to increase CloudFlare time-out? I did the following: function ajaxReport() { var seconds = prompt("Please enter how many seconds you want the report to run", "5"); $('#imgWaiting').show(); $.post("post/post_ajaxReport.jsp", { theParam:seconds },function(data) { $('#imgWaiting').hide(); window.location=data; }); } and the

How do I prevent Rails 3.1 from caching static assets to Rails.cache?

拜拜、爱过 提交于 2019-12-29 04:35:10
问题 I'm using CloudFlare CDN on my Rails 3.1 application. Cloudflare is a CDN that works at the DNS level. On the first hit to a static asset, CloudFlare loads it from your app then caches it in their CDN. Future requests for that asset load from the CDN instead of your app. The problem I'm having is that if you set controller caching to true: config.action_controller.perform_caching = true it enables the Rack::Cache middleware. Since Rails sets a default cache control setting for static assets,

Picking a random image out of different directories based on GEO locations

佐手、 提交于 2019-12-26 01:55:55
问题 The code for picking an random image out of a directory is pretty straight forward. For example; my current code is this: <?php $imagesDir = 'img/'; $images = glob($imagesDir . '*.{jpg,jpeg,png,gif}', GLOB_BRACE); $randomImage = $images[array_rand($images)]; // See comments ?> I want to use Cloudflare's GEO IP finder, so when the user visits the website it feeds back where the users from. So let's say I want, if england use directory > img/en/ if australia use directory > img/au/ if USA use

CloudFlare DNS / direct IP identifier

大城市里の小女人 提交于 2019-12-25 09:42:14
问题 We started to use cloudflare at my work and I want to understand how the cloudflare knows that I put dns name at my browser and not direct IP. I mean - how they knows if I put www.mysite.com and NOT 123.34.45.45 as URL on my browser. Is there any flag at HTTP GET header or any other identifier ? Many thanks. 回答1: That's how DNS works. "The Domain Name System distributes the responsibility of assigning domain names and mapping those names to IP addresses by designating authoritative name

s3 and cloudflare flexible ssl handshakes

大兔子大兔子 提交于 2019-12-25 09:39:57
问题 I'm wondering how secure this configuration is. So I have two servers, one for the frontend which serves a compiled static spa, and one for the backend which acts as an api. Each have their own cert from letsencrypt. I'm trying to run my frontend and s3 virtualhost (cdn.website.com - cname) through cloudflare. So from what I understand with the flexible, there's encryption between the user and cloudflare, but there's no encryption between cloudflare and the server. So when people hit the site

Assets not loaded when using CloudFlare SSL

江枫思渺然 提交于 2019-12-25 03:32:26
问题 I recently installed SSL from CloudFlare Flexible SSL but when I use https it doesn't seem to load image and CSS assets. I already disabled hotlink protection. Here are some images to illustrate the difference: Using https : http://gyazo.com/ef6ccb13c2c8f3f797dcb2d947a772cb Not using https : http://gyazo.com/be277259e0dcc8e395316b573de12935 Thankful for help! 回答1: A look at the browsers console shows lots of messages like this: Mixed Content: The page at 'https://hornetvault.com/' was loaded

Cloudflare SSL issue: Request origin does not match request base_url

痴心易碎 提交于 2019-12-25 02:59:12
问题 I have faced this error when I use rails_admin . Request origin does not match request base_url I use CloudFlare's Always Use HTTPS for making my rails application SSL. I saw this post and I have tried to change SSL to FULL. But that occurs Cloud Flare error. Do you have any ideas to solve that? 来源: https://stackoverflow.com/questions/54895855/cloudflare-ssl-issue-request-origin-does-not-match-request-base-url

Clear cache for all possible query parameter url for specific url - CloudFlare

笑着哭i 提交于 2019-12-24 07:35:49
问题 How can I find all urls with every possible query parameters? There is specific curl command launched with terminal for do this? For example i must clear cache for url: example.com/, example.com/lang=en, example.com/lang=es, ... 回答1: If you pay for higher plans you can purge cache with wildcards, such as example.com/lang=* . Otherwise you'll have to enter each page in the list. You might be better off clearing the entire cache. 来源: https://stackoverflow.com/questions/42579658/clear-cache-for

Get correct visitor IP through CloudFlare

北战南征 提交于 2019-12-24 03:30:29
问题 I'm using cPanel from someone else who resold it to me. This will probably mean I cannot use mod_cloudflare I would like to get the visitor's IP and not CloudFlare IP. The part of code I'm using: $_SERVER['REMOTE_ADDR'] That line will get the IP of cloud flare and not the original user's IP. Is there any way I can get the original IP address from the visitor? 回答1: Yes, but without access to the server configuration, you will be unable to utilize $_SERVER['REMOTE_ADDR'] . However, you can