Merge branch 'master' into kikeflare

This commit is contained in:
Thomas Lynch
2022-04-26 07:32:08 +00:00
4 changed files with 31 additions and 0 deletions

View File

@ -17,6 +17,7 @@ Improvements in this fork:
- Cluster toggle, for pow mode only.
- Choose protection modes "none", "pow" or "pow+captcha" per-domain or per-domain+path, with paths taking priority.
- Whitelist IPs/subnets.
- Maintenance mode page for selected domains.
- Include dataplaneapi, to sync map files to disk if edited during runtime.
- In POW only mode, provide instructions and an encoded script to find the solution.
- Many bugfixes.

View File

@ -119,6 +119,10 @@ frontend www-http-https
http-request return file /var/www/js/worker.js status 200 content-type "application/javascript; charset=utf-8" hdr "cache-control" "public, max-age=300" if is_worker_js
http-request return file /var/www/img/footerlogo.png status 200 content-type "image/png" hdr "cache-control" "public, max-age=300" if is_footerlogo_png
# acl for domains in maintenance mode to return maintenance page (after challenge page htp-request return rules, for the footerlogo)
acl maintenance_mode hdr(host),lower,map_str(/etc/haproxy/maintenance.map) -m found
http-request return file /var/www/html/maintenance.html status 200 content-type "text/html; charset=utf-8" hdr "cache-control" "private, max-age=30" if maintenance_mode
# create acl for bools updated by lua
acl captcha_passed var(txn.captcha_passed) -m bool
acl pow_passed var(txn.pow_passed) -m bool

View File

@ -0,0 +1,26 @@
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Maintenance Mode</title>
<style type="text/css">
:root{--text-color:#c5c8c6;--bg-color:#1d1f21}
@media (prefers-color-scheme:light){:root{--text-color:#333;--bg-color:#EEE}}
a,a:visited{color:var(--text-color)}
body,html{height:100%}
body{display:flex;flex-direction:column;background-color:var(--bg-color);color:var(--text-color);font-family:Helvetica,Arial,sans-serif;text-align:center;margin:0}
code{background-color:#dfdfdf30;border-radius:3px;padding:0 3px;}
img,h3,p{margin:0 0 5px 0}
footer{font-size:x-small;margin-top:auto;margin-bottom:20px}.pt{padding-top:30vh}
</style>
</head>
<body>
<h3 class="pt">Under maintenance. Please try again soon!</h3>
<footer>
<img src="/img/footerlogo.png">
<p>Security and Performance by <a href="https://kikeflare.com">Kikeflare</a></p>
<p>Vey ID: <code>553d0499f419bd4c66ff48f7d0a27706</code></p>
</footer>
</body>
</html>

0
haproxy/maintenance.map Normal file
View File