use skynet to load our homepage

This commit is contained in:
Karol Wypchlo 2021-10-18 15:25:59 +01:00
parent f78bc22b5b
commit ffb1e499b9
No known key found for this signature in database
GPG Key ID: C92C016317A964D0
2 changed files with 18 additions and 0 deletions

View File

@ -26,6 +26,16 @@ rewrite ^/skynet/blacklist /skynet/blocklist permanent;
location / { location / {
include /etc/nginx/conf.d/include/cors; include /etc/nginx/conf.d/include/cors;
set $skylink "0404dsjvti046fsua4ktor9grrpe76erq9jot9cvopbhsvsu76r4r30";
set $path $uri;
include /etc/nginx/conf.d/include/location-skylink;
proxy_intercept_errors on;
error_page 400 404 490 500 502 503 504 =200 @fallback;
}
location @fallback {
proxy_pass http://website:9000; proxy_pass http://website:9000;
} }

View File

@ -58,6 +58,13 @@ async function handshakeSubdomainCheck(done) {
return done(await genericAccessCheck("hns_via_subdomain", url)); return done(await genericAccessCheck("hns_via_subdomain", url));
} }
// websiteSkylinkCheck returns the result of accessing siasky.net website through skylink
async function websiteSkylinkCheck(done) {
const websiteSkylink = "0404dsjvti046fsua4ktor9grrpe76erq9jot9cvopbhsvsu76r4r30";
return done(await genericAccessCheck("website_skylink", websiteSkylink));
}
// accountWebsiteCheck returns the result of accessing account dashboard website // accountWebsiteCheck returns the result of accessing account dashboard website
async function accountWebsiteCheck(done) { async function accountWebsiteCheck(done) {
const url = `${process.env.SKYNET_DASHBOARD_URL}/auth/login`; const url = `${process.env.SKYNET_DASHBOARD_URL}/auth/login`;
@ -159,6 +166,7 @@ async function genericAccessCheck(name, url) {
const checks = [ const checks = [
uploadCheck, uploadCheck,
websiteCheck, websiteCheck,
websiteSkylinkCheck,
downloadCheck, downloadCheck,
skylinkSubdomainCheck, skylinkSubdomainCheck,
handshakeSubdomainCheck, handshakeSubdomainCheck,