From 05e34b5aaa55616ef47b2c5caa11ec690570dd2a Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Fri, 13 Nov 2020 17:29:40 +0100 Subject: [PATCH] rename blacklist to blocklist --- docker/nginx/conf.d/client.conf | 18 ++++++------------ ...acklist-skylink.sh => blocklist-skylink.sh} | 8 ++++---- setup-scripts/README.md | 2 +- 3 files changed, 11 insertions(+), 17 deletions(-) rename scripts/{blacklist-skylink.sh => blocklist-skylink.sh} (55%) diff --git a/docker/nginx/conf.d/client.conf b/docker/nginx/conf.d/client.conf index 54e28e64..2ef92c3b 100644 --- a/docker/nginx/conf.d/client.conf +++ b/docker/nginx/conf.d/client.conf @@ -34,6 +34,9 @@ server { client_body_buffer_size 128k; client_max_body_size 128k; + # legacy endpoint rewrite + rewrite /skynet/blacklist /skynet/blocklist permanent; + location / { # This is only safe workaround to reroute based on some conditions # See https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/ @@ -60,22 +63,13 @@ server { proxy_pass https://nebulouslabs.github.io/skynet-docs; } - location /blacklist { + location /skynet/blocklist { include /etc/nginx/conf.d/include/cors; proxy_cache skynet; - proxy_cache_valid any 1m; # cache blacklist for 1 minute + proxy_cache_valid any 1m; # cache blocklist for 1 minute proxy_set_header User-Agent: Sia-Agent; - proxy_pass http://siad/skynet/blacklist; - } - - location /skynet/blacklist { - include /etc/nginx/conf.d/include/cors; - - proxy_cache skynet; - proxy_cache_valid any 1m; # cache blacklist for 1 minute - proxy_set_header User-Agent: Sia-Agent; - proxy_pass http://siad/skynet/blacklist; + proxy_pass http://siad/skynet/blocklist; } location /portals { diff --git a/scripts/blacklist-skylink.sh b/scripts/blocklist-skylink.sh similarity index 55% rename from scripts/blacklist-skylink.sh rename to scripts/blocklist-skylink.sh index 3f92ed21..b4abdfcf 100755 --- a/scripts/blacklist-skylink.sh +++ b/scripts/blocklist-skylink.sh @@ -3,14 +3,14 @@ set -e # exit on first error if [ -z "$1" ]; then - echo "Please provide a skylink to blacklist" && exit 1 + echo "Please provide a skylink to blocklist" && exit 1 fi -for server in "germany.siasky.net" "us-east.siasky.net" "us-west.siasky.net" "helsinki.siasky.net" "siasky.dev"; +for server in "germany.siasky.net" "us-east.siasky.net" "us-west.siasky.net" "helsinki.siasky.net" "us-va-1.siasky.net" "us-pa-2.siasky.net"; do echo "⌁ Blacklisting on ${server}" - ssh -q -t user@${server} 'docker exec sia siac skynet blacklist add '$1'' + ssh -q -t user@${server} 'docker exec sia siac skynet blocklist add '$1'' ssh -q -t user@${server} 'rm -rf /home/user/skynet_webportal/docker/data/nginx/cache' # prune nginx cache done -echo "✓ All portals succesfully blacklisted provided skylink" +echo "✓ All portals succesfully blocklisted $1" diff --git a/setup-scripts/README.md b/setup-scripts/README.md index 0e06cc84..7d047421 100644 --- a/setup-scripts/README.md +++ b/setup-scripts/README.md @@ -23,7 +23,7 @@ You may want to fork this repository and replace ssh keys in - [funds-checker](funds-checker.py): script that checks wallet balance and sends status messages to discord periodically - [health-checker](health-checker.py): script that monitors health-check service for server health issues and reports them to discord periodically - [log-checker](log-checker.py): script that scans siad logs for critical errors and reports them to discord periodically -- [blacklist-skylink](../scripts/blacklist-skylink.sh): script that can be run locally from a machine that has access to all your skynet portal servers that blacklists provided skylink and prunes nginx cache to ensure it's not available any more (that is a bit much but that's the best we can do right now without paid nginx version) - if you want to use it, make sure to adjust the server addresses +- [blocklist-skylink](../scripts/blocklist-skylink.sh): script that can be run locally from a machine that has access to all your skynet portal servers that blocklists provided skylink and prunes nginx cache to ensure it's not available any more (that is a bit much but that's the best we can do right now without paid nginx version) - if you want to use it, make sure to adjust the server addresses ### Step 1: setting up server user