Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove

  • Loading branch information...
commit 4b293d34080b59450d747b4b1aeae31a16863b8b 1 parent f9c031d
Philipp Waldmann authored
Showing with 0 additions and 13,863 deletions.
  1. +0 −279 docs/examples/reload_rules.js.html
  2. +0 −293 docs/examples/remote_rule_change.js.html
  3. +0 −322 docs/examples/test.js.html
  4. +0 −671 docs/lib/core.js.html
  5. +0 −282 docs/lib/rules/category.js.html
  6. +0 −284 docs/lib/rules/category_file.js.html
  7. +0 −271 docs/lib/rules/file_type.js.html
  8. +0 −415 docs/lib/rules/group.js.html
  9. +0 −296 docs/lib/rules/ip.js.html
  10. +0 −277 docs/lib/rules/match.js.html
  11. +0 −272 docs/lib/rules/ou.js.html
  12. +0 −325 docs/lib/rules/time.js.html
  13. +0 −265 docs/lib/rules/user.js.html
  14. +0 −412 docs/lib/sources/ldap.js.html
  15. +0 −531 docs/lib/sources/redis.js.html
  16. +0 −324 docs/lib/squid.js.html
  17. +0 −253 docs/lib2/helper/cache.js.html
  18. +0 −253 docs/lib2/helper/faye.js.html
  19. +0 −268 docs/lib2/helper/index.js.html
  20. +0 −252 docs/lib2/helper/ldap.js.html
  21. +0 −399 docs/lib2/helper/logger.js.html
  22. +0 −340 docs/lib2/helper/redis.js.html
  23. +0 −376 docs/lib2/helper/rules.js.html
  24. +0 −254 docs/lib2/index.js.html
  25. +0 −245 docs/lib2/initializers/faye.js.html
  26. +0 −251 docs/lib2/initializers/index.js.html
  27. +0 −245 docs/lib2/initializers/ldap.js.html
  28. +0 −247 docs/lib2/initializers/logger.js.html
  29. +0 −245 docs/lib2/initializers/redis.js.html
  30. +0 −309 docs/lib2/rule.js.html
  31. +0 −386 docs/lib2/rules/category.js.html
  32. +0 −284 docs/lib2/rules/category_file.js.html
  33. +0 −271 docs/lib2/rules/file_type.js.html
  34. +0 −415 docs/lib2/rules/group.js.html
  35. +0 −260 docs/lib2/rules/index.js.html
  36. +0 −296 docs/lib2/rules/ip.js.html
  37. +0 −277 docs/lib2/rules/match.js.html
  38. +0 −272 docs/lib2/rules/ou.js.html
  39. +0 −325 docs/lib2/rules/time.js.html
  40. +0 −265 docs/lib2/rules/user.js.html
  41. +0 −386 docs/lib2/types/category.js.html
  42. +0 −284 docs/lib2/types/category_file.js.html
  43. +0 −271 docs/lib2/types/file_type.js.html
  44. +0 −415 docs/lib2/types/group.js.html
Sorry, we could not display the entire diff because it was too big.
279 docs/examples/reload_rules.js.html
View
@@ -1,279 +0,0 @@
-<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width" charset="utf-8"><title>squid3_sentry</title><!-- Foundation CSS--><link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/css/foundation.min.css"><!-- Prism CSS--><style type="text/css">/**
- * prism.js default theme for JavaScript, CSS and HTML
- * Based on dabblet (http://dabblet.com)
- * @author Lea Verou
- */
-
-code[class*="language-"],
-pre[class*="language-"] {
- color: black;
- text-shadow: 0 1px white;
- font-family: Consolas, Monaco, 'Andale Mono', monospace;
- direction: ltr;
- text-align: left;
- white-space: pre;
- word-spacing: normal;
-
- -moz-tab-size: 4;
- -o-tab-size: 4;
- tab-size: 4;
-
- -webkit-hyphens: none;
- -moz-hyphens: none;
- -ms-hyphens: none;
- hyphens: none;
-}
-
-::-moz-selection {
- text-shadow: none;
- background: #b3d4fc;
-}
-
-::selection {
- text-shadow: none;
- background: #b3d4fc;
-}
-
-@media print {
- code[class*="language-"],
- pre[class*="language-"] {
- text-shadow: none;
- }
-}
-
-/* Code blocks */
-pre[class*="language-"] {
- padding: 1em;
- margin: .5em 0;
- overflow: auto;
-}
-
-:not(pre) > code[class*="language-"],
-pre[class*="language-"] {
- background: #f5f2f0;
-}
-
-/* Inline code */
-:not(pre) > code[class*="language-"] {
- padding: .1em;
- border-radius: .3em;
-}
-
-.token.comment,
-.token.prolog,
-.token.doctype,
-.token.cdata {
- color: slategray;
-}
-
-.token.punctuation {
- color: #999;
-}
-
-.namespace {
- opacity: .7;
-}
-
-.token.property,
-.token.tag,
-.token.boolean,
-.token.number {
- color: #905;
-}
-
-.token.selector,
-.token.attr-name,
-.token.string {
- color: #690;
-}
-
-.token.operator,
-.token.entity,
-.token.url,
-.language-css .token.string,
-.style .token.string {
- color: #a67f59;
- background: hsla(0,0%,100%,.5);
-}
-
-.token.atrule,
-.token.attr-value,
-.token.keyword {
- color: #07a;
-}
-
-
-.token.regex,
-.token.important {
- color: #e90;
-}
-
-.token.important {
- font-weight: bold;
-}
-
-.token.entity {
- cursor: help;
-}
-</style><!-- Custom Styles--><style type="text/css">h1.page-title small {
- font-weight: 400;
-}
-/*.section-container, .section-container .section .title
- border-color #e6e6e6*/
-#nav .section.active {
- padding-top: 0 !important;
-}
-#nav .section.active .title {
- background: #ddd;
-}
-#nav .section .title {
- background-color: #eee;
-}
-#nav .section .title a {
- font-weight: 700;
- padding: 0.6em;
-}
-#nav .section .title a small {
- font-size: 0.8em;
- line-height: 1em;
- display: block;
- color: #888;
- margin: 2px 0 -2px;
-}
-#nav .section .title:hover {
- background: #ddd;
-}
-#nav ul.solo {
- border-top: 1px solid #ccc;
- padding: 0.875em;
-}
-code {
- background: transparent;
- line-height: 1.3em;
- font-weight: normal;
-}
-.comment {
- position: relative;
- padding-bottom: 1.5em;
- margin-bottom: 2em;
- border-bottom: 1px solid #ddd;
-}
-.comment ol,
-.comment ul {
- margin-left: 2.25em;
-}
-.comment ol.no-bullet,
-.comment ul.no-bullet {
- margin-left: 0;
-}
-.comment header {
- margin-bottom: 1.5em;
-}
-.comment header h1 {
- font-size: 2rem;
- margin-bottom: 0.2em;
-}
-.comment .section-container,
-.comment .section-container > .section > .content {
- border: none;
-}
-.comment .section-container > .section > .title {
- padding: auto;
- background: none !important;
- border: none !important;
-}
-.comment .section-container > .section > .title a {
- border-radius: 4px;
- font-weight: 700;
- padding: 1px 10px 1px 0;
- margin-right: 5px;
- color: #ccc;
-}
-.comment .section-container > .section:hover .title a {
- color: #999;
-}
-.comment .section-container > .section.active .title a {
- color: #2ba6cb;
-}
-.comment .section-container > .section > .content {
- padding: 0.9em 0 0;
-}
-.comment div.description h2 {
- font-size: 1.2em;
-}
-.comment .tags span {
- margin-right: 4px;
-}
-.comment .tags .name,
-.comment .tags .type {
- font-weight: 700;
-}
-.comment .tags .types {
- color: #666;
-}
-.comment .tags .description {
- margin-left: 15px;
-}
-.ctx-type {
- margin-right: 6px;
- font-size: 0.7em;
-}
-</style><script srr="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/js/vendor/custom.modernizr.js"></script></head><body><div class="row"><div class="small-12 columns"><h1 class="page-title">squid3_sentry<small> examples/reload_rules.js</small></h1></div></div><div class="row"><div id="nav" class="large-3 columns"><div data-section="accordian" data-options="" class="section-container accordian"><div class="section active"><p data-section-title class="title"><a href="../../docs/examples/reload_rules.js.html"><small>examples/</small>reload_rules.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/examples/reload_rules.js.html#crypto">crypto</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/examples/remote_rule_change.js.html"><small>examples/</small>remote_rule_change.js</a></p><div data-section-content class="content"><ul class="side-nav"></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/examples/test.js.html"><small>examples/</small>test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/examples/test.js.html#Core">Core</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/core.js.html"><small>lib/</small>core.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/core.js.html#async">async</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rule.js.html"><small>lib/</small>rule.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rule.js.html#Rule">Rule</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/category.js.html"><small>lib/rules/</small>category.js</a></p><div data-section-content class="content"><ul class="side-nav"></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/category_file.js.html"><small>lib/rules/</small>category_file.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/category_file.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/file_type.js.html"><small>lib/rules/</small>file_type.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/file_type.js.html#url">url</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/group.js.html"><small>lib/rules/</small>group.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/group.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/ip.js.html"><small>lib/rules/</small>ip.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/ip.js.html#Netmask">Netmask</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/match.js.html"><small>lib/rules/</small>match.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/match.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/ou.js.html"><small>lib/rules/</small>ou.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/ou.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/time.js.html"><small>lib/rules/</small>time.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/time.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/user.js.html"><small>lib/rules/</small>user.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/user.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/sources/ldap.js.html"><small>lib/sources/</small>ldap.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/sources/ldap.js.html#ldap">ldap</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/sources/redis.js.html"><small>lib/sources/</small>redis.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/sources/redis.js.html#redis">redis</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/squid.js.html"><small>lib/</small>squid.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/squid.js.html#Core">Core</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/index.js.html"><small>lib2/</small>index.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/index.js.html#Sentry">Sentry</a></li><li><a href="../../docs/lib2/index.js.html#rules">rules</a></li><li><a href="../../docs/lib2/index.js.html#isAllowed">isAllowed</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/category.js.html"><small>lib2/rules/</small>category.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/category.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/category_file.js.html"><small>lib2/rules/</small>category_file.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/category_file.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/file_type.js.html"><small>lib2/rules/</small>file_type.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/file_type.js.html#url">url</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/group.js.html"><small>lib2/rules/</small>group.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/group.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/index.js.html"><small>lib2/rules/</small>index.js</a></p><div data-section-content class="content"><ul class="side-nav"></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/ip.js.html"><small>lib2/rules/</small>ip.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/ip.js.html#Netmask">Netmask</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/match.js.html"><small>lib2/rules/</small>match.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/match.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/ou.js.html"><small>lib2/rules/</small>ou.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/ou.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/time.js.html"><small>lib2/rules/</small>time.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/time.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/user.js.html"><small>lib2/rules/</small>user.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/user.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/test/cache-test.js.html"><small>test/</small>cache-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/test/cache-test.js.html#vows">vows</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/test/core-test.js.html"><small>test/</small>core-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/test/core-test.js.html#vows">vows</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/test/rules-test.js.html"><small>test/</small>rules-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/test/rules-test.js.html#vows">vows</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/test/squid-test.js.html"><small>test/</small>squid-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/test/squid-test.js.html#vows">vows</a></li></ul></div></div></div></div><div class="small-12 large-9 columns"><article class="comment"><header><h1 id="crypto">crypto</h1><h5 class="subheader"><div class="label radius ctx-type">declaration</div>crypto</h5></header><ul class="no-bullet tags"></ul><div data-section="accordian" data-options="one_up: false;" class="section-container code auto"><div class="section"><p data-section-title class="title"><a href="#">Description</a></p><div data-section-content class="content description"></div></div><div class="section"><p data-section-title class="title"><a href="#">Source</a></p><div data-section-content class="content"><pre><code class="language-javascript">var crypto = require('crypto');
-var redis = require('redis').createClient();
-
-var name = 'test';
-var prefix = 'sentry';
-var rules = [{
- name: 'nindl',
- categories: ['porn'],
- allowed: true
-}];
-
-
-redis.lrange(prefix + ':rules:' + name, 0, -1, function(err, elements){
- var transaction = redis.multi();
-
- if(elements.length &gt; 0){
- transaction.del(elements);
- transaction.del(prefix + ':rules:' + name);
- }
-
- var sha;
- for(var i in rules){
- sha = crypto.createHash('sha1').update(name + i).digest('hex');
- transaction.rpush(prefix + ':rules:' + name, prefix + ':rule:' + sha);
- transaction.set(prefix + ':rule:' + sha, JSON.stringify(rules[i]));
- }
-
- transaction.publish(name, 'reload');
- transaction.exec(function(err){
- if(!err){
- console.log('Rules written!');
- process.exit(0);
- }
- });
-});</code></pre></div></div></div></article></div></div><!-- Foundation JS--><script type="text/javascript">document.write('<script src=' +
-('__proto__' in {} ? 'http://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min' : 'http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min') +
-'.js><\/script>')
-</script><script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/js/foundation.min.js"></script><script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/js/foundation/foundation.reveal.min.js"></script><!-- Prism js--><script type="text/javascript">
-/**
- * Prism: Lightweight, robust, elegant syntax highlighting
- * MIT license http://www.opensource.org/licenses/mit-license.php/
- * @author Lea Verou http://lea.verou.me
- */(function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');for(var i=0,s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement:function(r,i,s){var o,u,a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,""])[1];u=t.languages[o]}if(!u)return;r.className=r.className.replace(e,"").replace(/\s+/g," ")+" language-"+o;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+o);var f=r.textContent;if(!f)return;f=f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ");var l={element:r,language:o,grammar:u,code:f};t.hooks.run("before-highlight",l);if(i&&self.Worker){var c=new Worker(t.filename);c.onmessage=function(e){l.highlightedCode=n.stringify(JSON.parse(e.data),o);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(l.element);t.hooks.run("after-highlight",l)};c.postMessage(JSON.stringify({language:l.language,code:l.code}))}else{l.highlightedCode=t.highlight(l.code,l.grammar,l.language);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(r);t.hooks.run("after-highlight",l)}},highlight:function(e,r,i){return n.stringify(t.tokenize(e,r),i)},tokenize:function(e,n,r){var i=t.Token,s=[e],o=n.rest;if(o){for(var u in o)n[u]=o[u];delete n.rest}e:for(var u in n){if(!n.hasOwnProperty(u)||!n[u])continue;var a=n[u],f=a.inside,l=!!a.lookbehind,c=0;a=a.pattern||a;for(var h=0;h<s.length;h++){var p=s[h];if(s.length>e.length)break e;if(p instanceof i)continue;a.lastIndex=0;var d=a.exec(p);if(d){l&&(c=d[1].length);var v=d.index-1+c,d=d[0].slice(c),m=d.length,g=v+m,y=p.slice(0,v+1),b=p.slice(g+1),w=[h,1];y&&w.push(y);var E=new i(u,f?t.tokenize(d,f):d);w.push(E);b&&w.push(b);Array.prototype.splice.apply(s,w)}}}return s},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e,r,i){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(function(t){return n.stringify(t,r,e)}).join("");var s={type:e.type,content:n.stringify(e.content,r,i),tag:"span",classes:["token",e.type],attributes:{},language:r,parent:i};s.type=="comment"&&(s.attributes.spellcheck="true");t.hooks.run("wrap",s);var o="";for(var u in s.attributes)o+=u+'="'+(s.attributes[u]||"")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'" '+o+">"+s.content+"</"+s.tag+">"};if(!self.document){self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}})();;
-Prism.languages.markup={comment:/&lt;!--[\w\W]*?-->/g,prolog:/&lt;\?.+?\?>/,doctype:/&lt;!DOCTYPE.+?>/,cdata:/&lt;!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/&lt;\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^&lt;\/?[\w:-]+/i,inside:{punctuation:/^&lt;\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/&amp;#?[\da-z]{1,8};/gi};Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))});;
-Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*{))/gi,inside:{punctuation:/[;:]/g}},url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/g,property:/(\b|\B)[\w-]+(?=\s*:)/ig,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,ignore:/&(lt|gt|amp);/gi,punctuation:/[\{\};:]/g};Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/style(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)|(&lt;|<)\/style(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css}}});;
-Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/ig,inside:{punctuation:/\(/}}, number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,operator:/[-+]{1,2}|!|&lt;=?|>=?|={1,3}|(&amp;){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};;
-Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(var|let|if|else|while|do|for|return|in|instanceof|function|new|with|typeof|try|catch|finally|null|break|continue)\b/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g});Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}});Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/script(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)|(&lt;|<)\/script(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript}}});;
-Prism.languages.coffeescript=Prism.languages.extend("javascript",{"block-comment":/([#]{3}\s*\r?\n(.*\s*\r*\n*)\s*?\r?\n[#]{3})/g,comment:/(\s|^)([#]{1}[^#^\r^\n]{2,}?(\r?\n|$))/g,keyword:/\b(this|window|delete|class|extends|namespace|extend|ar|let|if|else|while|do|for|each|of|return|in|instanceof|new|with|typeof|try|catch|finally|null|undefined|break|continue)\b/g});Prism.languages.insertBefore("coffeescript","keyword",{"function":{pattern:/[a-z|A-z]+\s*[:|=]\s*(\([.|a-z\s|,|:|{|}|\"|\'|=]*\))?\s*-&gt;/gi,inside:{"function-name":/[_?a-z-|A-Z-]+(\s*[:|=])| @[_?$?a-z-|A-Z-]+(\s*)| /g,operator:/[-+]{1,2}|!|=?&lt;|=?&gt;|={1,2}|(&amp;){1,2}|\|?\||\?|\*|\//g}},"attr-name":/[_?a-z-|A-Z-]+(\s*:)| @[_?$?a-z-|A-Z-]+(\s*)| /g});;
-Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/g,lookbehind:!0},atrule:/@[\w-]+(?=\s+(\(|\{|;))/gi,url:/([-a-z]+-)*url(?=\()/gi,selector:/([^@;\{\}\(\)]?([^@;\{\}\(\)]|&amp;|\#\{\$[-_\w]+\})+)(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/gm});Prism.languages.insertBefore("scss","atrule",{keyword:/@(if|else if|else|for|each|while|import|extend|debug|warn|mixin|include|function|return)|(?=@for\s+\$[-_\w]+\s)+from/i});Prism.languages.insertBefore("scss","property",{variable:/((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i});Prism.languages.insertBefore("scss","ignore",{placeholder:/%[-_\w]+/i,statement:/\B!(default|optional)\b/gi,"boolean":/\b(true|false)\b/g,"null":/\b(null)\b/g,operator:/\s+([-+]{1,2}|={1,2}|!=|\|?\||\?|\*|\/|\%)\s+/g});
-;
-</script><script type="text/javascript">
- var headerHeight = 64;
-
- $(document).foundation();
-
- $(function(){
- $('pre code').addClass('language-javascript');
- // $('#nav > ul > li > a[href$="'+location.pathname.substring(location.pathname.lastIndexOf('/')+1, location.pathname.length)+'"]').parent().addClass('active');
- })</script></body></html>
293 docs/examples/remote_rule_change.js.html
View
@@ -1,293 +0,0 @@
-<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width" charset="utf-8"><title>squid3_sentry</title><!-- Foundation CSS--><link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/css/foundation.min.css"><!-- Prism CSS--><style type="text/css">/**
- * prism.js default theme for JavaScript, CSS and HTML
- * Based on dabblet (http://dabblet.com)
- * @author Lea Verou
- */
-
-code[class*="language-"],
-pre[class*="language-"] {
- color: black;
- text-shadow: 0 1px white;
- font-family: Consolas, Monaco, 'Andale Mono', monospace;
- direction: ltr;
- text-align: left;
- white-space: pre;
- word-spacing: normal;
-
- -moz-tab-size: 4;
- -o-tab-size: 4;
- tab-size: 4;
-
- -webkit-hyphens: none;
- -moz-hyphens: none;
- -ms-hyphens: none;
- hyphens: none;
-}
-
-::-moz-selection {
- text-shadow: none;
- background: #b3d4fc;
-}
-
-::selection {
- text-shadow: none;
- background: #b3d4fc;
-}
-
-@media print {
- code[class*="language-"],
- pre[class*="language-"] {
- text-shadow: none;
- }
-}
-
-/* Code blocks */
-pre[class*="language-"] {
- padding: 1em;
- margin: .5em 0;
- overflow: auto;
-}
-
-:not(pre) > code[class*="language-"],
-pre[class*="language-"] {
- background: #f5f2f0;
-}
-
-/* Inline code */
-:not(pre) > code[class*="language-"] {
- padding: .1em;
- border-radius: .3em;
-}
-
-.token.comment,
-.token.prolog,
-.token.doctype,
-.token.cdata {
- color: slategray;
-}
-
-.token.punctuation {
- color: #999;
-}
-
-.namespace {
- opacity: .7;
-}
-
-.token.property,
-.token.tag,
-.token.boolean,
-.token.number {
- color: #905;
-}
-
-.token.selector,
-.token.attr-name,
-.token.string {
- color: #690;
-}
-
-.token.operator,
-.token.entity,
-.token.url,
-.language-css .token.string,
-.style .token.string {
- color: #a67f59;
- background: hsla(0,0%,100%,.5);
-}
-
-.token.atrule,
-.token.attr-value,
-.token.keyword {
- color: #07a;
-}
-
-
-.token.regex,
-.token.important {
- color: #e90;
-}
-
-.token.important {
- font-weight: bold;
-}
-
-.token.entity {
- cursor: help;
-}
-</style><!-- Custom Styles--><style type="text/css">h1.page-title small {
- font-weight: 400;
-}
-/*.section-container, .section-container .section .title
- border-color #e6e6e6*/
-#nav .section.active {
- padding-top: 0 !important;
-}
-#nav .section.active .title {
- background: #ddd;
-}
-#nav .section .title {
- background-color: #eee;
-}
-#nav .section .title a {
- font-weight: 700;
- padding: 0.6em;
-}
-#nav .section .title a small {
- font-size: 0.8em;
- line-height: 1em;
- display: block;
- color: #888;
- margin: 2px 0 -2px;
-}
-#nav .section .title:hover {
- background: #ddd;
-}
-#nav ul.solo {
- border-top: 1px solid #ccc;
- padding: 0.875em;
-}
-code {
- background: transparent;
- line-height: 1.3em;
- font-weight: normal;
-}
-.comment {
- position: relative;
- padding-bottom: 1.5em;
- margin-bottom: 2em;
- border-bottom: 1px solid #ddd;
-}
-.comment ol,
-.comment ul {
- margin-left: 2.25em;
-}
-.comment ol.no-bullet,
-.comment ul.no-bullet {
- margin-left: 0;
-}
-.comment header {
- margin-bottom: 1.5em;
-}
-.comment header h1 {
- font-size: 2rem;
- margin-bottom: 0.2em;
-}
-.comment .section-container,
-.comment .section-container > .section > .content {
- border: none;
-}
-.comment .section-container > .section > .title {
- padding: auto;
- background: none !important;
- border: none !important;
-}
-.comment .section-container > .section > .title a {
- border-radius: 4px;
- font-weight: 700;
- padding: 1px 10px 1px 0;
- margin-right: 5px;
- color: #ccc;
-}
-.comment .section-container > .section:hover .title a {
- color: #999;
-}
-.comment .section-container > .section.active .title a {
- color: #2ba6cb;
-}
-.comment .section-container > .section > .content {
- padding: 0.9em 0 0;
-}
-.comment div.description h2 {
- font-size: 1.2em;
-}
-.comment .tags span {
- margin-right: 4px;
-}
-.comment .tags .name,
-.comment .tags .type {
- font-weight: 700;
-}
-.comment .tags .types {
- color: #666;
-}
-.comment .tags .description {
- margin-left: 15px;
-}
-.ctx-type {
- margin-right: 6px;
- font-size: 0.7em;
-}
-</style><script srr="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/js/vendor/custom.modernizr.js"></script></head><body><div class="row"><div class="small-12 columns"><h1 class="page-title">squid3_sentry<small> examples/remote_rule_change.js</small></h1></div></div><div class="row"><div id="nav" class="large-3 columns"><div data-section="accordian" data-options="" class="section-container accordian"><div class="section"><p data-section-title class="title"><a href="../../docs/examples/reload_rules.js.html"><small>examples/</small>reload_rules.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/examples/reload_rules.js.html#crypto">crypto</a></li></ul></div></div><div class="section active"><p data-section-title class="title"><a href="../../docs/examples/remote_rule_change.js.html"><small>examples/</small>remote_rule_change.js</a></p><div data-section-content class="content"><ul class="side-nav"></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/examples/test.js.html"><small>examples/</small>test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/examples/test.js.html#Core">Core</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/core.js.html"><small>lib/</small>core.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/core.js.html#async">async</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rule.js.html"><small>lib/</small>rule.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rule.js.html#Rule">Rule</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/category.js.html"><small>lib/rules/</small>category.js</a></p><div data-section-content class="content"><ul class="side-nav"></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/category_file.js.html"><small>lib/rules/</small>category_file.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/category_file.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/file_type.js.html"><small>lib/rules/</small>file_type.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/file_type.js.html#url">url</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/group.js.html"><small>lib/rules/</small>group.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/group.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/ip.js.html"><small>lib/rules/</small>ip.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/ip.js.html#Netmask">Netmask</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/match.js.html"><small>lib/rules/</small>match.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/match.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/ou.js.html"><small>lib/rules/</small>ou.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/ou.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/time.js.html"><small>lib/rules/</small>time.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/time.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/user.js.html"><small>lib/rules/</small>user.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/user.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/sources/ldap.js.html"><small>lib/sources/</small>ldap.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/sources/ldap.js.html#ldap">ldap</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/sources/redis.js.html"><small>lib/sources/</small>redis.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/sources/redis.js.html#redis">redis</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/squid.js.html"><small>lib/</small>squid.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/squid.js.html#Core">Core</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/index.js.html"><small>lib2/</small>index.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/index.js.html#Sentry">Sentry</a></li><li><a href="../../docs/lib2/index.js.html#rules">rules</a></li><li><a href="../../docs/lib2/index.js.html#isAllowed">isAllowed</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/category.js.html"><small>lib2/rules/</small>category.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/category.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/category_file.js.html"><small>lib2/rules/</small>category_file.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/category_file.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/file_type.js.html"><small>lib2/rules/</small>file_type.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/file_type.js.html#url">url</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/group.js.html"><small>lib2/rules/</small>group.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/group.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/index.js.html"><small>lib2/rules/</small>index.js</a></p><div data-section-content class="content"><ul class="side-nav"></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/ip.js.html"><small>lib2/rules/</small>ip.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/ip.js.html#Netmask">Netmask</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/match.js.html"><small>lib2/rules/</small>match.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/match.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/ou.js.html"><small>lib2/rules/</small>ou.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/ou.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/time.js.html"><small>lib2/rules/</small>time.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/time.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/user.js.html"><small>lib2/rules/</small>user.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/user.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/test/cache-test.js.html"><small>test/</small>cache-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/test/cache-test.js.html#vows">vows</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/test/core-test.js.html"><small>test/</small>core-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/test/core-test.js.html#vows">vows</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/test/rules-test.js.html"><small>test/</small>rules-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/test/rules-test.js.html#vows">vows</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/test/squid-test.js.html"><small>test/</small>squid-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/test/squid-test.js.html#vows">vows</a></li></ul></div></div></div></div><div class="small-12 large-9 columns"><article class="comment"><header></header><ul class="no-bullet tags"></ul><div data-section="accordian" data-options="one_up: false;" class="section-container code auto"><div class="section"><p data-section-title class="title"><a href="#">Description</a></p><div data-section-content class="content description"><p>// Redirect everything to google search<br />{<br /> name: 'allow google',<br /> allowed: true,<br /> matches: ['<em>google</em>', '<em>no-porn</em>']<br />},{<br /> name: 'google it',<br /> redirect: 'www.google.com/search?q=[domain]'<br />},</p></div></div><div class="section"><p data-section-title class="title"><a href="#">Source</a></p><div data-section-content class="content"><pre><code class="language-javascript">*
-
-// Return a picture of the site!
-{
- name: 'allow snapr',
- allowed: true,
- matches: ['*snapr.seekxl*']
-},{
- name: 'take picure',
- redirect: 'http://snapr.seekxl.de/?url=[url]&amp;size=M',
- mode: 'rewrite'
-},*//*
-
-// Allow flash only for miniclip.com
-{
- name: 'allow flash on miniclip.com',
- allowed: true,
- file_types: ['swf'],
- matches: ['*miniclip.com']
-},{
- name: 'deny flash for everything else',
- file_types: ['swf']
-}*/
-];
-
-
-redis.lrange(prefix + ':rules:' + name, 0, -1, function(err, elements){
- var transaction = redis.multi();
-
- if(elements.length &gt; 0){
- transaction.del(elements);
- transaction.del(prefix + ':rules:' + name);
- }
-
- var sha;
- for(var i in rules){
- sha = crypto.createHash('sha1').update(name + i).digest('hex');
- transaction.rpush(prefix + ':rules:' + name, prefix + ':rule:' + sha);
- transaction.set(prefix + ':rule:' + sha, JSON.stringify(rules[i]));
- }
-
- transaction.publish(name, 'reload');
- transaction.exec(function(err){
- if(!err){
- console.log('Rules reloaded!');
- process.exit(0);
- }
- });
-});</code></pre></div></div></div></article></div></div><!-- Foundation JS--><script type="text/javascript">document.write('<script src=' +
-('__proto__' in {} ? 'http://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min' : 'http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min') +
-'.js><\/script>')
-</script><script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/js/foundation.min.js"></script><script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/js/foundation/foundation.reveal.min.js"></script><!-- Prism js--><script type="text/javascript">
-/**
- * Prism: Lightweight, robust, elegant syntax highlighting
- * MIT license http://www.opensource.org/licenses/mit-license.php/
- * @author Lea Verou http://lea.verou.me
- */(function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');for(var i=0,s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement:function(r,i,s){var o,u,a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,""])[1];u=t.languages[o]}if(!u)return;r.className=r.className.replace(e,"").replace(/\s+/g," ")+" language-"+o;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+o);var f=r.textContent;if(!f)return;f=f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ");var l={element:r,language:o,grammar:u,code:f};t.hooks.run("before-highlight",l);if(i&&self.Worker){var c=new Worker(t.filename);c.onmessage=function(e){l.highlightedCode=n.stringify(JSON.parse(e.data),o);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(l.element);t.hooks.run("after-highlight",l)};c.postMessage(JSON.stringify({language:l.language,code:l.code}))}else{l.highlightedCode=t.highlight(l.code,l.grammar,l.language);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(r);t.hooks.run("after-highlight",l)}},highlight:function(e,r,i){return n.stringify(t.tokenize(e,r),i)},tokenize:function(e,n,r){var i=t.Token,s=[e],o=n.rest;if(o){for(var u in o)n[u]=o[u];delete n.rest}e:for(var u in n){if(!n.hasOwnProperty(u)||!n[u])continue;var a=n[u],f=a.inside,l=!!a.lookbehind,c=0;a=a.pattern||a;for(var h=0;h<s.length;h++){var p=s[h];if(s.length>e.length)break e;if(p instanceof i)continue;a.lastIndex=0;var d=a.exec(p);if(d){l&&(c=d[1].length);var v=d.index-1+c,d=d[0].slice(c),m=d.length,g=v+m,y=p.slice(0,v+1),b=p.slice(g+1),w=[h,1];y&&w.push(y);var E=new i(u,f?t.tokenize(d,f):d);w.push(E);b&&w.push(b);Array.prototype.splice.apply(s,w)}}}return s},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e,r,i){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(function(t){return n.stringify(t,r,e)}).join("");var s={type:e.type,content:n.stringify(e.content,r,i),tag:"span",classes:["token",e.type],attributes:{},language:r,parent:i};s.type=="comment"&&(s.attributes.spellcheck="true");t.hooks.run("wrap",s);var o="";for(var u in s.attributes)o+=u+'="'+(s.attributes[u]||"")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'" '+o+">"+s.content+"</"+s.tag+">"};if(!self.document){self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}})();;
-Prism.languages.markup={comment:/&lt;!--[\w\W]*?-->/g,prolog:/&lt;\?.+?\?>/,doctype:/&lt;!DOCTYPE.+?>/,cdata:/&lt;!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/&lt;\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^&lt;\/?[\w:-]+/i,inside:{punctuation:/^&lt;\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/&amp;#?[\da-z]{1,8};/gi};Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))});;
-Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*{))/gi,inside:{punctuation:/[;:]/g}},url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/g,property:/(\b|\B)[\w-]+(?=\s*:)/ig,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,ignore:/&(lt|gt|amp);/gi,punctuation:/[\{\};:]/g};Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/style(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)|(&lt;|<)\/style(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css}}});;
-Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/ig,inside:{punctuation:/\(/}}, number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,operator:/[-+]{1,2}|!|&lt;=?|>=?|={1,3}|(&amp;){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};;
-Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(var|let|if|else|while|do|for|return|in|instanceof|function|new|with|typeof|try|catch|finally|null|break|continue)\b/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g});Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}});Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/script(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)|(&lt;|<)\/script(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript}}});;
-Prism.languages.coffeescript=Prism.languages.extend("javascript",{"block-comment":/([#]{3}\s*\r?\n(.*\s*\r*\n*)\s*?\r?\n[#]{3})/g,comment:/(\s|^)([#]{1}[^#^\r^\n]{2,}?(\r?\n|$))/g,keyword:/\b(this|window|delete|class|extends|namespace|extend|ar|let|if|else|while|do|for|each|of|return|in|instanceof|new|with|typeof|try|catch|finally|null|undefined|break|continue)\b/g});Prism.languages.insertBefore("coffeescript","keyword",{"function":{pattern:/[a-z|A-z]+\s*[:|=]\s*(\([.|a-z\s|,|:|{|}|\"|\'|=]*\))?\s*-&gt;/gi,inside:{"function-name":/[_?a-z-|A-Z-]+(\s*[:|=])| @[_?$?a-z-|A-Z-]+(\s*)| /g,operator:/[-+]{1,2}|!|=?&lt;|=?&gt;|={1,2}|(&amp;){1,2}|\|?\||\?|\*|\//g}},"attr-name":/[_?a-z-|A-Z-]+(\s*:)| @[_?$?a-z-|A-Z-]+(\s*)| /g});;
-Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/g,lookbehind:!0},atrule:/@[\w-]+(?=\s+(\(|\{|;))/gi,url:/([-a-z]+-)*url(?=\()/gi,selector:/([^@;\{\}\(\)]?([^@;\{\}\(\)]|&amp;|\#\{\$[-_\w]+\})+)(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/gm});Prism.languages.insertBefore("scss","atrule",{keyword:/@(if|else if|else|for|each|while|import|extend|debug|warn|mixin|include|function|return)|(?=@for\s+\$[-_\w]+\s)+from/i});Prism.languages.insertBefore("scss","property",{variable:/((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i});Prism.languages.insertBefore("scss","ignore",{placeholder:/%[-_\w]+/i,statement:/\B!(default|optional)\b/gi,"boolean":/\b(true|false)\b/g,"null":/\b(null)\b/g,operator:/\s+([-+]{1,2}|={1,2}|!=|\|?\||\?|\*|\/|\%)\s+/g});
-;
-</script><script type="text/javascript">
- var headerHeight = 64;
-
- $(document).foundation();
-
- $(function(){
- $('pre code').addClass('language-javascript');
- // $('#nav > ul > li > a[href$="'+location.pathname.substring(location.pathname.lastIndexOf('/')+1, location.pathname.length)+'"]').parent().addClass('active');
- })</script></body></html>
322 docs/examples/test.js.html
View
@@ -1,322 +0,0 @@
-<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width" charset="utf-8"><title>squid3_sentry</title><!-- Foundation CSS--><link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/css/foundation.min.css"><!-- Prism CSS--><style type="text/css">/**
- * prism.js default theme for JavaScript, CSS and HTML
- * Based on dabblet (http://dabblet.com)
- * @author Lea Verou
- */
-
-code[class*="language-"],
-pre[class*="language-"] {
- color: black;
- text-shadow: 0 1px white;
- font-family: Consolas, Monaco, 'Andale Mono', monospace;
- direction: ltr;
- text-align: left;
- white-space: pre;
- word-spacing: normal;
-
- -moz-tab-size: 4;
- -o-tab-size: 4;
- tab-size: 4;
-
- -webkit-hyphens: none;
- -moz-hyphens: none;
- -ms-hyphens: none;
- hyphens: none;
-}
-
-::-moz-selection {
- text-shadow: none;
- background: #b3d4fc;
-}
-
-::selection {
- text-shadow: none;
- background: #b3d4fc;
-}
-
-@media print {
- code[class*="language-"],
- pre[class*="language-"] {
- text-shadow: none;
- }
-}
-
-/* Code blocks */
-pre[class*="language-"] {
- padding: 1em;
- margin: .5em 0;
- overflow: auto;
-}
-
-:not(pre) > code[class*="language-"],
-pre[class*="language-"] {
- background: #f5f2f0;
-}
-
-/* Inline code */
-:not(pre) > code[class*="language-"] {
- padding: .1em;
- border-radius: .3em;
-}
-
-.token.comment,
-.token.prolog,
-.token.doctype,
-.token.cdata {
- color: slategray;
-}
-
-.token.punctuation {
- color: #999;
-}
-
-.namespace {
- opacity: .7;
-}
-
-.token.property,
-.token.tag,
-.token.boolean,
-.token.number {
- color: #905;
-}
-
-.token.selector,
-.token.attr-name,
-.token.string {
- color: #690;
-}
-
-.token.operator,
-.token.entity,
-.token.url,
-.language-css .token.string,
-.style .token.string {
- color: #a67f59;
- background: hsla(0,0%,100%,.5);
-}
-
-.token.atrule,
-.token.attr-value,
-.token.keyword {
- color: #07a;
-}
-
-
-.token.regex,
-.token.important {
- color: #e90;
-}
-
-.token.important {
- font-weight: bold;
-}
-
-.token.entity {
- cursor: help;
-}
-</style><!-- Custom Styles--><style type="text/css">h1.page-title small {
- font-weight: 400;
-}
-/*.section-container, .section-container .section .title
- border-color #e6e6e6*/
-#nav .section.active {
- padding-top: 0 !important;
-}
-#nav .section.active .title {
- background: #ddd;
-}
-#nav .section .title {
- background-color: #eee;
-}
-#nav .section .title a {
- font-weight: 700;
- padding: 0.6em;
-}
-#nav .section .title a small {
- font-size: 0.8em;
- line-height: 1em;
- display: block;
- color: #888;
- margin: 2px 0 -2px;
-}
-#nav .section .title:hover {
- background: #ddd;
-}
-#nav ul.solo {
- border-top: 1px solid #ccc;
- padding: 0.875em;
-}
-code {
- background: transparent;
- line-height: 1.3em;
- font-weight: normal;
-}
-.comment {
- position: relative;
- padding-bottom: 1.5em;
- margin-bottom: 2em;
- border-bottom: 1px solid #ddd;
-}
-.comment ol,
-.comment ul {
- margin-left: 2.25em;
-}
-.comment ol.no-bullet,
-.comment ul.no-bullet {
- margin-left: 0;
-}
-.comment header {
- margin-bottom: 1.5em;
-}
-.comment header h1 {
- font-size: 2rem;
- margin-bottom: 0.2em;
-}
-.comment .section-container,
-.comment .section-container > .section > .content {
- border: none;
-}
-.comment .section-container > .section > .title {
- padding: auto;
- background: none !important;
- border: none !important;
-}
-.comment .section-container > .section > .title a {
- border-radius: 4px;
- font-weight: 700;
- padding: 1px 10px 1px 0;
- margin-right: 5px;
- color: #ccc;
-}
-.comment .section-container > .section:hover .title a {
- color: #999;
-}
-.comment .section-container > .section.active .title a {
- color: #2ba6cb;
-}
-.comment .section-container > .section > .content {
- padding: 0.9em 0 0;
-}
-.comment div.description h2 {
- font-size: 1.2em;
-}
-.comment .tags span {
- margin-right: 4px;
-}
-.comment .tags .name,
-.comment .tags .type {
- font-weight: 700;
-}
-.comment .tags .types {
- color: #666;
-}
-.comment .tags .description {
- margin-left: 15px;
-}
-.ctx-type {
- margin-right: 6px;
- font-size: 0.7em;
-}
-</style><script srr="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/js/vendor/custom.modernizr.js"></script></head><body><div class="row"><div class="small-12 columns"><h1 class="page-title">squid3_sentry<small> examples/test.js</small></h1></div></div><div class="row"><div id="nav" class="large-3 columns"><div data-section="accordian" data-options="" class="section-container accordian"><div class="section"><p data-section-title class="title"><a href="../../docs/examples/reload_rules.js.html"><small>examples/</small>reload_rules.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/examples/reload_rules.js.html#crypto">crypto</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/examples/remote_rule_change.js.html"><small>examples/</small>remote_rule_change.js</a></p><div data-section-content class="content"><ul class="side-nav"></ul></div></div><div class="section active"><p data-section-title class="title"><a href="../../docs/examples/test.js.html"><small>examples/</small>test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/examples/test.js.html#Core">Core</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/core.js.html"><small>lib/</small>core.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/core.js.html#async">async</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rule.js.html"><small>lib/</small>rule.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rule.js.html#Rule">Rule</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/category.js.html"><small>lib/rules/</small>category.js</a></p><div data-section-content class="content"><ul class="side-nav"></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/category_file.js.html"><small>lib/rules/</small>category_file.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/category_file.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/file_type.js.html"><small>lib/rules/</small>file_type.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/file_type.js.html#url">url</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/group.js.html"><small>lib/rules/</small>group.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/group.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/ip.js.html"><small>lib/rules/</small>ip.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/ip.js.html#Netmask">Netmask</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/match.js.html"><small>lib/rules/</small>match.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/match.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/ou.js.html"><small>lib/rules/</small>ou.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/ou.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/time.js.html"><small>lib/rules/</small>time.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/time.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/user.js.html"><small>lib/rules/</small>user.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/user.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/sources/ldap.js.html"><small>lib/sources/</small>ldap.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/sources/ldap.js.html#ldap">ldap</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/sources/redis.js.html"><small>lib/sources/</small>redis.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/sources/redis.js.html#redis">redis</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/squid.js.html"><small>lib/</small>squid.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/squid.js.html#Core">Core</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/index.js.html"><small>lib2/</small>index.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/index.js.html#Sentry">Sentry</a></li><li><a href="../../docs/lib2/index.js.html#rules">rules</a></li><li><a href="../../docs/lib2/index.js.html#isAllowed">isAllowed</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/category.js.html"><small>lib2/rules/</small>category.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/category.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/category_file.js.html"><small>lib2/rules/</small>category_file.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/category_file.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/file_type.js.html"><small>lib2/rules/</small>file_type.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/file_type.js.html#url">url</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/group.js.html"><small>lib2/rules/</small>group.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/group.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/index.js.html"><small>lib2/rules/</small>index.js</a></p><div data-section-content class="content"><ul class="side-nav"></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/ip.js.html"><small>lib2/rules/</small>ip.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/ip.js.html#Netmask">Netmask</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/match.js.html"><small>lib2/rules/</small>match.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/match.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/ou.js.html"><small>lib2/rules/</small>ou.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/ou.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/time.js.html"><small>lib2/rules/</small>time.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/time.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/user.js.html"><small>lib2/rules/</small>user.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/user.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/test/cache-test.js.html"><small>test/</small>cache-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/test/cache-test.js.html#vows">vows</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/test/core-test.js.html"><small>test/</small>core-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/test/core-test.js.html#vows">vows</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/test/rules-test.js.html"><small>test/</small>rules-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/test/rules-test.js.html#vows">vows</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/test/squid-test.js.html"><small>test/</small>squid-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/test/squid-test.js.html#vows">vows</a></li></ul></div></div></div></div><div class="small-12 large-9 columns"><article class="comment"><header><h1 id="Core">Core</h1><h5 class="subheader"><div class="label radius ctx-type">declaration</div>Core</h5></header><ul class="no-bullet tags"></ul><div data-section="accordian" data-options="one_up: false;" class="section-container code auto"><div class="section"><p data-section-title class="title"><a href="#">Description</a></p><div data-section-content class="content description"></div></div><div class="section"><p data-section-title class="title"><a href="#">Source</a></p><div data-section-content class="content"><pre><code class="language-javascript">var Core = require('../lib/core');
-var Squid = require('../lib/squid');
-var core = new Core({
- redirect: 'default_redirect.com',
- ldap:{
- url: 'ldap://10.20.30.66:389',
- dn: 'CN=ldap_auth,CN=Users,DC=dabeach,DC=lan',
- password: 'ooDahs0i',
- base: 'DC=dabeach,DC=lan'
- }
-});
-
-Squid.core = core;
-
-core.addRule({
- name: 'categories from file',
- allow: false,
- category_files: ['test/domain_files/black'], //, 'test/domain_files/white'],
- redirect: 'no-flash.com'
-});
-
-
-
-function test(urls){
-
- var start = new Date().getTime();
- var unfinished = urls.length;
-
- for(var i in urls){
- Squid.parse(urls[i], function(r){
-
- unfinished--;
-
- if(unfinished == 0){
- var end = new Date().getTime();
- var time = end - start;
- console.log('Finished ' + urls.length + ' requests in ' + (time/1000) + 's');
- process.exit(0);
- }
- });
- }
-
-}
-
-
-
-test([
- '0 http://www.s-team.at/ 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '1 http://www.a-team.at/ 10.20.30.67/- andre GET myip=10.20.30.70 myport=8080',
- '2 http://orf.at/ 10.20.30.67/- hans GET myip=10.20.30.70 myport=8080',
- '31 http://sexualhost.com/a/b/d?test=33 10.20.30.67/- hugo GET myip=10.20.30.70 myport=8080',
- '32 http://sexualhost.com/player.swf?_dc=2342342354534 10.20.30.67/- felix GET myip=10.20.30.70 myport=8080',
- '33 http://sexualhost.com/video.flv?_dc=2342342354534 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://www.s-team.at/ 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '1 http://www.s-team.at/ 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '2 http://www.s-team.at/modules/mod_jflanguageselection/tmpl/mod_jflanguageselection.css 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '3 http://www.s-team.at/templates/s-team/css/template.css 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '4 http://www.s-team.at/media/system/js/mootools.js 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '5 http://www.s-team.at/media/system/js/caption.js 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://www.s-team.at/templates/system/css/system.css 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://www.s-team.at/templates/s-team/images/head_bg.png 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://www.s-team.at/images/stories/phone_seperator.jpg 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://www.s-team.at/images/stories/teaser/iphone.jpg 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://www.s-team.at/templates/s-team/images/arrow_right_blue.png 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://www.s-team.at/images/stories/teaser/apple_app_store.png 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://www.s-team.at/templates/s-team/images/foot_bg.png 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://www.google-analytics.com/ga.js 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://www.s-team.at/images/stories/footer/random/hundertwasser2.jpg 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://www.teamviewer.com/link/?url=426717&amp;id=1594183991 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://www.s-team.at/ 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://www.google-analytics.com/ga.js 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://wallpapers.lookscool.com/ 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://128.242.183.210/ 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://thumbsremote.com/ 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://128.242.183.211/ 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://xxx-pictures-xxx.net/ 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080',
- '0 http://128.242.183.219/ 10.20.30.67/- phil GET myip=10.20.30.70 myport=8080'
-]);</code></pre></div></div></div></article></div></div><!-- Foundation JS--><script type="text/javascript">document.write('<script src=' +
-('__proto__' in {} ? 'http://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min' : 'http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min') +
-'.js><\/script>')
-</script><script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/js/foundation.min.js"></script><script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/js/foundation/foundation.reveal.min.js"></script><!-- Prism js--><script type="text/javascript">
-/**
- * Prism: Lightweight, robust, elegant syntax highlighting
- * MIT license http://www.opensource.org/licenses/mit-license.php/
- * @author Lea Verou http://lea.verou.me
- */(function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');for(var i=0,s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement:function(r,i,s){var o,u,a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,""])[1];u=t.languages[o]}if(!u)return;r.className=r.className.replace(e,"").replace(/\s+/g," ")+" language-"+o;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+o);var f=r.textContent;if(!f)return;f=f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ");var l={element:r,language:o,grammar:u,code:f};t.hooks.run("before-highlight",l);if(i&&self.Worker){var c=new Worker(t.filename);c.onmessage=function(e){l.highlightedCode=n.stringify(JSON.parse(e.data),o);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(l.element);t.hooks.run("after-highlight",l)};c.postMessage(JSON.stringify({language:l.language,code:l.code}))}else{l.highlightedCode=t.highlight(l.code,l.grammar,l.language);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(r);t.hooks.run("after-highlight",l)}},highlight:function(e,r,i){return n.stringify(t.tokenize(e,r),i)},tokenize:function(e,n,r){var i=t.Token,s=[e],o=n.rest;if(o){for(var u in o)n[u]=o[u];delete n.rest}e:for(var u in n){if(!n.hasOwnProperty(u)||!n[u])continue;var a=n[u],f=a.inside,l=!!a.lookbehind,c=0;a=a.pattern||a;for(var h=0;h<s.length;h++){var p=s[h];if(s.length>e.length)break e;if(p instanceof i)continue;a.lastIndex=0;var d=a.exec(p);if(d){l&&(c=d[1].length);var v=d.index-1+c,d=d[0].slice(c),m=d.length,g=v+m,y=p.slice(0,v+1),b=p.slice(g+1),w=[h,1];y&&w.push(y);var E=new i(u,f?t.tokenize(d,f):d);w.push(E);b&&w.push(b);Array.prototype.splice.apply(s,w)}}}return s},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e,r,i){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(function(t){return n.stringify(t,r,e)}).join("");var s={type:e.type,content:n.stringify(e.content,r,i),tag:"span",classes:["token",e.type],attributes:{},language:r,parent:i};s.type=="comment"&&(s.attributes.spellcheck="true");t.hooks.run("wrap",s);var o="";for(var u in s.attributes)o+=u+'="'+(s.attributes[u]||"")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'" '+o+">"+s.content+"</"+s.tag+">"};if(!self.document){self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}})();;
-Prism.languages.markup={comment:/&lt;!--[\w\W]*?-->/g,prolog:/&lt;\?.+?\?>/,doctype:/&lt;!DOCTYPE.+?>/,cdata:/&lt;!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/&lt;\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^&lt;\/?[\w:-]+/i,inside:{punctuation:/^&lt;\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/&amp;#?[\da-z]{1,8};/gi};Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))});;
-Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*{))/gi,inside:{punctuation:/[;:]/g}},url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/g,property:/(\b|\B)[\w-]+(?=\s*:)/ig,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,ignore:/&(lt|gt|amp);/gi,punctuation:/[\{\};:]/g};Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/style(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)|(&lt;|<)\/style(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css}}});;
-Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/ig,inside:{punctuation:/\(/}}, number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,operator:/[-+]{1,2}|!|&lt;=?|>=?|={1,3}|(&amp;){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};;
-Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(var|let|if|else|while|do|for|return|in|instanceof|function|new|with|typeof|try|catch|finally|null|break|continue)\b/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g});Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}});Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/script(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)|(&lt;|<)\/script(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript}}});;
-Prism.languages.coffeescript=Prism.languages.extend("javascript",{"block-comment":/([#]{3}\s*\r?\n(.*\s*\r*\n*)\s*?\r?\n[#]{3})/g,comment:/(\s|^)([#]{1}[^#^\r^\n]{2,}?(\r?\n|$))/g,keyword:/\b(this|window|delete|class|extends|namespace|extend|ar|let|if|else|while|do|for|each|of|return|in|instanceof|new|with|typeof|try|catch|finally|null|undefined|break|continue)\b/g});Prism.languages.insertBefore("coffeescript","keyword",{"function":{pattern:/[a-z|A-z]+\s*[:|=]\s*(\([.|a-z\s|,|:|{|}|\"|\'|=]*\))?\s*-&gt;/gi,inside:{"function-name":/[_?a-z-|A-Z-]+(\s*[:|=])| @[_?$?a-z-|A-Z-]+(\s*)| /g,operator:/[-+]{1,2}|!|=?&lt;|=?&gt;|={1,2}|(&amp;){1,2}|\|?\||\?|\*|\//g}},"attr-name":/[_?a-z-|A-Z-]+(\s*:)| @[_?$?a-z-|A-Z-]+(\s*)| /g});;
-Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/g,lookbehind:!0},atrule:/@[\w-]+(?=\s+(\(|\{|;))/gi,url:/([-a-z]+-)*url(?=\()/gi,selector:/([^@;\{\}\(\)]?([^@;\{\}\(\)]|&amp;|\#\{\$[-_\w]+\})+)(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/gm});Prism.languages.insertBefore("scss","atrule",{keyword:/@(if|else if|else|for|each|while|import|extend|debug|warn|mixin|include|function|return)|(?=@for\s+\$[-_\w]+\s)+from/i});Prism.languages.insertBefore("scss","property",{variable:/((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i});Prism.languages.insertBefore("scss","ignore",{placeholder:/%[-_\w]+/i,statement:/\B!(default|optional)\b/gi,"boolean":/\b(true|false)\b/g,"null":/\b(null)\b/g,operator:/\s+([-+]{1,2}|={1,2}|!=|\|?\||\?|\*|\/|\%)\s+/g});
-;
-</script><script type="text/javascript">
- var headerHeight = 64;
-
- $(document).foundation();
-
- $(function(){
- $('pre code').addClass('language-javascript');
- // $('#nav > ul > li > a[href$="'+location.pathname.substring(location.pathname.lastIndexOf('/')+1, location.pathname.length)+'"]').parent().addClass('active');
- })</script></body></html>
671 docs/lib/core.js.html
View
@@ -1,671 +0,0 @@
-<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width" charset="utf-8"><title>squid3_sentry</title><!-- Foundation CSS--><link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/css/foundation.min.css"><!-- Prism CSS--><style type="text/css">/**
- * prism.js default theme for JavaScript, CSS and HTML
- * Based on dabblet (http://dabblet.com)
- * @author Lea Verou
- */
-
-code[class*="language-"],
-pre[class*="language-"] {
- color: black;
- text-shadow: 0 1px white;
- font-family: Consolas, Monaco, 'Andale Mono', monospace;
- direction: ltr;
- text-align: left;
- white-space: pre;
- word-spacing: normal;
-
- -moz-tab-size: 4;
- -o-tab-size: 4;
- tab-size: 4;
-
- -webkit-hyphens: none;
- -moz-hyphens: none;
- -ms-hyphens: none;
- hyphens: none;
-}
-
-::-moz-selection {
- text-shadow: none;
- background: #b3d4fc;
-}
-
-::selection {
- text-shadow: none;
- background: #b3d4fc;
-}
-
-@media print {
- code[class*="language-"],
- pre[class*="language-"] {
- text-shadow: none;
- }
-}
-
-/* Code blocks */
-pre[class*="language-"] {
- padding: 1em;
- margin: .5em 0;
- overflow: auto;
-}
-
-:not(pre) > code[class*="language-"],
-pre[class*="language-"] {
- background: #f5f2f0;
-}
-
-/* Inline code */
-:not(pre) > code[class*="language-"] {
- padding: .1em;
- border-radius: .3em;
-}
-
-.token.comment,
-.token.prolog,
-.token.doctype,
-.token.cdata {
- color: slategray;
-}
-
-.token.punctuation {
- color: #999;
-}
-
-.namespace {
- opacity: .7;
-}
-
-.token.property,
-.token.tag,
-.token.boolean,
-.token.number {
- color: #905;
-}
-
-.token.selector,
-.token.attr-name,
-.token.string {
- color: #690;
-}
-
-.token.operator,
-.token.entity,
-.token.url,
-.language-css .token.string,
-.style .token.string {
- color: #a67f59;
- background: hsla(0,0%,100%,.5);
-}
-
-.token.atrule,
-.token.attr-value,
-.token.keyword {
- color: #07a;
-}
-
-
-.token.regex,
-.token.important {
- color: #e90;
-}
-
-.token.important {
- font-weight: bold;
-}
-
-.token.entity {
- cursor: help;
-}
-</style><!-- Custom Styles--><style type="text/css">h1.page-title small {
- font-weight: 400;
-}
-/*.section-container, .section-container .section .title
- border-color #e6e6e6*/
-#nav .section.active {
- padding-top: 0 !important;
-}
-#nav .section.active .title {
- background: #ddd;
-}
-#nav .section .title {
- background-color: #eee;
-}
-#nav .section .title a {
- font-weight: 700;
- padding: 0.6em;
-}
-#nav .section .title a small {
- font-size: 0.8em;
- line-height: 1em;
- display: block;
- color: #888;
- margin: 2px 0 -2px;
-}
-#nav .section .title:hover {
- background: #ddd;
-}
-#nav ul.solo {
- border-top: 1px solid #ccc;
- padding: 0.875em;
-}
-code {
- background: transparent;
- line-height: 1.3em;
- font-weight: normal;
-}
-.comment {
- position: relative;
- padding-bottom: 1.5em;
- margin-bottom: 2em;
- border-bottom: 1px solid #ddd;
-}
-.comment ol,
-.comment ul {
- margin-left: 2.25em;
-}
-.comment ol.no-bullet,
-.comment ul.no-bullet {
- margin-left: 0;
-}
-.comment header {
- margin-bottom: 1.5em;
-}
-.comment header h1 {
- font-size: 2rem;
- margin-bottom: 0.2em;
-}
-.comment .section-container,
-.comment .section-container > .section > .content {
- border: none;
-}
-.comment .section-container > .section > .title {
- padding: auto;
- background: none !important;
- border: none !important;
-}
-.comment .section-container > .section > .title a {
- border-radius: 4px;
- font-weight: 700;
- padding: 1px 10px 1px 0;
- margin-right: 5px;
- color: #ccc;
-}
-.comment .section-container > .section:hover .title a {
- color: #999;
-}
-.comment .section-container > .section.active .title a {
- color: #2ba6cb;
-}
-.comment .section-container > .section > .content {
- padding: 0.9em 0 0;
-}
-.comment div.description h2 {
- font-size: 1.2em;
-}
-.comment .tags span {
- margin-right: 4px;
-}
-.comment .tags .name,
-.comment .tags .type {
- font-weight: 700;
-}
-.comment .tags .types {
- color: #666;
-}
-.comment .tags .description {
- margin-left: 15px;
-}
-.ctx-type {
- margin-right: 6px;
- font-size: 0.7em;
-}
-</style><script srr="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/js/vendor/custom.modernizr.js"></script></head><body><div class="row"><div class="small-12 columns"><h1 class="page-title">squid3_sentry<small> lib/core.js</small></h1></div></div><div class="row"><div id="nav" class="large-3 columns"><div data-section="accordian" data-options="" class="section-container accordian"><div class="section"><p data-section-title class="title"><a href="../../docs/examples/reload_rules.js.html"><small>examples/</small>reload_rules.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/examples/reload_rules.js.html#crypto">crypto</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/examples/remote_rule_change.js.html"><small>examples/</small>remote_rule_change.js</a></p><div data-section-content class="content"><ul class="side-nav"></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/examples/test.js.html"><small>examples/</small>test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/examples/test.js.html#Core">Core</a></li></ul></div></div><div class="section active"><p data-section-title class="title"><a href="../../docs/lib/core.js.html"><small>lib/</small>core.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/core.js.html#async">async</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rule.js.html"><small>lib/</small>rule.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rule.js.html#Rule">Rule</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/category.js.html"><small>lib/rules/</small>category.js</a></p><div data-section-content class="content"><ul class="side-nav"></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/category_file.js.html"><small>lib/rules/</small>category_file.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/category_file.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/file_type.js.html"><small>lib/rules/</small>file_type.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/file_type.js.html#url">url</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/group.js.html"><small>lib/rules/</small>group.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/group.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/ip.js.html"><small>lib/rules/</small>ip.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/ip.js.html#Netmask">Netmask</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/match.js.html"><small>lib/rules/</small>match.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/match.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/ou.js.html"><small>lib/rules/</small>ou.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/ou.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/time.js.html"><small>lib/rules/</small>time.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/time.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/rules/user.js.html"><small>lib/rules/</small>user.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/rules/user.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/sources/ldap.js.html"><small>lib/sources/</small>ldap.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/sources/ldap.js.html#ldap">ldap</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/sources/redis.js.html"><small>lib/sources/</small>redis.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/sources/redis.js.html#redis">redis</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib/squid.js.html"><small>lib/</small>squid.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib/squid.js.html#Core">Core</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/index.js.html"><small>lib2/</small>index.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/index.js.html#Sentry">Sentry</a></li><li><a href="../../docs/lib2/index.js.html#rules">rules</a></li><li><a href="../../docs/lib2/index.js.html#isAllowed">isAllowed</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/category.js.html"><small>lib2/rules/</small>category.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/category.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/category_file.js.html"><small>lib2/rules/</small>category_file.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/category_file.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/file_type.js.html"><small>lib2/rules/</small>file_type.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/file_type.js.html#url">url</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/group.js.html"><small>lib2/rules/</small>group.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/group.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/index.js.html"><small>lib2/rules/</small>index.js</a></p><div data-section-content class="content"><ul class="side-nav"></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/ip.js.html"><small>lib2/rules/</small>ip.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/ip.js.html#Netmask">Netmask</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/match.js.html"><small>lib2/rules/</small>match.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/match.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/ou.js.html"><small>lib2/rules/</small>ou.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/ou.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/time.js.html"><small>lib2/rules/</small>time.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/time.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/lib2/rules/user.js.html"><small>lib2/rules/</small>user.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/lib2/rules/user.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/test/cache-test.js.html"><small>test/</small>cache-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/test/cache-test.js.html#vows">vows</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/test/core-test.js.html"><small>test/</small>core-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/test/core-test.js.html#vows">vows</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/test/rules-test.js.html"><small>test/</small>rules-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/test/rules-test.js.html#vows">vows</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../docs/test/squid-test.js.html"><small>test/</small>squid-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../docs/test/squid-test.js.html#vows">vows</a></li></ul></div></div></div></div><div class="small-12 large-9 columns"><article class="comment"><header><h1 id="async">async</h1><h5 class="subheader"><div class="label radius ctx-type">declaration</div>async</h5></header><ul class="no-bullet tags"></ul><div data-section="accordian" data-options="one_up: false;" class="section-container code auto"><div class="section"><p data-section-title class="title"><a href="#">Description</a></p><div data-section-content class="content description"></div></div><div class="section"><p data-section-title class="title"><a href="#">Source</a></p><div data-section-content class="content"><pre><code class="language-javascript">var async = require('async');
-var bunyan = require('bunyan');
-var url = require('url');
-
-
-var Rule = require('./rule');
-var Ldap = require('./sources/ldap');
-var Redis = require('./sources/redis');
-
-var sharedInstance;
-
-
-//config: redirect...
-var Core = module.exports = function(config){
- sharedInstance = this;
-
- this.config = config || {};
-
- this.rules = [];
- this.rules_cache = {};
- this.rule_configs = [];
- this.rule_types = {};
- this.purge_callbacks = [];
- this.loaded_rule_sources = [];
-
- this.name = this.config.name || 'sentry';
- this.mode = this.config.mode || 'redirect';
- this.redirect = this.config.redirect || 'http://localhost/';
- this.cache_time = this.config.cache_time;
- this.rule_sources = this.config.rule_sources || ['config'];
- this.ignore_test = this.config.ignore_test; //to ignore test commands via redis. will be used only by the status script
- this.measure_times = this.config.measure_times || false;
- this.dry_run = this.config.dry_run || false;
- this.timeout = this.config.timeout || 2000;
- this.allow_multiple = this.config.allow_multiple || false;
-
- this.package = require('../package');
- this.version = this.package.version;
-
- this.createLogger();
-
- this.log.info('Sentry started');
-
- //global exception handling!
- var self = this;
- process.on('uncaughtException', function(err){
- self.log.error({error:err, stack:err.stack, source:'uncaughtException'});
- });
-
-
- if(config.ldap){
- this.setLdapConf(config.ldap);
- }
-
- if(config.redis){
- this.setRedisConf(config.redis);
- }
-
- this.addRuleDefinition('category_file');
- this.addRuleDefinition('file_type');
- this.addRuleDefinition('category');
- this.addRuleDefinition('match');
- this.addRuleDefinition('time');
- this.addRuleDefinition('group');
- this.addRuleDefinition('user');
- this.addRuleDefinition('ou');
- this.addRuleDefinition('ip');
-
- this.loadRules(this.config.rules, 'config');
-
- if(this.cache_time){
- this.startPeriodicalPurge();
- }
-
-};
-
-Core.getSharedInstance = function(){
- return sharedInstance;
-};
-
-
-
-
-
-//create a bunyan logger
-Core.prototype.createLogger = function(){
-
- this.log_serializers = {
- rule: function(rule){
- return typeof rule == 'object' ? rule.name : rule;
- },
- rules: function(rules){
- var tmp = [];
- for(var i in rules){
- tmp.push(rules[i].name);
- }
- return tmp;
- },
- error: function(err){
- if(typeof err != 'string') err = err.toString();
- return err;
- }
- };
-
- var logger_conf = {
- name: this.name,
- serializers: this.log_serializers
- };
- if(this.config.explain !== true &amp;&amp; typeof this.config.log == 'string'){
- logger_conf.streams = [{
- level: this.config.log_level || 'error',
- path: this.config.log
- }];
- }
-
- if(this.config.log === false){
- logger_conf.streams = []; //Do not log anything
- }
-
- //create a new bunyan logger
- this.log = bunyan.createLogger(logger_conf);
-};
-
-
-
-// *******RULES******
-
-Core.prototype.addRule = function(rule, position){
- if(typeof position == 'number'){
- this.rules.splice(position, 0, new Rule(rule, this));
- }else{
- this.rules.push(new Rule(rule, this));
- }
-};
-
-Core.prototype.addRuleDefinition = function(ruledef){
- if(typeof ruledef == 'string'){
- //TODO check if exists. allow '*'
- ruledef = require('./rules/' + ruledef);
- }
-
- //Rule definitions for specific type (dest, src, misc)
- if(typeof ruledef.filter == 'function'){
- this.rule_types[ruledef.name] = ruledef.filter;
- }
-
- //Rule option parsing
- if(typeof ruledef.config == 'function'){
- this.rule_configs.push(ruledef.config);
- }
-
- //class extentions
- if(typeof ruledef.cache == 'object'){
-
- if(typeof ruledef.cache.purge == 'function'){
- this.purge_callbacks.push(ruledef.cache.purge);
- }
-
- for(var i in ruledef.cache){
- if(!this[i]){
- this[i] = ruledef.cache[i];
- }
- }
- }
-};
-
-
-// *******REDIS RULES******
-
-Core.prototype.loadRules = function(rules, source){
-
- if(rules &amp;&amp; rules instanceof Array){
- var pos = this.rule_sources.indexOf(source);
-
- if(pos != -1){
- this.rules_cache[source] = [];
- if(this.loaded_rule_sources.indexOf(source) == -1) this.loaded_rule_sources.push(source);
-
- for(var i in rules){
- this.rules_cache[source].push(new Rule(rules[i], this));
- }
-
- var tmp = [];
- for(i in this.rule_sources){
- var rule = this.rules_cache[this.rule_sources[i]];
- if(rule) tmp = tmp.concat(rule);
- }
- this.rules = tmp;
-
- this.log.info({rules:this.rules, loaded_sources: this.loaded_rule_sources});
- }
- }
-
-};
-
-
-Core.prototype.reloadRedisRules = function(purge){
- var self = this;
-
- this.redis.getRules(this.name, function(rules){
- self.loadRules(rules, 'redis');
- if(purge) self.purge();
- });
-};
-
-
-// *******SOURCES******
-
-Core.prototype.setRedisConf = function(config){
- if(!this.redis){
- var self = this;
-
- this.redis = new Redis(config, this);
-
- this.redis.onReady(function(){
-
- self.reloadRedisRules();
-
- if(!self.allow_multiple){
- self.redis.client.publish(self.name, 'new master');
- }
-
- self.redis.listenForChanges(self.name, function(msg){
-
- switch(msg){
- case 'test':
- if(self.ignore_test !== true) self.redis.client.publish(self.name, 'version:' + self.version);
- break;
-
- case 'new master':
- self.log.info('New Master: shutting down ' + process.pid);
- setTimeout(function(){
- process.exit(0);
- }, 1000);
- break;
-
- case 'reload':
- self.log.info('Reload Rules');
- self.reloadRedisRules(true);
- break;
-
- case 'start debugger':
- self.tmp_log = self.log;
- self.log = bunyan.createLogger({
- name: self.name,
- src: true,
- serializers: self.log_serializers,
- streams: [{
- path: self.config.log
- }]
- });
- self.log.info('Debugger started!');
- break;
-
- case 'stop debugger':
- if(self.tmp_log){
- self.log.info('Debugger stopped!');
- delete self.log;
- self.log = self.tmp_log;
- }
- break;
-
- case 'purge':
- self.purge();
- break;
-
- default:
- self.log.error({error:'Command &quot;' + msg + '&quot; not found!', source: 'core setRedisConf'});
- }
-
- });
-
- });
-
- }
-};
-
-
-Core.prototype.setLdapConf = function(config){
- if(!this.ldap){
- var self = this;
-
- this.ldap = new Ldap(config, this);
- }
-};
-
-
-// *******CLEAR CACHE******
-
-Core.prototype.purge = function(){
- this.log.info('Purge Cache');
- for(var i in this.purge_callbacks){
- this.purge_callbacks[i].call(this);
- }
-};
-
-Core.prototype.startPeriodicalPurge = function(){
- var self = this;
- setInterval(function(){
- self.purge();
- }, this.cache_time);
-};
-
-
-Core.prototype.close = function(){
- if(this.ldap){
- this.ldap.close();
- }
-
- if(this.redis){
- this.redis.close();
- }
-
- this.log.info('Sentry stopped!');
-};
-
-
-
-// *******MAIN******
-
-//callback will be called either without a param (everything is okay) or with a url (redirect)
-Core.prototype.isAllowed = function(options, callback){
- if(!options || !callback){
- throw new Error('options or callback missing!');
- }
-
- //add more...
- options.domain = url.parse(options.url).hostname;
- options.matching_rule = {};
-
- var self = this;
-
- //Sentry immediately returns true (allow) but will continue to check it's rules. Use the debugger to see what will happen.
- if(self.dry_run){
- callback(true);
- callback = function(){};
- }
-
- self.log.info({
- type: 'REQUEST',
- options:options
- });
-
- if(self.measure_times){
- options.start_time = new Date();
- }
-
- //If it takes to long to serve a request, the request will be allowed!
- var timed_out = false;
- var timeout_timer = setTimeout(function(){
- timed_out = true;
- callback(true);
- self.log.error({error:'Request Timeout!', source: 'core isAllowed', request: options});
- }, self.timeout);
-
-
- async.forEachSeries(this.rules, function(rule, next){
- rule.isAllowed(options, function(result){
-
- if(timed_out){
- next('stop');
- return false;
- }
-
- //whitelisted
- if(result === true){
- //Clear timeout
- clearTimeout(timeout_timer);
-
- callback(true, rule);
-
- self.log.info({
- allowed:true,
- rule:rule,
- options:options
- });
-
- next('done');
- return;
- }
-
- //Blocked. result = redirect url
- if(result){
- //Clear timeout
- clearTimeout(timeout_timer);
-
- //replace placeholder (e.g. [domain]) with actual values
- var redirect = result.replace(/\[(.+?)\]/ig, function(a, field){
- if(options[field]) return encodeURI(options[field]);
- if(options.matching_rule[field]) return encodeURI(options.matching_rule[field]);
- if(rule[field]) return encodeURI(rule[field]);
- return '';
- });
-
- callback(redirect, rule);
-
- self.log.info({
- allowed:false,
- redirect:redirect,
- rule:rule,
- options:options,
- used_time: self.measure_times ? (new Date() - options.start_time) : null
- });
-
- next('done');
- return;
- }
-
- next();
- });
-
- }, function(done){
- //Default... allow all! should be changed to deny all...?
- if(!done){
- //Clear timeout
- clearTimeout(timeout_timer);
-
- callback(true);
- self.log.info({
- allowed: true,
- rule: 'DEFAULT',
- options:options,
- used_time: self.measure_times ? (new Date() - options.start_time) : null
- });
- }
- });
-};</code></pre></div></div></div></article></div></div><!-- Foundation JS--><script type="text/javascript">document.write('<script src=' +
-('__proto__' in {} ? 'http://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min' : 'http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min') +
-'.js><\/script>')
-</script><script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/js/foundation.min.js"></script><script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/js/foundation/foundation.reveal.min.js"></script><!-- Prism js--><script type="text/javascript">
-/**
- * Prism: Lightweight, robust, elegant syntax highlighting
- * MIT license http://www.opensource.org/licenses/mit-license.php/
- * @author Lea Verou http://lea.verou.me
- */(function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');for(var i=0,s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement:function(r,i,s){var o,u,a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,""])[1];u=t.languages[o]}if(!u)return;r.className=r.className.replace(e,"").replace(/\s+/g," ")+" language-"+o;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+o);var f=r.textContent;if(!f)return;f=f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ");var l={element:r,language:o,grammar:u,code:f};t.hooks.run("before-highlight",l);if(i&&self.Worker){var c=new Worker(t.filename);c.onmessage=function(e){l.highlightedCode=n.stringify(JSON.parse(e.data),o);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(l.element);t.hooks.run("after-highlight",l)};c.postMessage(JSON.stringify({language:l.language,code:l.code}))}else{l.highlightedCode=t.highlight(l.code,l.grammar,l.language);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(r);t.hooks.run("after-highlight",l)}},highlight:function(e,r,i){return n.stringify(t.tokenize(e,r),i)},tokenize:function(e,n,r){var i=t.Token,s=[e],o=n.rest;if(o){for(var u in o)n[u]=o[u];delete n.rest}e:for(var u in n){if(!n.hasOwnProperty(u)||!n[u])continue;var a=n[u],f=a.inside,l=!!a.lookbehind,c=0;a=a.pattern||a;for(var h=0;h<s.length;h++){var p=s[h];if(s.length>e.length)break e;if(p instanceof i)continue;a.lastIndex=0;var d=a.exec(p);if(d){l&&(c=d[1].length);var v=d.index-1+c,d=d[0].slice(c),m=d.length,g=v+m,y=p.slice(0,v+1),b=p.slice(g+1),w=[h,1];y&&w.push(y);var E=new i(u,f?t.tokenize(d,f):d);w.push(E);b&&w.push(b);Array.prototype.splice.apply(s,w)}}}return s},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e,r,i){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(function(t){return n.stringify(t,r,e)}).join("");var s={type:e.type,content:n.stringify(e.content,r,i),tag:"span",classes:["token",e.type],attributes:{},language:r,parent:i};s.type=="comment"&&(s.attributes.spellcheck="true");t.hooks.run("wrap",s);var o="";for(var u in s.attributes)o+=u+'="'+(s.attributes[u]||"")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'" '+o+">"+s.content+"</"+s.tag+">"};if(!self.document){self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}})();;
-Prism.languages.markup={comment:/&lt;!--[\w\W]*?-->/g,prolog:/&lt;\?.+?\?>/,doctype:/&lt;!DOCTYPE.+?>/,cdata:/&lt;!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/&lt;\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^&lt;\/?[\w:-]+/i,inside:{punctuation:/^&lt;\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/&amp;#?[\da-z]{1,8};/gi};Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))});;
-Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*{))/gi,inside:{punctuation:/[;:]/g}},url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/g,property:/(\b|\B)[\w-]+(?=\s*:)/ig,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,ignore:/&(lt|gt|amp);/gi,punctuation:/[\{\};:]/g};Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/style(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)|(&lt;|<)\/style(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css}}});;
-Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/ig,inside:{punctuation:/\(/}}, number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,operator:/[-+]{1,2}|!|&lt;=?|>=?|={1,3}|(&amp;){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};;
-Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(var|let|if|else|while|do|for|return|in|instanceof|function|new|with|typeof|try|catch|finally|null|break|continue)\b/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g});Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}});Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/script(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)|(&lt;|<)\/script(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript}}});;
-Prism.languages.coffeescript=Prism.languages.extend("javascript",{"block-comment":/([#]{3}\s*\r?\n(.*\s*\r*\n*)\s*?\r?\n[#]{3})/g,comment:/(\s|^)([#]{1}[^#^\r^\n]{2,}?(\r?\n|$))/g,keyword:/\b(this|window|delete|class|extends|namespace|extend|ar|let|if|else|while|do|for|each|of|return|in|instanceof|new|with|typeof|try|catch|finally|null|undefined|break|continue)\b/g});Prism.languages.insertBefore("coffeescript","keyword",{"function":{pattern:/[a-z|A-z]+\s*[:|=]\s*(\([.|a-z\s|,|:|{|}|\"|\'|=]*\))?\s*-&gt;/gi,inside:{"function-name":/[_?a-z-|A-Z-]+(\s*[:|=])| @[_?$?a-z-|A-Z-]+(\s*)| /g,operator:/[-+]{1,2}|!|=?&lt;|=?&gt;|={1,2}|(&amp;){1,2}|\|?\||\?|\*|\//g}},"attr-name":/[_?a-z-|A-Z-]+(\s*:)| @[_?$?a-z-|A-Z-]+(\s*)| /g});;
-Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/g,lookbehind:!0},atrule:/@[\w-]+(?=\s+(\(|\{|;))/gi,url:/([-a-z]+-)*url(?=\()/gi,selector:/([^@;\{\}\(\)]?([^@;\{\}\(\)]|&amp;|\#\{\$[-_\w]+\})+)(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/gm});Prism.languages.insertBefore("scss","atrule",{keyword:/@(if|else if|else|for|each|while|import|extend|debug|warn|mixin|include|function|return)|(?=@for\s+\$[-_\w]+\s)+from/i});Prism.languages.insertBefore("scss","property",{variable:/((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i});Prism.languages.insertBefore("scss","ignore",{placeholder:/%[-_\w]+/i,statement:/\B!(default|optional)\b/gi,"boolean":/\b(true|false)\b/g,"null":/\b(null)\b/g,operator:/\s+([-+]{1,2}|={1,2}|!=|\|?\||\?|\*|\/|\%)\s+/g});
-;
-</script><script type="text/javascript">
- var headerHeight = 64;
-
- $(document).foundation();
-
- $(function(){
- $('pre code').addClass('language-javascript');
- // $('#nav > ul > li > a[href$="'+location.pathname.substring(location.pathname.lastIndexOf('/')+1, location.pathname.length)+'"]').parent().addClass('active');
- })</script></body></html>
282 docs/lib/rules/category.js.html
View
@@ -1,282 +0,0 @@
-<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width" charset="utf-8"><title>squid3_sentry</title><!-- Foundation CSS--><link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/css/foundation.min.css"><!-- Prism CSS--><style type="text/css">/**
- * prism.js default theme for JavaScript, CSS and HTML
- * Based on dabblet (http://dabblet.com)
- * @author Lea Verou
- */
-
-code[class*="language-"],
-pre[class*="language-"] {
- color: black;
- text-shadow: 0 1px white;
- font-family: Consolas, Monaco, 'Andale Mono', monospace;
- direction: ltr;
- text-align: left;
- white-space: pre;
- word-spacing: normal;
-
- -moz-tab-size: 4;
- -o-tab-size: 4;
- tab-size: 4;
-
- -webkit-hyphens: none;
- -moz-hyphens: none;
- -ms-hyphens: none;
- hyphens: none;
-}
-
-::-moz-selection {
- text-shadow: none;
- background: #b3d4fc;
-}
-
-::selection {
- text-shadow: none;
- background: #b3d4fc;
-}
-
-@media print {
- code[class*="language-"],
- pre[class*="language-"] {
- text-shadow: none;
- }
-}
-
-/* Code blocks */
-pre[class*="language-"] {
- padding: 1em;
- margin: .5em 0;
- overflow: auto;
-}
-
-:not(pre) > code[class*="language-"],
-pre[class*="language-"] {
- background: #f5f2f0;
-}
-
-/* Inline code */
-:not(pre) > code[class*="language-"] {
- padding: .1em;
- border-radius: .3em;
-}
-
-.token.comment,
-.token.prolog,
-.token.doctype,
-.token.cdata {
- color: slategray;
-}
-
-.token.punctuation {
- color: #999;
-}
-
-.namespace {
- opacity: .7;
-}
-
-.token.property,
-.token.tag,
-.token.boolean,
-.token.number {
- color: #905;
-}
-
-.token.selector,
-.token.attr-name,
-.token.string {
- color: #690;
-}
-
-.token.operator,
-.token.entity,
-.token.url,
-.language-css .token.string,
-.style .token.string {
- color: #a67f59;
- background: hsla(0,0%,100%,.5);
-}
-
-.token.atrule,
-.token.attr-value,
-.token.keyword {
- color: #07a;
-}
-
-
-.token.regex,
-.token.important {
- color: #e90;
-}
-
-.token.important {
- font-weight: bold;
-}
-
-.token.entity {
- cursor: help;
-}
-</style><!-- Custom Styles--><style type="text/css">h1.page-title small {
- font-weight: 400;
-}
-/*.section-container, .section-container .section .title
- border-color #e6e6e6*/
-#nav .section.active {
- padding-top: 0 !important;
-}
-#nav .section.active .title {
- background: #ddd;
-}
-#nav .section .title {
- background-color: #eee;
-}
-#nav .section .title a {
- font-weight: 700;
- padding: 0.6em;
-}
-#nav .section .title a small {
- font-size: 0.8em;
- line-height: 1em;
- display: block;
- color: #888;
- margin: 2px 0 -2px;
-}
-#nav .section .title:hover {
- background: #ddd;
-}
-#nav ul.solo {
- border-top: 1px solid #ccc;
- padding: 0.875em;
-}
-code {
- background: transparent;
- line-height: 1.3em;
- font-weight: normal;
-}
-.comment {
- position: relative;
- padding-bottom: 1.5em;
- margin-bottom: 2em;
- border-bottom: 1px solid #ddd;
-}
-.comment ol,
-.comment ul {
- margin-left: 2.25em;
-}
-.comment ol.no-bullet,
-.comment ul.no-bullet {
- margin-left: 0;
-}
-.comment header {
- margin-bottom: 1.5em;
-}
-.comment header h1 {
- font-size: 2rem;
- margin-bottom: 0.2em;
-}
-.comment .section-container,
-.comment .section-container > .section > .content {
- border: none;
-}
-.comment .section-container > .section > .title {
- padding: auto;
- background: none !important;
- border: none !important;
-}
-.comment .section-container > .section > .title a {
- border-radius: 4px;
- font-weight: 700;
- padding: 1px 10px 1px 0;
- margin-right: 5px;
- color: #ccc;
-}
-.comment .section-container > .section:hover .title a {
- color: #999;
-}
-.comment .section-container > .section.active .title a {
- color: #2ba6cb;
-}
-.comment .section-container > .section > .content {
- padding: 0.9em 0 0;
-}
-.comment div.description h2 {
- font-size: 1.2em;
-}
-.comment .tags span {
- margin-right: 4px;
-}
-.comment .tags .name,
-.comment .tags .type {
- font-weight: 700;
-}
-.comment .tags .types {
- color: #666;
-}
-.comment .tags .description {
- margin-left: 15px;
-}
-.ctx-type {
- margin-right: 6px;
- font-size: 0.7em;
-}
-</style><script srr="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/js/vendor/custom.modernizr.js"></script></head><body><div class="row"><div class="small-12 columns"><h1 class="page-title">squid3_sentry<small> lib/rules/category.js</small></h1></div></div><div class="row"><div id="nav" class="large-3 columns"><div data-section="accordian" data-options="" class="section-container accordian"><div class="section"><p data-section-title class="title"><a href="../../../docs/examples/reload_rules.js.html"><small>examples/</small>reload_rules.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/examples/reload_rules.js.html#crypto">crypto</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/examples/remote_rule_change.js.html"><small>examples/</small>remote_rule_change.js</a></p><div data-section-content class="content"><ul class="side-nav"></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/examples/test.js.html"><small>examples/</small>test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/examples/test.js.html#Core">Core</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/core.js.html"><small>lib/</small>core.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/core.js.html#async">async</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/rule.js.html"><small>lib/</small>rule.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/rule.js.html#Rule">Rule</a></li></ul></div></div><div class="section active"><p data-section-title class="title"><a href="../../../docs/lib/rules/category.js.html"><small>lib/rules/</small>category.js</a></p><div data-section-content class="content"><ul class="side-nav"></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/rules/category_file.js.html"><small>lib/rules/</small>category_file.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/rules/category_file.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/rules/file_type.js.html"><small>lib/rules/</small>file_type.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/rules/file_type.js.html#url">url</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/rules/group.js.html"><small>lib/rules/</small>group.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/rules/group.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/rules/ip.js.html"><small>lib/rules/</small>ip.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/rules/ip.js.html#Netmask">Netmask</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/rules/match.js.html"><small>lib/rules/</small>match.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/rules/match.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/rules/ou.js.html"><small>lib/rules/</small>ou.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/rules/ou.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/rules/time.js.html"><small>lib/rules/</small>time.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/rules/time.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/rules/user.js.html"><small>lib/rules/</small>user.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/rules/user.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/sources/ldap.js.html"><small>lib/sources/</small>ldap.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/sources/ldap.js.html#ldap">ldap</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/sources/redis.js.html"><small>lib/sources/</small>redis.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/sources/redis.js.html#redis">redis</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/squid.js.html"><small>lib/</small>squid.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/squid.js.html#Core">Core</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib2/index.js.html"><small>lib2/</small>index.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib2/index.js.html#Sentry">Sentry</a></li><li><a href="../../../docs/lib2/index.js.html#rules">rules</a></li><li><a href="../../../docs/lib2/index.js.html#isAllowed">isAllowed</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib2/rules/category.js.html"><small>lib2/rules/</small>category.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib2/rules/category.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib2/rules/category_file.js.html"><small>lib2/rules/</small>category_file.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib2/rules/category_file.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib2/rules/file_type.js.html"><small>lib2/rules/</small>file_type.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib2/rules/file_type.js.html#url">url</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib2/rules/group.js.html"><small>lib2/rules/</small>group.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib2/rules/group.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib2/rules/index.js.html"><small>lib2/rules/</small>index.js</a></p><div data-section-content class="content"><ul class="side-nav"></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib2/rules/ip.js.html"><small>lib2/rules/</small>ip.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib2/rules/ip.js.html#Netmask">Netmask</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib2/rules/match.js.html"><small>lib2/rules/</small>match.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib2/rules/match.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib2/rules/ou.js.html"><small>lib2/rules/</small>ou.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib2/rules/ou.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib2/rules/time.js.html"><small>lib2/rules/</small>time.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib2/rules/time.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib2/rules/user.js.html"><small>lib2/rules/</small>user.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib2/rules/user.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/test/cache-test.js.html"><small>test/</small>cache-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/test/cache-test.js.html#vows">vows</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/test/core-test.js.html"><small>test/</small>core-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/test/core-test.js.html#vows">vows</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/test/rules-test.js.html"><small>test/</small>rules-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/test/rules-test.js.html#vows">vows</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/test/squid-test.js.html"><small>test/</small>squid-test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/test/squid-test.js.html#vows">vows</a></li></ul></div></div></div></div><div class="small-12 large-9 columns"><article class="comment"><header></header><ul class="no-bullet tags"></ul><div data-section="accordian" data-options="one_up: false;" class="section-container code auto"><div class="section"><p data-section-title class="title"><a href="#">Description</a></p><div data-section-content class="content description"><p>@description Read from cache.</p></div></div><div class="section"><p data-section-title class="title"><a href="#">Source</a></p><div data-section-content class="content"><pre><code class="language-javascript">callback(this.categories[url][category], this.categories[url]['categories']);
- }
- }else{
- if(this.redis){
-
- this.categories[url] = this.categories[url] || {};
- this.categories[url][category] = [callback]; //put it into the callback queue
-
- this.redis.listContainsItems(categories, items, function(in_category, in_categories){
- self.categories[url] = self.categories[url] || {categories: []};
-
- //call all the callbacks in the queue(if there is nothing: cache was cleared)
- if(self.categories[url][category].length &gt; 0){
-
- var callbacks = self.categories[url][category];
- self.categories[url][category] = in_category;
-
- if(self.categories[url]['categories'] instanceof Array){
- self.categories[url]['categories'] = self.categories[url]['categories'].concat(in_categories);
- }else{
- self.categories[url]['categories'] = in_categories;
- }
-
- for(var i in callbacks){
- callbacks[i](in_category, self.categories[url]['categories']);
- }
- }
-
- });
-
- }else{
- callback(false, []);
- }
- }
- }
- }
-
-};</code></pre></div></div></div></article></div></div><!-- Foundation JS--><script type="text/javascript">document.write('<script src=' +
-('__proto__' in {} ? 'http://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min' : 'http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min') +
-'.js><\/script>')
-</script><script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/js/foundation.min.js"></script><script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/js/foundation/foundation.reveal.min.js"></script><!-- Prism js--><script type="text/javascript">
-/**
- * Prism: Lightweight, robust, elegant syntax highlighting
- * MIT license http://www.opensource.org/licenses/mit-license.php/
- * @author Lea Verou http://lea.verou.me
- */(function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');for(var i=0,s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement:function(r,i,s){var o,u,a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,""])[1];u=t.languages[o]}if(!u)return;r.className=r.className.replace(e,"").replace(/\s+/g," ")+" language-"+o;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+o);var f=r.textContent;if(!f)return;f=f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ");var l={element:r,language:o,grammar:u,code:f};t.hooks.run("before-highlight",l);if(i&&self.Worker){var c=new Worker(t.filename);c.onmessage=function(e){l.highlightedCode=n.stringify(JSON.parse(e.data),o);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(l.element);t.hooks.run("after-highlight",l)};c.postMessage(JSON.stringify({language:l.language,code:l.code}))}else{l.highlightedCode=t.highlight(l.code,l.grammar,l.language);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(r);t.hooks.run("after-highlight",l)}},highlight:function(e,r,i){return n.stringify(t.tokenize(e,r),i)},tokenize:function(e,n,r){var i=t.Token,s=[e],o=n.rest;if(o){for(var u in o)n[u]=o[u];delete n.rest}e:for(var u in n){if(!n.hasOwnProperty(u)||!n[u])continue;var a=n[u],f=a.inside,l=!!a.lookbehind,c=0;a=a.pattern||a;for(var h=0;h<s.length;h++){var p=s[h];if(s.length>e.length)break e;if(p instanceof i)continue;a.lastIndex=0;var d=a.exec(p);if(d){l&&(c=d[1].length);var v=d.index-1+c,d=d[0].slice(c),m=d.length,g=v+m,y=p.slice(0,v+1),b=p.slice(g+1),w=[h,1];y&&w.push(y);var E=new i(u,f?t.tokenize(d,f):d);w.push(E);b&&w.push(b);Array.prototype.splice.apply(s,w)}}}return s},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e,r,i){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(function(t){return n.stringify(t,r,e)}).join("");var s={type:e.type,content:n.stringify(e.content,r,i),tag:"span",classes:["token",e.type],attributes:{},language:r,parent:i};s.type=="comment"&&(s.attributes.spellcheck="true");t.hooks.run("wrap",s);var o="";for(var u in s.attributes)o+=u+'="'+(s.attributes[u]||"")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'" '+o+">"+s.content+"</"+s.tag+">"};if(!self.document){self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}})();;
-Prism.languages.markup={comment:/&lt;!--[\w\W]*?-->/g,prolog:/&lt;\?.+?\?>/,doctype:/&lt;!DOCTYPE.+?>/,cdata:/&lt;!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/&lt;\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^&lt;\/?[\w:-]+/i,inside:{punctuation:/^&lt;\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/&amp;#?[\da-z]{1,8};/gi};Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))});;
-Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*{))/gi,inside:{punctuation:/[;:]/g}},url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/g,property:/(\b|\B)[\w-]+(?=\s*:)/ig,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,ignore:/&(lt|gt|amp);/gi,punctuation:/[\{\};:]/g};Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/style(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)|(&lt;|<)\/style(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css}}});;
-Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/ig,inside:{punctuation:/\(/}}, number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,operator:/[-+]{1,2}|!|&lt;=?|>=?|={1,3}|(&amp;){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};;
-Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(var|let|if|else|while|do|for|return|in|instanceof|function|new|with|typeof|try|catch|finally|null|break|continue)\b/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g});Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}});Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/script(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)|(&lt;|<)\/script(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript}}});;
-Prism.languages.coffeescript=Prism.languages.extend("javascript",{"block-comment":/([#]{3}\s*\r?\n(.*\s*\r*\n*)\s*?\r?\n[#]{3})/g,comment:/(\s|^)([#]{1}[^#^\r^\n]{2,}?(\r?\n|$))/g,keyword:/\b(this|window|delete|class|extends|namespace|extend|ar|let|if|else|while|do|for|each|of|return|in|instanceof|new|with|typeof|try|catch|finally|null|undefined|break|continue)\b/g});Prism.languages.insertBefore("coffeescript","keyword",{"function":{pattern:/[a-z|A-z]+\s*[:|=]\s*(\([.|a-z\s|,|:|{|}|\"|\'|=]*\))?\s*-&gt;/gi,inside:{"function-name":/[_?a-z-|A-Z-]+(\s*[:|=])| @[_?$?a-z-|A-Z-]+(\s*)| /g,operator:/[-+]{1,2}|!|=?&lt;|=?&gt;|={1,2}|(&amp;){1,2}|\|?\||\?|\*|\//g}},"attr-name":/[_?a-z-|A-Z-]+(\s*:)| @[_?$?a-z-|A-Z-]+(\s*)| /g});;
-Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/g,lookbehind:!0},atrule:/@[\w-]+(?=\s+(\(|\{|;))/gi,url:/([-a-z]+-)*url(?=\()/gi,selector:/([^@;\{\}\(\)]?([^@;\{\}\(\)]|&amp;|\#\{\$[-_\w]+\})+)(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/gm});Prism.languages.insertBefore("scss","atrule",{keyword:/@(if|else if|else|for|each|while|import|extend|debug|warn|mixin|include|function|return)|(?=@for\s+\$[-_\w]+\s)+from/i});Prism.languages.insertBefore("scss","property",{variable:/((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i});Prism.languages.insertBefore("scss","ignore",{placeholder:/%[-_\w]+/i,statement:/\B!(default|optional)\b/gi,"boolean":/\b(true|false)\b/g,"null":/\b(null)\b/g,operator:/\s+([-+]{1,2}|={1,2}|!=|\|?\||\?|\*|\/|\%)\s+/g});
-;
-</script><script type="text/javascript">
- var headerHeight = 64;
-
- $(document).foundation();
-
- $(function(){
- $('pre code').addClass('language-javascript');
- // $('#nav > ul > li > a[href$="'+location.pathname.substring(location.pathname.lastIndexOf('/')+1, location.pathname.length)+'"]').parent().addClass('active');
- })</script></body></html>
284 docs/lib/rules/category_file.js.html
View
@@ -1,284 +0,0 @@
-<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width" charset="utf-8"><title>squid3_sentry</title><!-- Foundation CSS--><link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/css/foundation.min.css"><!-- Prism CSS--><style type="text/css">/**
- * prism.js default theme for JavaScript, CSS and HTML
- * Based on dabblet (http://dabblet.com)
- * @author Lea Verou
- */
-
-code[class*="language-"],
-pre[class*="language-"] {
- color: black;
- text-shadow: 0 1px white;
- font-family: Consolas, Monaco, 'Andale Mono', monospace;
- direction: ltr;
- text-align: left;
- white-space: pre;
- word-spacing: normal;
-
- -moz-tab-size: 4;
- -o-tab-size: 4;
- tab-size: 4;
-
- -webkit-hyphens: none;
- -moz-hyphens: none;
- -ms-hyphens: none;
- hyphens: none;
-}
-
-::-moz-selection {
- text-shadow: none;
- background: #b3d4fc;
-}
-
-::selection {
- text-shadow: none;
- background: #b3d4fc;
-}
-
-@media print {
- code[class*="language-"],
- pre[class*="language-"] {
- text-shadow: none;
- }
-}
-
-/* Code blocks */
-pre[class*="language-"] {
- padding: 1em;
- margin: .5em 0;
- overflow: auto;
-}
-
-:not(pre) > code[class*="language-"],
-pre[class*="language-"] {
- background: #f5f2f0;
-}
-
-/* Inline code */
-:not(pre) > code[class*="language-"] {
- padding: .1em;
- border-radius: .3em;
-}
-
-.token.comment,
-.token.prolog,
-.token.doctype,
-.token.cdata {
- color: slategray;
-}
-
-.token.punctuation {
- color: #999;
-}
-
-.namespace {
- opacity: .7;
-}
-
-.token.property,
-.token.tag,
-.token.boolean,
-.token.number {
- color: #905;
-}
-
-.token.selector,
-.token.attr-name,
-.token.string {
- color: #690;
-}
-
-.token.operator,
-.token.entity,
-.token.url,
-.language-css .token.string,
-.style .token.string {
- color: #a67f59;
- background: hsla(0,0%,100%,.5);
-}
-
-.token.atrule,
-.token.attr-value,
-.token.keyword {
- color: #07a;
-}
-
-
-.token.regex,
-.token.important {
- color: #e90;
-}
-
-.token.important {
- font-weight: bold;
-}
-
-.token.entity {
- cursor: help;
-}
-</style><!-- Custom Styles--><style type="text/css">h1.page-title small {
- font-weight: 400;
-}
-/*.section-container, .section-container .section .title
- border-color #e6e6e6*/
-#nav .section.active {
- padding-top: 0 !important;
-}
-#nav .section.active .title {
- background: #ddd;
-}
-#nav .section .title {
- background-color: #eee;
-}
-#nav .section .title a {
- font-weight: 700;
- padding: 0.6em;
-}
-#nav .section .title a small {
- font-size: 0.8em;
- line-height: 1em;
- display: block;
- color: #888;
- margin: 2px 0 -2px;
-}
-#nav .section .title:hover {
- background: #ddd;
-}
-#nav ul.solo {
- border-top: 1px solid #ccc;
- padding: 0.875em;
-}
-code {
- background: transparent;
- line-height: 1.3em;
- font-weight: normal;
-}
-.comment {
- position: relative;
- padding-bottom: 1.5em;
- margin-bottom: 2em;
- border-bottom: 1px solid #ddd;
-}
-.comment ol,
-.comment ul {
- margin-left: 2.25em;
-}
-.comment ol.no-bullet,
-.comment ul.no-bullet {
- margin-left: 0;
-}
-.comment header {
- margin-bottom: 1.5em;
-}
-.comment header h1 {
- font-size: 2rem;
- margin-bottom: 0.2em;
-}
-.comment .section-container,
-.comment .section-container > .section > .content {
- border: none;
-}
-.comment .section-container > .section > .title {
- padding: auto;
- background: none !important;
- border: none !important;
-}
-.comment .section-container > .section > .title a {
- border-radius: 4px;
- font-weight: 700;
- padding: 1px 10px 1px 0;
- margin-right: 5px;
- color: #ccc;
-}
-.comment .section-container > .section:hover .title a {
- color: #999;
-}
-.comment .section-container > .section.active .title a {
- color: #2ba6cb;
-}
-.comment .section-container > .section > .content {
- padding: 0.9em 0 0;
-}
-.comment div.description h2 {
- font-size: 1.2em;
-}
-.comment .tags span {
- margin-right: 4px;
-}
-.comment .tags .name,
-.comment .tags .type {
- font-weight: 700;
-}
-.comment .tags .types {
- color: #666;
-}
-.comment .tags .description {
- margin-left: 15px;
-}
-.ctx-type {
- margin-right: 6px;
- font-size: 0.7em;
-}
-</style><script srr="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.1.6/js/vendor/custom.modernizr.js"></script></head><body><div class="row"><div class="small-12 columns"><h1 class="page-title">squid3_sentry<small> lib/rules/category_file.js</small></h1></div></div><div class="row"><div id="nav" class="large-3 columns"><div data-section="accordian" data-options="" class="section-container accordian"><div class="section"><p data-section-title class="title"><a href="../../../docs/examples/reload_rules.js.html"><small>examples/</small>reload_rules.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/examples/reload_rules.js.html#crypto">crypto</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/examples/remote_rule_change.js.html"><small>examples/</small>remote_rule_change.js</a></p><div data-section-content class="content"><ul class="side-nav"></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/examples/test.js.html"><small>examples/</small>test.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/examples/test.js.html#Core">Core</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/core.js.html"><small>lib/</small>core.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/core.js.html#async">async</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/rule.js.html"><small>lib/</small>rule.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/rule.js.html#Rule">Rule</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/rules/category.js.html"><small>lib/rules/</small>category.js</a></p><div data-section-content class="content"><ul class="side-nav"></ul></div></div><div class="section active"><p data-section-title class="title"><a href="../../../docs/lib/rules/category_file.js.html"><small>lib/rules/</small>category_file.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/rules/category_file.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/rules/file_type.js.html"><small>lib/rules/</small>file_type.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/rules/file_type.js.html#url">url</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/rules/group.js.html"><small>lib/rules/</small>group.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/rules/group.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/rules/ip.js.html"><small>lib/rules/</small>ip.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/rules/ip.js.html#Netmask">Netmask</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href="../../../docs/lib/rules/match.js.html"><small>lib/rules/</small>match.js</a></p><div data-section-content class="content"><ul class="side-nav"><li><a href="../../../docs/lib/rules/match.js.html#exports">exports</a></li></ul></div></div><div class="section"><p data-section-title class="title"><a href=&q