diff --git a/README.MD b/README.MD index 1a411ed..05c93e7 100644 --- a/README.MD +++ b/README.MD @@ -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. diff --git a/haproxy/haproxy.cfg b/haproxy/haproxy.cfg index 188bc6f..992a791 100644 --- a/haproxy/haproxy.cfg +++ b/haproxy/haproxy.cfg @@ -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 diff --git a/haproxy/html/maintenance.html b/haproxy/html/maintenance.html new file mode 100644 index 0000000..99178f6 --- /dev/null +++ b/haproxy/html/maintenance.html @@ -0,0 +1,26 @@ + + + + + Maintenance Mode + + + +

Under maintenance. Please try again soon!

+ + + + diff --git a/haproxy/maintenance.map b/haproxy/maintenance.map new file mode 100644 index 0000000..e69de29