From 16fe7acad09e5a4dec67eb42f6880b07f21f4024 Mon Sep 17 00:00:00 2001 From: Marcin Jachymiak Date: Wed, 18 Mar 2020 16:35:48 -0400 Subject: [PATCH 1/2] Set siamux port to avoid conflicts --- setup-scripts/siad-upload.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-scripts/siad-upload.service b/setup-scripts/siad-upload.service index c6fe6a88..4516a3ad 100644 --- a/setup-scripts/siad-upload.service +++ b/setup-scripts/siad-upload.service @@ -5,7 +5,7 @@ Description=siad-upload Type=simple WorkingDirectory=/home/user/siad-upload EnvironmentFile=/home/user/.sia/sia-upload.env -ExecStart=/home/user/go/bin/siad --api-addr "localhost:9970" --rpc-addr ":9971" --host-addr ":9972" +ExecStart=/home/user/go/bin/siad --api-addr "localhost:9970" --rpc-addr ":9971" --host-addr ":9972" --siamux-addr ":9973" ExecStop=/home/user/go/bin/siac --addr "localhost:9970" stop Restart=on-failure SyslogIdentifier=siad-upload From f7bb6f14931aedec940caeee618b7603d7ba6cb2 Mon Sep 17 00:00:00 2001 From: Marcin Jachymiak Date: Wed, 18 Mar 2020 16:36:30 -0400 Subject: [PATCH 2/2] Add stats endpoints to nginx --- setup-scripts/skynet-nginx.conf | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/setup-scripts/skynet-nginx.conf b/setup-scripts/skynet-nginx.conf index 3cb280d3..67ad55d0 100644 --- a/setup-scripts/skynet-nginx.conf +++ b/setup-scripts/skynet-nginx.conf @@ -21,6 +21,28 @@ server { root /home/user/skynet-webportal/public; # path to root of index.html } + location /stats { + proxy_set_header Access-Control-Allow-Origin: *; + proxy_set_header User-Agent: Sia-Agent; + + # replace BASE64_AUTHENTICATION with base64 encoded : + # for sia user is empty so it's just : + # to generate the passcode use https://www.base64encode.org or any other base64 encoder + proxy_set_header Authorization "Basic BASE64_AUTHENTICATION"; + proxy_pass http://127.0.0.1:9970/skynet/stats; + } + + location /statsdown { + proxy_set_header Access-Control-Allow-Origin: *; + proxy_set_header User-Agent: Sia-Agent; + + # replace BASE64_AUTHENTICATION with base64 encoded : + # for sia user is empty so it's just : + # to generate the passcode use https://www.base64encode.org or any other base64 encoder + proxy_set_header Authorization "Basic BASE64_AUTHENTICATION"; + proxy_pass http://127.0.0.1:9980/skynet/stats; + } + location /skynet/skyfile/ { client_max_body_size 1000M; # make sure to limit the size of upload to a sane value proxy_read_timeout 600; @@ -73,4 +95,4 @@ server { } # SLL CERTIFICATES BELOW THIS LINE -} \ No newline at end of file +}