Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions ansible/templates/dt.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ http {
}
error_page 503 @maintenance;
location @maintenance {
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Cache-Control "no-store" always;
add_header Retry-After 600 always;
rewrite ^(.*)$ /index.html break;
}
Expand Down
31 changes: 31 additions & 0 deletions contrib/maintenance.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex">
<title>Scheduled maintenance</title>
<style>
:root { color-scheme: light dark; }
body {
margin: 0; min-height: 100vh; display: flex; align-items: center;
justify-content: center; font-family: system-ui, sans-serif;
background: #222; color: #e6e6e6; text-align: center; padding: 1rem;
}
main { max-width: 34rem; }
h1 { font-size: 2rem; margin-bottom: 0.5rem; }
p { line-height: 1.6; color: #b5b5b5; }
a { color: #6cb6ff; }
</style>
</head>
<body>
<main>
<img width="480px" src="https://raw.githubusercontent.com/echoCTF/echoCTF.RED/refs/heads/master/frontend/web/images/logo-red.png">

<h1>We will be right back</h1>
<p>The platform is undergoing scheduled maintenance and infrastructure updates.
Your progress is safe. Please check back in a little while.</p>
<p>Updates: <a href="https://discord.gg/aQcWYbXVpa">Discord</a></p>
</main>
</body>
</html>
13 changes: 10 additions & 3 deletions contrib/scripts/cloudblock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ az=$(ftp -Vo - "https://www.microsoft.com/en-us/download/details.aspx?id=56519"
[ -n "$az" ] || { echo "azure url not found" >&2; exit 1; }
ftp -Vo "$d/azure.json" "$az"

for as in 16276 24940 51167 12876 9009 49505 53667 23470 62240 60068 396356 210644; do
for as in 16276 24940 51167 12876 9009 49505 53667 23470 62240 60068 396356 210644 213230 212317 215859; do
bgpq4 -S RIPE,APNIC,ARIN,LACNIC,AFRINIC -F "%n/%l\n" AS$as >> "$d/asn.txt"
bgpq4 -S RIPE,APNIC,ARIN,LACNIC,AFRINIC -6F "%n/%l\n" AS$as >> "$d/asn.txt"
done
Expand Down Expand Up @@ -53,5 +53,12 @@ n=$(wc -l < "$d/out.txt")
[ "$n" -ge 5000 ] || { echo "refusing: only $n prefixes" >&2; exit 1; }
grep -qE '^(0\.0\.0\.0/0|::/0)$' "$d/out.txt" && { echo "default route in list" >&2; exit 1; }

install -m 0644 "$d/out.txt" /etc/pf/cloudblock.txt
pfctl -t cloudblock -T replace -f /etc/pf/cloudblock.txt
allow=/etc/pf/cloudblock-exclude.conf
if [ -s "$allow" ]; then
# strip comments/blank lines/whitespace, prefix each entry with '!'
sed -e 's/#.*//' -e 's/[[:space:]]//g' -e '/^$/d' -e 's/^/!/' "$allow" \
>> "$d/out.txt"
fi

install -m 0644 "$d/out.txt" /etc/pf/cloudblock.conf
pfctl -t cloudblock -T replace -f /etc/pf/cloudblock.conf