From 0209ae7f6057420b8c94d8e471f06f3cf03a3c6f Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Tue, 11 May 2021 11:08:27 +0200 Subject: [PATCH 1/5] new GET /skynet/metadata endpoint --- docker/nginx/conf.d/client.conf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docker/nginx/conf.d/client.conf b/docker/nginx/conf.d/client.conf index 470fb793..527b5ac3 100644 --- a/docker/nginx/conf.d/client.conf +++ b/docker/nginx/conf.d/client.conf @@ -399,6 +399,14 @@ server { proxy_pass http://siad; } + location /skynet/metadata { + limit_except GET { deny all; } + + include /etc/nginx/conf.d/include/cors; + + proxy_pass http://siad; + } + location ~ "^/(([a-zA-Z0-9-_]{46}|[a-z0-9]{55})(/.*)?)$" { include /etc/nginx/conf.d/include/cors; include /etc/nginx/conf.d/include/proxy-buffer; From e95dd0195d685a89daeecb5401d496ab9633027f Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Tue, 11 May 2021 11:12:44 +0200 Subject: [PATCH 2/5] Sia-UI --- docker/nginx/conf.d/client.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/nginx/conf.d/client.conf b/docker/nginx/conf.d/client.conf index 527b5ac3..7337b50b 100644 --- a/docker/nginx/conf.d/client.conf +++ b/docker/nginx/conf.d/client.conf @@ -401,9 +401,10 @@ server { location /skynet/metadata { limit_except GET { deny all; } - + include /etc/nginx/conf.d/include/cors; + proxy_set_header User-Agent: Sia-Agent; proxy_pass http://siad; } From 39d0bc593ba89877a9f503e4b088d3091c265a2f Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Tue, 11 May 2021 11:19:59 +0200 Subject: [PATCH 3/5] return method not allowed --- docker/nginx/conf.d/client.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/nginx/conf.d/client.conf b/docker/nginx/conf.d/client.conf index 7337b50b..6af30b6f 100644 --- a/docker/nginx/conf.d/client.conf +++ b/docker/nginx/conf.d/client.conf @@ -400,7 +400,7 @@ server { } location /skynet/metadata { - limit_except GET { deny all; } + limit_except GET PATCH { return 405; } include /etc/nginx/conf.d/include/cors; From cc23a1eed665a194b9e0cac638265a86889a5479 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Tue, 11 May 2021 11:24:18 +0200 Subject: [PATCH 4/5] return method not allowed --- docker/nginx/conf.d/client.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/nginx/conf.d/client.conf b/docker/nginx/conf.d/client.conf index 6af30b6f..d1664254 100644 --- a/docker/nginx/conf.d/client.conf +++ b/docker/nginx/conf.d/client.conf @@ -400,7 +400,7 @@ server { } location /skynet/metadata { - limit_except GET PATCH { return 405; } + limit_except GET PATCH { deny all; } include /etc/nginx/conf.d/include/cors; From dc47164e453da9c3b44560de90767255fbafd830 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Tue, 11 May 2021 11:26:19 +0200 Subject: [PATCH 5/5] dont block on nginx level --- docker/nginx/conf.d/client.conf | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker/nginx/conf.d/client.conf b/docker/nginx/conf.d/client.conf index d1664254..0a2c4f26 100644 --- a/docker/nginx/conf.d/client.conf +++ b/docker/nginx/conf.d/client.conf @@ -400,8 +400,6 @@ server { } location /skynet/metadata { - limit_except GET PATCH { deny all; } - include /etc/nginx/conf.d/include/cors; proxy_set_header User-Agent: Sia-Agent;