aboutsummaryrefslogtreecommitdiff
path: root/cgi/templates
diff options
context:
space:
mode:
Diffstat (limited to 'cgi/templates')
-rw-r--r--cgi/templates/bans_geo14
-rw-r--r--cgi/templates/bans_locations10
-rw-r--r--cgi/templates/bansconf7
3 files changed, 24 insertions, 7 deletions
diff --git a/cgi/templates/bans_geo b/cgi/templates/bans_geo
new file mode 100644
index 0000000..64687e8
--- /dev/null
+++ b/cgi/templates/bans_geo
@@ -0,0 +1,14 @@
+geo $bans_global {
+ default 0;
+<?py for ip in global_bans: ?>
+ #{ip} 1;
+<?py #endfor ?>
+}
+<?py for board, bans in board_bans.iteritems(): ?>
+geo $bans_#{board} {
+ default 0;
+ <?py for ip in bans: ?>
+ #{ip} 1;
+ <?py #endfor ?>
+}
+<?py #endfor ?>
diff --git a/cgi/templates/bans_locations b/cgi/templates/bans_locations
new file mode 100644
index 0000000..a514ccf
--- /dev/null
+++ b/cgi/templates/bans_locations
@@ -0,0 +1,10 @@
+<?py for board in set().union(global_boards, board_bans.keys()): ?>
+location /#{board}/ {
+ <?py if board in global_boards: ?>
+ if ($bans_global) { rewrite ^ /cgi/banned; }
+ <?py #endif ?>
+ <?py if board in board_bans: ?>
+ if ($bans_#{board}) { rewrite ^ /cgi/banned; }
+ <?py #endif ?>
+}
+<?py #endfor ?>
diff --git a/cgi/templates/bansconf b/cgi/templates/bansconf
deleted file mode 100644
index 07e8afd..0000000
--- a/cgi/templates/bansconf
+++ /dev/null
@@ -1,7 +0,0 @@
-<?py for board, ips in bans.iteritems(): ?>
-location /#{board}/ {
- <?py for ip in ips: ?>
- deny #{ip};
- <?py #endfor ?>
-}
-<?py #endfor ?>