Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added config #1

Merged
merged 2 commits into from

2 participants

@ram-nadella

User can now configure the URL where site visitors can go to fix the issue

@MikeSofaer MikeSofaer merged commit 5299ce8 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 22 additions and 3 deletions.
  1. +19 −1 cloudflare.json
  2. +3 −2 public/javascripts/dnschanger_detector.js
View
20 cloudflare.json
@@ -20,6 +20,24 @@
"Language": "English",
"Price": "Free",
"Restrictions": "None"
- }
+ },
+ "interface": [
+ {
+ "id": "fix_url",
+ "name": "Pick a URL",
+ "description": "Infected users will be notified and will be shown a URL where they can get more information about the infection and a way to fix it",
+ "type": "select",
+ "options": [
+ {
+ "label": "McAfee info page",
+ "value": "http://home.mcafee.com/VirusInfo/VirusProfile.aspx?key=1098704"
+ },
+ {
+ "label": "F-Secure info page",
+ "value": "http://www.f-secure.com/v-descs/dnschang.shtml"
+ }
+ ]
+ }
+ ]
}
}
View
5 public/javascripts/dnschanger_detector.js
@@ -1,4 +1,4 @@
-CloudFlare.define("dnschanger_detector", ["cloudflare/dom"], function(dom){
+CloudFlare.define("dnschanger_detector", ["cloudflare/dom", "cloudflare/config"], function(dom){
window.dnsChangerPresent = function(){
var message = dom.createElement("div");
dom.setAttribute(message, "style", 'z-index: 100000; width:100%; text-align:center; position: absolute; top: 0; left: 0; margin: 0 0 20px 0; padding: 10px; background-color: #f0f0f0; color: #404040; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; border-bottom: 1px solid #a5a5a5;');
@@ -8,7 +8,8 @@ CloudFlare.define("dnschanger_detector", ["cloudflare/dom"], function(dom){
message.appendChild(warning);
var info = dom.createElement("p");
dom.setAttribute(info, "style", 'font-size: 12px;');
- info.innerHTML = 'Please visit <a href="http://www.dcwg.org/fix/" target="blank">http://www.dcwg.org/fix/.</a> for help fixing your DNS. <strong>You may lose access to the Internet after July 9, 2012 if you don\'t fix this.</strong><br/> For additional information regarding the DNS changer malware, please visit the <a href="http://www.fbi.gov/news/stories/2011/november/malware_110911" target="blank">FBI\'s website</a>.<br/> <span class="powered">DNS Changer warning powered by <a href="http://www.cloudflare.com/">CloudFlare</a>.</span></p>';
+ var fix_url = ('fix_url' in config && fix_url !== "")? config.fix_url : "http://www.dcwg.org/fix/";
+ info.innerHTML = 'Please visit <a href="'+ fix_url +'" target="blank">'+ fix_url +'</a> for help fixing your DNS. <strong>You may lose access to the Internet after July 9, 2012 if you don\'t fix this.</strong><br/> For additional information regarding the DNS changer malware, please visit the <a href="http://www.fbi.gov/news/stories/2011/november/malware_110911" target="blank">FBI\'s website</a>.<br/> <span class="powered">DNS Changer warning powered by <a href="http://www.cloudflare.com/">CloudFlare</a>.</span></p>';
message.appendChild(info);
document.body.appendChild(message);
}
Something went wrong with that request. Please try again.