Merge remote-tracking branch 'origin/master' into accounts

This commit is contained in:
Karol Wypchlo 2021-01-25 13:34:11 +01:00
commit e961ed235d
6 changed files with 725 additions and 558 deletions

4
.gitignore vendored
View File

@ -55,10 +55,6 @@ typings/
.env* .env*
./docker/kratos/config/kratos.yml ./docker/kratos/config/kratos.yml
# gatsby files
.cache/
public
# Mac files # Mac files
.DS_Store .DS_Store

View File

@ -11,7 +11,12 @@ function audioExampleCheck(done) {
name: "Audio Example", name: "Audio Example",
skylink: "_A2zt5SKoqwnnZU4cBF8uBycSKULXMyeg1c5ZISBr2Q3dA", skylink: "_A2zt5SKoqwnnZU4cBF8uBycSKULXMyeg1c5ZISBr2Q3dA",
bodyHash: "be335f5ad9bc357248f3d35c7e49df491afb6b12", bodyHash: "be335f5ad9bc357248f3d35c7e49df491afb6b12",
metadata: { filename: "feel-good.mp3" }, headers: {
"skynet-skylink": "_A2zt5SKoqwnnZU4cBF8uBycSKULXMyeg1c5ZISBr2Q3dA",
"skynet-file-metadata": { filename: "feel-good.mp3" },
"content-disposition": 'inline; filename="feel-good.mp3"',
"content-type": "audio/mpeg",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -24,7 +29,9 @@ function covid19PaperCheck(done) {
name: "Covid-19 Paper", name: "Covid-19 Paper",
skylink: "PAMZVmfutxWoG6Wnl5BRKuWLkDNZR42k_okRRvksJekA3A", skylink: "PAMZVmfutxWoG6Wnl5BRKuWLkDNZR42k_okRRvksJekA3A",
bodyHash: "81b9fb74829a96ceafa429840d1ef0ce44376ddd", bodyHash: "81b9fb74829a96ceafa429840d1ef0ce44376ddd",
metadata: { headers: {
"skynet-skylink": "PAMZVmfutxWoG6Wnl5BRKuWLkDNZR42k_okRRvksJekA3A",
"skynet-file-metadata": {
filename: "An Effective Treatment for Coronavirus (COVID-19).pdf", filename: "An Effective Treatment for Coronavirus (COVID-19).pdf",
subfiles: { subfiles: {
"An Effective Treatment for Coronavirus (COVID-19).pdf": { "An Effective Treatment for Coronavirus (COVID-19).pdf": {
@ -34,6 +41,9 @@ function covid19PaperCheck(done) {
}, },
}, },
}, },
"content-disposition": 'inline; filename="An Effective Treatment for Coronavirus (COVID-19).pdf"',
"content-type": "application/pdf",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -46,7 +56,12 @@ function covid19CoroNopePaperCheck(done) {
name: "Covid-19 CoroNope Paper", name: "Covid-19 CoroNope Paper",
skylink: "bACLKGmcmX4NCp47WwOOJf0lU666VLeT5HRWpWVtqZPjEA", skylink: "bACLKGmcmX4NCp47WwOOJf0lU666VLeT5HRWpWVtqZPjEA",
bodyHash: "901f6fd65ef595f70b6bfebbb2d05942351ef2b3", bodyHash: "901f6fd65ef595f70b6bfebbb2d05942351ef2b3",
metadata: { filename: "coronope.pdf" }, headers: {
"skynet-skylink": "bACLKGmcmX4NCp47WwOOJf0lU666VLeT5HRWpWVtqZPjEA",
"skynet-file-metadata": { filename: "coronope.pdf" },
"content-disposition": 'inline; filename="coronope.pdf"',
"content-type": "application/pdf",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -59,7 +74,9 @@ function dappExampleCheck(done) {
name: "Dapp Example (UniSwap)", name: "Dapp Example (UniSwap)",
skylink: "EADWpKD0myqH2tZa6xtKebg6kNnwYnI94fl4R8UKgNrmOA", skylink: "EADWpKD0myqH2tZa6xtKebg6kNnwYnI94fl4R8UKgNrmOA",
bodyHash: "d6ad2506590bb45b5acc6a8a964a3da4d657354f", bodyHash: "d6ad2506590bb45b5acc6a8a964a3da4d657354f",
metadata: { headers: {
"skynet-skylink": "EADWpKD0myqH2tZa6xtKebg6kNnwYnI94fl4R8UKgNrmOA",
"skynet-file-metadata": {
filename: "build", filename: "build",
length: 15578459, length: 15578459,
subfiles: { subfiles: {
@ -532,6 +549,9 @@ function dappExampleCheck(done) {
}, },
}, },
}, },
"content-disposition": 'inline; filename="build"',
"content-type": "text/html",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -547,7 +567,12 @@ function developMomentumCheck(done) {
name: "Develop Momentum Index File", name: "Develop Momentum Index File",
skylink: "EAA1fG_ip4C1Vi1Ijvsr1oyr8jpH0Bo9HXya0T3kw-elGw/", skylink: "EAA1fG_ip4C1Vi1Ijvsr1oyr8jpH0Bo9HXya0T3kw-elGw/",
bodyHash: developMomentumBodyHash, bodyHash: developMomentumBodyHash,
metadata: developMomentumMetadata, headers: {
"skynet-skylink": "EAA1fG_ip4C1Vi1Ijvsr1oyr8jpH0Bo9HXya0T3kw-elGw",
"skynet-file-metadata": developMomentumMetadata,
"content-disposition": 'inline; filename="output"',
"content-type": "text/html",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -560,7 +585,12 @@ function developMomentumRedirectCheck(done) {
name: "Develop Momentum Index File", name: "Develop Momentum Index File",
skylink: "EAA1fG_ip4C1Vi1Ijvsr1oyr8jpH0Bo9HXya0T3kw-elGw", skylink: "EAA1fG_ip4C1Vi1Ijvsr1oyr8jpH0Bo9HXya0T3kw-elGw",
bodyHash: developMomentumBodyHash, bodyHash: developMomentumBodyHash,
metadata: developMomentumMetadata, headers: {
"skynet-skylink": "EAA1fG_ip4C1Vi1Ijvsr1oyr8jpH0Bo9HXya0T3kw-elGw",
"skynet-file-metadata": developMomentumMetadata,
"content-disposition": 'inline; filename="output"',
"content-type": "text/html",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -573,11 +603,16 @@ function developMomentumIndexFileCheck(done) {
name: "Develop Momentum Index File", name: "Develop Momentum Index File",
skylink: "EAA1fG_ip4C1Vi1Ijvsr1oyr8jpH0Bo9HXya0T3kw-elGw/index.html", skylink: "EAA1fG_ip4C1Vi1Ijvsr1oyr8jpH0Bo9HXya0T3kw-elGw/index.html",
bodyHash: developMomentumBodyHash, bodyHash: developMomentumBodyHash,
metadata: { headers: {
"skynet-skylink": "EAA1fG_ip4C1Vi1Ijvsr1oyr8jpH0Bo9HXya0T3kw-elGw",
"skynet-file-metadata": {
filename: "/index.html", filename: "/index.html",
length: 4981, length: 4981,
subfiles: { "index.html": { filename: "index.html", contenttype: "text/html", len: 4981 } }, subfiles: { "index.html": { filename: "index.html", contenttype: "text/html", len: 4981 } },
}, },
"content-disposition": 'inline; filename="index.html"',
"content-type": "text/html; charset=utf-8",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -590,7 +625,12 @@ function htmlExampleCheck(done) {
name: "HTML Example", name: "HTML Example",
skylink: "PAL0w4SdA5rFCDGEutgpeQ50Om-YkBabtXVOJAkmedslKw", skylink: "PAL0w4SdA5rFCDGEutgpeQ50Om-YkBabtXVOJAkmedslKw",
bodyHash: "c932fd56f98b6db589e56be8018817f13bb29f72", bodyHash: "c932fd56f98b6db589e56be8018817f13bb29f72",
metadata: { filename: "introduction – Sia API Documentation.html" }, headers: {
"skynet-skylink": "PAL0w4SdA5rFCDGEutgpeQ50Om-YkBabtXVOJAkmedslKw",
"skynet-file-metadata": { filename: "introduction â\x80\x93 Sia API Documentation.html" },
"content-disposition": 'inline; filename="introduction â\x80\x93 Sia API Documentation.html"',
"content-type": "text/html; charset=utf-8",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -603,7 +643,12 @@ function imageExampleCheck(done) {
name: "Image Example", name: "Image Example",
skylink: "IADUs8d9CQjUO34LmdaaNPK_STuZo24rpKVfYW3wPPM2uQ", skylink: "IADUs8d9CQjUO34LmdaaNPK_STuZo24rpKVfYW3wPPM2uQ",
bodyHash: "313207978d0a88bf2b961f098804e9ab0f82837f", bodyHash: "313207978d0a88bf2b961f098804e9ab0f82837f",
metadata: { filename: "sia-lm.png" }, headers: {
"skynet-skylink": "IADUs8d9CQjUO34LmdaaNPK_STuZo24rpKVfYW3wPPM2uQ",
"skynet-file-metadata": { filename: "sia-lm.png" },
"content-disposition": 'inline; filename="sia-lm.png"',
"content-type": "image/png",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -616,7 +661,12 @@ function jsonExampleCheck(done) {
name: "JSON Example", name: "JSON Example",
skylink: "AAC0uO43g64ULpyrW0zO3bjEknSFbAhm8c-RFP21EQlmSQ", skylink: "AAC0uO43g64ULpyrW0zO3bjEknSFbAhm8c-RFP21EQlmSQ",
bodyHash: "198771c3d07d5c7302aadcc0697a7298e5e8ccc3", bodyHash: "198771c3d07d5c7302aadcc0697a7298e5e8ccc3",
metadata: { filename: "consensus.json" }, headers: {
"skynet-skylink": "AAC0uO43g64ULpyrW0zO3bjEknSFbAhm8c-RFP21EQlmSQ",
"skynet-file-metadata": { filename: "consensus.json" },
"content-disposition": 'inline; filename="consensus.json"',
"content-type": "application/json",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -629,7 +679,12 @@ function pdfExampleCheck(done) {
name: "PDF Example", name: "PDF Example",
skylink: "XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg", skylink: "XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg",
bodyHash: "9bd8162e1575569a9041972f7f62d65887063dc3", bodyHash: "9bd8162e1575569a9041972f7f62d65887063dc3",
metadata: { filename: "sia.pdf" }, headers: {
"skynet-skylink": "XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg",
"skynet-file-metadata": { filename: "sia.pdf" },
"content-disposition": 'inline; filename="sia.pdf"',
"content-type": "application/pdf",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -642,11 +697,16 @@ function randomImageCheck(done) {
name: "Random Image", name: "Random Image",
skylink: "PAHx7JmsU9EFGbqm5q0LNKT2wKfoJ_mhPI8zWlNEXZ8uOQ/", skylink: "PAHx7JmsU9EFGbqm5q0LNKT2wKfoJ_mhPI8zWlNEXZ8uOQ/",
bodyHash: "4c73c5a0eddd5823be677d7f93bf80cc9338ee9f", bodyHash: "4c73c5a0eddd5823be677d7f93bf80cc9338ee9f",
metadata: { headers: {
"skynet-skylink": "PAHx7JmsU9EFGbqm5q0LNKT2wKfoJ_mhPI8zWlNEXZ8uOQ",
"skynet-file-metadata": {
filename: "30355444.png", filename: "30355444.png",
subfiles: { "30355444.png": { filename: "30355444.png", contenttype: "image/png", len: 350473 } }, subfiles: { "30355444.png": { filename: "30355444.png", contenttype: "image/png", len: 350473 } },
defaultpath: "/30355444.png", defaultpath: "/30355444.png",
}, },
"content-disposition": 'inline; filename="30355444.png"',
"content-type": "image/png",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -659,11 +719,16 @@ function randomImageRedirectCheck(done) {
name: "Random Image Redirect", name: "Random Image Redirect",
skylink: "PAHx7JmsU9EFGbqm5q0LNKT2wKfoJ_mhPI8zWlNEXZ8uOQ", skylink: "PAHx7JmsU9EFGbqm5q0LNKT2wKfoJ_mhPI8zWlNEXZ8uOQ",
bodyHash: "4c73c5a0eddd5823be677d7f93bf80cc9338ee9f", bodyHash: "4c73c5a0eddd5823be677d7f93bf80cc9338ee9f",
metadata: { headers: {
"skynet-skylink": "PAHx7JmsU9EFGbqm5q0LNKT2wKfoJ_mhPI8zWlNEXZ8uOQ",
"skynet-file-metadata": {
filename: "30355444.png", filename: "30355444.png",
subfiles: { "30355444.png": { filename: "30355444.png", contenttype: "image/png", len: 350473 } }, subfiles: { "30355444.png": { filename: "30355444.png", contenttype: "image/png", len: 350473 } },
defaultpath: "/30355444.png", defaultpath: "/30355444.png",
}, },
"content-disposition": 'inline; filename="30355444.png"',
"content-type": "image/png",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -675,10 +740,15 @@ function skyBayCheck(done) {
name: "SkyBay", name: "SkyBay",
skylink: "EABkMjXzxJRpPz0eO0Or5fy2eo-rz3prdigGwRlyNd9mwA/", skylink: "EABkMjXzxJRpPz0eO0Or5fy2eo-rz3prdigGwRlyNd9mwA/",
bodyHash: "25d63937c9734fb08d2749c6517d1b3de8ecb856", bodyHash: "25d63937c9734fb08d2749c6517d1b3de8ecb856",
metadata: { headers: {
"skynet-skylink": "EABkMjXzxJRpPz0eO0Or5fy2eo-rz3prdigGwRlyNd9mwA",
"skynet-file-metadata": {
filename: "skybay.html", filename: "skybay.html",
subfiles: { "skybay.html": { filename: "skybay.html", contenttype: "text/html", len: 11655 } }, subfiles: { "skybay.html": { filename: "skybay.html", contenttype: "text/html", len: 11655 } },
}, },
"content-disposition": 'inline; filename="skybay.html"',
"content-type": "text/html",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -691,10 +761,15 @@ function skyBayRedirectCheck(done) {
name: "SkyBay Redirect", name: "SkyBay Redirect",
skylink: "EABkMjXzxJRpPz0eO0Or5fy2eo-rz3prdigGwRlyNd9mwA", skylink: "EABkMjXzxJRpPz0eO0Or5fy2eo-rz3prdigGwRlyNd9mwA",
bodyHash: "25d63937c9734fb08d2749c6517d1b3de8ecb856", bodyHash: "25d63937c9734fb08d2749c6517d1b3de8ecb856",
metadata: { headers: {
"skynet-skylink": "EABkMjXzxJRpPz0eO0Or5fy2eo-rz3prdigGwRlyNd9mwA",
"skynet-file-metadata": {
filename: "skybay.html", filename: "skybay.html",
subfiles: { "skybay.html": { filename: "skybay.html", contenttype: "text/html", len: 11655 } }, subfiles: { "skybay.html": { filename: "skybay.html", contenttype: "text/html", len: 11655 } },
}, },
"content-disposition": 'inline; filename="skybay.html"',
"content-type": "text/html",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -706,7 +781,12 @@ function skyBinCheck(done) {
name: "SkyBin", name: "SkyBin",
skylink: "CAAVU14pB9GRIqCrejD7rlS27HltGGiiCLICzmrBV0wVtA/", skylink: "CAAVU14pB9GRIqCrejD7rlS27HltGGiiCLICzmrBV0wVtA/",
bodyHash: "767ec67c417e11b97c5db7dad9ea3b6b27cb0d39", bodyHash: "767ec67c417e11b97c5db7dad9ea3b6b27cb0d39",
metadata: { filename: "skybin.html" }, headers: {
"skynet-skylink": "CAAVU14pB9GRIqCrejD7rlS27HltGGiiCLICzmrBV0wVtA",
"skynet-file-metadata": { filename: "skybin.html" },
"content-disposition": 'inline; filename="skybin.html"',
"content-type": "text/html; charset=utf-8",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -719,7 +799,12 @@ function skyBinRedirectCheck(done) {
name: "SkyBin Redirect", name: "SkyBin Redirect",
skylink: "CAAVU14pB9GRIqCrejD7rlS27HltGGiiCLICzmrBV0wVtA", skylink: "CAAVU14pB9GRIqCrejD7rlS27HltGGiiCLICzmrBV0wVtA",
bodyHash: "767ec67c417e11b97c5db7dad9ea3b6b27cb0d39", bodyHash: "767ec67c417e11b97c5db7dad9ea3b6b27cb0d39",
metadata: { filename: "skybin.html" }, headers: {
"skynet-skylink": "CAAVU14pB9GRIqCrejD7rlS27HltGGiiCLICzmrBV0wVtA",
"skynet-file-metadata": { filename: "skybin.html" },
"content-disposition": 'inline; filename="skybin.html"',
"content-type": "text/html; charset=utf-8",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -734,7 +819,12 @@ function skyGalleryCheck(done) {
name: "SkyGallery", name: "SkyGallery",
skylink: "AADW6GsQcetwDBaDYnGCSTbYjSKY743NtY1A5VRx5sj3Dg/", skylink: "AADW6GsQcetwDBaDYnGCSTbYjSKY743NtY1A5VRx5sj3Dg/",
bodyHash: skyGalleryBodyHash, bodyHash: skyGalleryBodyHash,
metadata: skyGalleryMetadata, headers: {
"skynet-skylink": "AADW6GsQcetwDBaDYnGCSTbYjSKY743NtY1A5VRx5sj3Dg",
"skynet-file-metadata": skyGalleryMetadata,
"content-disposition": 'inline; filename="skygallery-v0.1.1-76c4c115fcb526716b2564568850f433"',
"content-type": "text/html",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -747,11 +837,16 @@ function skyGalleryIndexFileCheck(done) {
name: "SkyGallery Index File", name: "SkyGallery Index File",
skylink: "AADW6GsQcetwDBaDYnGCSTbYjSKY743NtY1A5VRx5sj3Dg/index.html", skylink: "AADW6GsQcetwDBaDYnGCSTbYjSKY743NtY1A5VRx5sj3Dg/index.html",
bodyHash: skyGalleryBodyHash, bodyHash: skyGalleryBodyHash,
metadata: { headers: {
"skynet-skylink": "AADW6GsQcetwDBaDYnGCSTbYjSKY743NtY1A5VRx5sj3Dg",
"skynet-file-metadata": {
filename: "/index.html", filename: "/index.html",
length: 2534, length: 2534,
subfiles: { "index.html": { filename: "index.html", contenttype: "text/html", len: 2534 } }, subfiles: { "index.html": { filename: "index.html", contenttype: "text/html", len: 2534 } },
}, },
"content-disposition": 'inline; filename="index.html"',
"content-type": "text/html; charset=utf-8",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -764,7 +859,12 @@ function skyGalleryRedirectCheck(done) {
name: "SkyGallery Redirect", name: "SkyGallery Redirect",
skylink: "AADW6GsQcetwDBaDYnGCSTbYjSKY743NtY1A5VRx5sj3Dg", skylink: "AADW6GsQcetwDBaDYnGCSTbYjSKY743NtY1A5VRx5sj3Dg",
bodyHash: skyGalleryBodyHash, bodyHash: skyGalleryBodyHash,
metadata: skyGalleryMetadata, headers: {
"skynet-skylink": "AADW6GsQcetwDBaDYnGCSTbYjSKY743NtY1A5VRx5sj3Dg",
"skynet-file-metadata": skyGalleryMetadata,
"content-disposition": 'inline; filename="skygallery-v0.1.1-76c4c115fcb526716b2564568850f433"',
"content-type": "text/html",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
@ -777,7 +877,9 @@ function uncensoredLibraryCheck(done) {
name: "Uncensored Library", name: "Uncensored Library",
skylink: "AAC5glnZyNJ4Ieb4MhnYJGtID6qdMqEjl0or5EvEMt7bWQ", skylink: "AAC5glnZyNJ4Ieb4MhnYJGtID6qdMqEjl0or5EvEMt7bWQ",
bodyHash: "60da6cb958699c5acd7f2a2911656ff32fca89a7", bodyHash: "60da6cb958699c5acd7f2a2911656ff32fca89a7",
metadata: { headers: {
"skynet-skylink": undefined,
"skynet-file-metadata": {
filename: "Unzip_The_Uncensored_Library_Map.zip", filename: "Unzip_The_Uncensored_Library_Map.zip",
subfiles: { subfiles: {
"Unzip_The_Uncensored_Library_Map.zip": { "Unzip_The_Uncensored_Library_Map.zip": {
@ -787,11 +889,27 @@ function uncensoredLibraryCheck(done) {
}, },
}, },
}, },
"content-disposition": 'attachment; filename="Unzip_The_Uncensored_Library_Map.zip"',
"content-type": "application/octet-stream",
},
}; };
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
} }
function bitcoinWhitepaper(done) {
skylinkVerification(done, {
name: "Bitcoin Whitepaper",
skylink: "3ACpC9Umme41zlWUgMQh1fw0sNwgWwyfDDhRQ9Sppz9hjQ",
bodyHash: "5d1fd2c37c1a3409cfc41861f4206472559670f3",
headers: {
"skynet-skylink": "3ACpC9Umme41zlWUgMQh1fw0sNwgWwyfDDhRQ9Sppz9hjQ",
"content-disposition": 'inline; filename="bitcoin.pdf"',
"content-type": "application/pdf",
},
});
}
const uniswapBodyHash = "3965f9a7def085b3a764ddc76a528eda38d72359"; const uniswapBodyHash = "3965f9a7def085b3a764ddc76a528eda38d72359";
const uniswapMetadata = require("../fixtures/uniswapMetadata.json"); const uniswapMetadata = require("../fixtures/uniswapMetadata.json");
@ -889,8 +1007,33 @@ function uniswapHNSResolverRedirectCheck(done) {
skylinkVerification(done, linkInfo); skylinkVerification(done, linkInfo);
} }
// check whether content disposition is set correctly for downloads
function fileEndpointCheck(done) {
const linkInfo = {
name: "File endpoint check",
skylink: "file/XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg",
bodyHash: "9bd8162e1575569a9041972f7f62d65887063dc3",
headers: {
"skynet-skylink": "XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg",
"skynet-file-metadata": { filename: "sia.pdf" },
"content-disposition": 'attachment; filename="sia.pdf"',
"content-type": "application/pdf",
},
};
skylinkVerification(done, linkInfo);
}
function parseHeaderString(header) {
try {
return JSON.parse(header);
} catch {
return header;
}
}
// skylinkVerification verifies a skylink against provided information. // skylinkVerification verifies a skylink against provided information.
function skylinkVerification(done, { name, skylink, bodyHash, metadata }) { function skylinkVerification(done, { name, skylink, bodyHash, headers }) {
const time = process.hrtime(); const time = process.hrtime();
// Create the query for the skylink // Create the query for the skylink
@ -912,13 +1055,20 @@ function skylinkVerification(done, { name, skylink, bodyHash, metadata }) {
info.bodyHash = { expected: bodyHash, current: currentBodyHash }; info.bodyHash = { expected: bodyHash, current: currentBodyHash };
} }
// Check if the metadata is valid by deep comparing expected value with response if (headers) {
const metadataHeader = response.header["skynet-file-metadata"]; Object.entries(headers).forEach(([headerName, expectedHeader]) => {
const currentMetadata = metadataHeader && JSON.parse(metadataHeader); const currentHeader = parseHeaderString(response.header[headerName]);
if (!isEqual(currentMetadata, metadata)) { if (!isEqual(currentHeader, expectedHeader)) {
entry.up = false; entry.up = false;
info.metadata = ensureValidJSON(detailedDiff(metadata, currentMetadata)); info.headers = info.headers ?? {};
if (typeof currentHeader === "object") {
info.headers[headerName] = ensureValidJSON(detailedDiff(expectedHeader, currentHeader));
} else {
info.headers[headerName] = currentHeader;
}
}
});
} }
if (Object.keys(info).length) entry.info = info; // add info only if it exists if (Object.keys(info).length) entry.info = info; // add info only if it exists
@ -959,11 +1109,13 @@ module.exports.verboseChecks = [
skyGalleryIndexFileCheck, skyGalleryIndexFileCheck,
skyGalleryRedirectCheck, skyGalleryRedirectCheck,
uncensoredLibraryCheck, uncensoredLibraryCheck,
fileEndpointCheck,
bitcoinWhitepaper,
// uniswapIndexFileCheck, // uniswapIndexFileCheck,
// uniswapCheck, // uniswapCheck,
// uniswapRedirectCheck, // uniswapRedirectCheck,
// uniswapHNSCheck, // uniswapHNSCheck,
// uniswapHNSRedirectCheck, // uniswapHNSRedirectCheck,
// uniswapHNSResolverCheck, uniswapHNSResolverCheck,
// uniswapHNSResolverRedirectCheck, uniswapHNSResolverRedirectCheck,
]; ];

3
packages/webapp/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# gatsby files
.cache/
public

View File

@ -4,48 +4,48 @@
"version": "1.0.0", "version": "1.0.0",
"author": "Nebulous", "author": "Nebulous",
"dependencies": { "dependencies": {
"axios": "0.21.0", "axios": "0.21.1",
"bytes": "3.1.0", "bytes": "3.1.0",
"classnames": "2.2.6", "classnames": "2.2.6",
"fontsource-metropolis": "3.0.1", "fontsource-metropolis": "4.0.0",
"gatsby": "2.24.92", "gatsby": "2.31.1",
"gatsby-image": "2.5.0", "gatsby-image": "2.10.0",
"gatsby-plugin-manifest": "2.4.35", "gatsby-plugin-manifest": "2.11.0",
"gatsby-plugin-matomo": "0.8.3", "gatsby-plugin-matomo": "0.8.3",
"gatsby-plugin-react-helmet": "3.3.14", "gatsby-plugin-react-helmet": "3.9.0",
"gatsby-plugin-remove-serviceworker": "1.0.0", "gatsby-plugin-remove-serviceworker": "1.0.0",
"gatsby-plugin-robots-txt": "1.5.3", "gatsby-plugin-robots-txt": "1.5.5",
"gatsby-plugin-sass": "2.5.1", "gatsby-plugin-sass": "3.1.0",
"gatsby-plugin-sharp": "2.8.0", "gatsby-plugin-sharp": "2.13.1",
"gatsby-source-filesystem": "2.4.0", "gatsby-source-filesystem": "2.10.0",
"gatsby-transformer-sharp": "2.5.21", "gatsby-transformer-sharp": "2.11.0",
"http-status-codes": "2.1.4", "http-status-codes": "2.1.4",
"js-cookie": "^2.2.1", "js-cookie": "^2.2.1",
"jsonp": "0.2.1", "jsonp": "0.2.1",
"node-sass": "4.14.1", "node-sass": "5.0.0",
"path-browserify": "1.0.1", "path-browserify": "1.0.1",
"prop-types": "15.7.2", "prop-types": "15.7.2",
"react": "16.14.0", "react": "17.0.1",
"react-countup": "4.3.3", "react-countup": "4.3.3",
"react-dom": "16.14.0", "react-dom": "17.0.1",
"react-dropzone": "11.2.0", "react-dropzone": "11.2.4",
"react-helmet": "6.1.0", "react-helmet": "6.1.0",
"react-mailchimp-form": "1.0.2", "react-mailchimp-form": "1.0.2",
"react-mailchimp-subscribe": "2.1.0", "react-mailchimp-subscribe": "2.1.0",
"react-syntax-highlighter": "15.2.1", "react-syntax-highlighter": "15.4.3",
"react-visibility-sensor": "5.1.1", "react-visibility-sensor": "5.1.1",
"skynet-js": "2.4.0" "skynet-js": "2.4.0"
}, },
"devDependencies": { "devDependencies": {
"cypress": "5.5.0", "cypress": "6.3.0",
"cypress-file-upload": "4.1.1", "cypress-file-upload": "5.0.2",
"eslint": "7.13.0", "eslint": "7.18.0",
"eslint-config-prettier": "6.15.0", "eslint-config-prettier": "7.2.0",
"eslint-plugin-cypress": "2.11.2", "eslint-plugin-cypress": "2.11.2",
"eslint-plugin-react": "7.21.5", "eslint-plugin-react": "7.22.0",
"husky": "4.3.0", "husky": "4.3.8",
"lint-staged": "10.5.1", "lint-staged": "10.5.3",
"prettier": "2.1.2" "prettier": "2.2.1"
}, },
"keywords": [ "keywords": [
"sia", "sia",

16
scripts/maintenance-upgrade.sh Executable file
View File

@ -0,0 +1,16 @@
#! /usr/bin/env bash
###############################################################
# this script is an automation for restarting docker containers
# on maintenance nodes strictly built for purpose of siasky.net
###############################################################
set -e # exit on first error
docker build --no-cache --quiet --build-arg branch=master -t sia-master /home/user/sia-dockerfile
for container in `docker container ls --format '{{.Names}}'`; do
docker stop $container
docker rm $container
docker run -d -v /home/user/nodes/$container/sia-data:/sia-data --env-file /home/user/nodes/$container/.env --name $container --log-opt max-size=100m --log-opt max-file=3 sia-master
done

View File

@ -7925,9 +7925,9 @@ inherits@2.0.3:
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: ini@^1.3.4, ini@^1.3.5, ini@~1.3.0:
version "1.3.5" version "1.3.8"
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c"
integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==
inline-style-parser@0.1.1: inline-style-parser@0.1.1:
version "0.1.1" version "0.1.1"