Merge branch 'master' into sevey/corpus-test

This commit is contained in:
Matthew Sevey 2021-11-24 15:06:18 -05:00
commit 2101617b16
No known key found for this signature in database
GPG Key ID: 9ADDD344F13057F6
68 changed files with 1283 additions and 901 deletions

View File

@ -40,7 +40,7 @@ jobs:
wait-on: "http://127.0.0.1:9000" wait-on: "http://127.0.0.1:9000"
- name: "Deploy to Skynet" - name: "Deploy to Skynet"
uses: kwypchlo/deploy-to-skynet-action@main uses: skynetlabs/deploy-to-skynet-action@v2
with: with:
upload-dir: packages/website/public upload-dir: packages/website/public
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -0,0 +1,32 @@
# Install and run unit tests with busted
# Docs: http://olivinelabs.com/busted/
name: Nginx Lua Unit Tests
on:
pull_request:
paths:
- "docker/nginx/libs/**.lua"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.x"
architecture: "x64"
- name: Install Dependencies
run: |
pip install hererocks
hererocks env --lua=5.1 -rlatest
source env/bin/activate
luarocks install busted
- name: Unit Tests
run: |
source env/bin/activate
busted --verbose --pattern=spec --directory=docker/nginx/libs .

View File

@ -10,6 +10,28 @@ Version History
Latest: Latest:
## Oct 18, 2021:
### v0.1.3
**Key Updates**
- Change skyd 307 redirect code to 308
- Set caddy dns entry ttl limit to 15 minutes to remove stranded entries.
- Set skyd up to connect to the local mongodb cluster for storing TUS metadata
- Update health check disable command to require reason.
- Move MongoDB to a separate service (use `PORTAL_MODULES=m` to use it without accounts)
- Add proper handling for options response on /skynet/tus endpoint
- added unpinning skylinks from account dashboard
**Bugs Fixed**
- include tus header upload-concat in cors requests
- fixed issue with caddy requesting new certificates instead of using existing ones from file storage
- fixed the latest news link redirect in the news header
- Fix extended checks error by rounding the reported datetime.
**Other**
- Remove outdated references to NebulousLabs
## August 9th, 2021: ## August 9th, 2021:
### v0.1.1 ### v0.1.1
Monthly release Monthly release

View File

@ -1,3 +1,23 @@
## Oct 18, 2021:
### v0.1.3
**Key Updates**
- Change skyd 307 redirect code to 308
- Set caddy dns entry ttl limit to 15 minutes to remove stranded entries.
- Set skyd up to connect to the local mongodb cluster for storing TUS metadata
- Update health check disable command to require reason.
- Move MongoDB to a separate service (use `PORTAL_MODULES=m` to use it without accounts)
- Add proper handling for options response on /skynet/tus endpoint
- added unpinning skylinks from account dashboard
**Bugs Fixed**
- include tus header upload-concat in cors requests
- fixed issue with caddy requesting new certificates instead of using existing ones from file storage
- fixed the latest news link redirect in the news header
- Fix extended checks error by rounding the reported datetime.
**Other**
- Remove outdated references to NebulousLabs
## August 9th, 2021: ## August 9th, 2021:

View File

@ -0,0 +1 @@
- Add missing servers and blocklist command to the manual blocklist script.

View File

@ -1 +0,0 @@
- include tus header upload-concat in cors requests

View File

@ -0,0 +1,2 @@
- Fix `blocklist-skylink.sh` script that didn't removed blocked skylink from
nginx cache.

View File

@ -1 +0,0 @@
- fixed issue with caddy requesting new certificates instead of using existing ones from file storage

View File

@ -1 +0,0 @@
- fixed the latest news link redirect in the news header

View File

@ -1 +0,0 @@
- Fix extended checks error by rounding the reported datetime.

View File

@ -0,0 +1,2 @@
- fixed uploaded directory name (was "undefined" before)
- fixed empty directory upload progress (size was not calculated for directories)

View File

@ -0,0 +1 @@
- expose generic skylink serving endpoint on domain aliases

View File

@ -1 +0,0 @@
- Change skyd 307 redirect code to 308

View File

@ -1 +0,0 @@
- Set caddy dns entry ttl limit to 15 minutes to remove stranded entries.

View File

@ -1 +0,0 @@
- Update health check disable command to require reason.

View File

@ -1 +0,0 @@
- Add proper handling for options response on /skynet/tus endpoint

View File

@ -1 +0,0 @@
- added unpinning skylinks from account dashboard

View File

@ -0,0 +1 @@
- add new critical health check that scans config and makes sure that all relevant configurations are set

View File

@ -0,0 +1,2 @@
- Remove hardcoded Airtable default values from blocklist script. Portal
operators need to define their own values in portal common config (LastPass).

View File

@ -0,0 +1 @@
- Drop `Skynet-Requested-Skylink` header

View File

@ -0,0 +1 @@
- Enable the accounting module for skyd

View File

@ -0,0 +1,2 @@
- Parameterize MongoDB replicaset in `docker-compose.mongodb.yml` via
`SKYNET_DB_REPLICASET` from `.env` file.

View File

@ -0,0 +1,2 @@
- Remove hardcoded server list from `blocklist-skylink.sh` so it removes server
list duplication and can also be called from Ansible.

View File

@ -1 +0,0 @@
- Remove outdated references to NebulousLabs

View File

@ -0,0 +1 @@
- Add trimming Airtable skylinks from Takedown Request table.

View File

@ -0,0 +1 @@
- Update handshake to use v3.0.1

7
dc
View File

@ -10,13 +10,18 @@ COMPOSE_FILES="-f docker-compose.yml"
for i in $(seq 1 ${#PORTAL_MODULES}); do for i in $(seq 1 ${#PORTAL_MODULES}); do
# accounts module - alias "a" # accounts module - alias "a"
if [[ ${PORTAL_MODULES:i-1:1} == "a" ]]; then if [[ ${PORTAL_MODULES:i-1:1} == "a" ]]; then
COMPOSE_FILES+=" -f docker-compose.accounts.yml" COMPOSE_FILES+=" -f docker-compose.mongodb.yml -f docker-compose.accounts.yml"
fi fi
# jaeger module - alias "j" # jaeger module - alias "j"
if [[ ${PORTAL_MODULES:i-1:1} == "j" ]]; then if [[ ${PORTAL_MODULES:i-1:1} == "j" ]]; then
COMPOSE_FILES+=" -f docker-compose.jaeger.yml" COMPOSE_FILES+=" -f docker-compose.jaeger.yml"
fi fi
# mongodb module - alias "m". implied by "a"
if [[ ${PORTAL_MODULES:i-1:1} == "m" ]]; then
COMPOSE_FILES+=" -f docker-compose.mongodb.yml"
fi
done done
# override file if exists # override file if exists

View File

@ -50,21 +50,6 @@ services:
- mongo - mongo
- oathkeeper - oathkeeper
mongo:
image: mongo:4.4.1
command: --keyFile=/data/mgkey --replSet=skynet
container_name: mongo
restart: unless-stopped
logging: *default-logging
volumes:
- ./docker/data/mongo/db:/data/db
- ./docker/data/mongo/mgkey:/data/mgkey:rw
networks:
shared:
ipv4_address: 10.10.10.71
ports:
- "27017:27017"
kratos-migrate: kratos-migrate:
image: oryd/kratos:v0.5.5-alpha.1 image: oryd/kratos:v0.5.5-alpha.1
container_name: kratos-migrate container_name: kratos-migrate

View File

@ -0,0 +1,23 @@
version: "3.7"
x-logging: &default-logging
driver: json-file
options:
max-size: "10m"
max-file: "3"
services:
mongo:
image: mongo:4.4.1
command: --keyFile=/data/mgkey --replSet=${SKYNET_DB_REPLICASET:-skynet}
container_name: mongo
restart: unless-stopped
logging: *default-logging
volumes:
- ./docker/data/mongo/db:/data/db
- ./docker/data/mongo/mgkey:/data/mgkey:rw
networks:
shared:
ipv4_address: 10.10.10.71
ports:
- "${SKYNET_DB_PORT}:27017"

View File

@ -24,7 +24,11 @@ services:
restart: unless-stopped restart: unless-stopped
logging: *default-logging logging: *default-logging
environment: environment:
- SIA_MODULES=gctwr - SIA_MODULES=gctwra
- MONGODB_URI=mongodb://${SKYNET_DB_HOST}:${SKYNET_DB_PORT}
- MONGODB_USER=${SKYNET_DB_USER}
- MONGODB_PASSWORD=${SKYNET_DB_PASS}
env_file: env_file:
- .env - .env
volumes: volumes:
@ -99,7 +103,7 @@ services:
build: build:
context: ./docker/handshake context: ./docker/handshake
dockerfile: Dockerfile dockerfile: Dockerfile
command: --chain-migrate=1 --wallet-migrate=1 command: --chain-migrate=2 --wallet-migrate=1
container_name: handshake container_name: handshake
restart: unless-stopped restart: unless-stopped
logging: *default-logging logging: *default-logging

View File

@ -1,9 +1,9 @@
FROM caddy:2.4.5-builder AS caddy-builder FROM caddy:2.4.6-builder AS caddy-builder
# available dns resolvers: https://github.com/caddy-dns # available dns resolvers: https://github.com/caddy-dns
RUN xcaddy build --with github.com/caddy-dns/route53 RUN xcaddy build --with github.com/caddy-dns/route53
FROM caddy:2.4.5-alpine FROM caddy:2.4.6-alpine
COPY --from=caddy-builder /usr/bin/caddy /usr/bin/caddy COPY --from=caddy-builder /usr/bin/caddy /usr/bin/caddy

View File

@ -1,15 +1,10 @@
FROM node:16.10.0-alpine FROM node:16.13.0-alpine
WORKDIR /opt/hsd WORKDIR /opt/hsd
RUN apk update && apk add bash unbound-dev gmp-dev g++ gcc make python2 git RUN apk update && apk add bash unbound-dev gmp-dev g++ gcc make python2 git
# Checkout a specific commit until Handshake releases the next release after
# 2.4.0 then we should switch to that tag.
#
# The commit we are targetting right now contains a fix for handling the chain
# migration code for new portals.
RUN git clone https://github.com/handshake-org/hsd.git /opt/hsd && \ RUN git clone https://github.com/handshake-org/hsd.git /opt/hsd && \
cd /opt/hsd && git checkout 6f0927db32723d6320c8bff255a6ccf70b2ccd32 && cd - cd /opt/hsd && git checkout v3.0.1 && cd -
RUN npm install --production RUN npm install --production
ENV PATH="${PATH}:/opt/hsd/bin:/opt/hsd/node_modules/.bin" ENV PATH="${PATH}:/opt/hsd/bin:/opt/hsd/node_modules/.bin"

View File

@ -7,6 +7,7 @@ RUN luarocks install lua-resty-http && \
-out /etc/ssl/local-certificate.crt -out /etc/ssl/local-certificate.crt
COPY mo ./ COPY mo ./
COPY libs /etc/nginx/libs
COPY conf.d /etc/nginx/conf.d COPY conf.d /etc/nginx/conf.d
COPY conf.d.templates /etc/nginx/conf.d.templates COPY conf.d.templates /etc/nginx/conf.d.templates

View File

@ -7,3 +7,6 @@ set $hns_domain '';
# set only if server has been access through SERVER_DOMAIN # set only if server has been access through SERVER_DOMAIN
set $server_alias ''; set $server_alias '';
# expose skylink variable so we can use it in access log
set $skylink '';

View File

@ -75,7 +75,7 @@ access_by_lua_block {
end end
} }
# we proxy to another nginx location rather than directly to siad because we don't want to deal with caching here # we proxy to another nginx location rather than directly to siad because we do not want to deal with caching here
proxy_pass https://127.0.0.1/$skylink$path$is_args$args; proxy_pass https://127.0.0.1/$skylink$path$is_args$args;
# in case siad returns location header, we need to replace the skylink with the domain name # in case siad returns location header, we need to replace the skylink with the domain name

View File

@ -11,8 +11,12 @@ if ($request_method = PURGE) {
limit_conn downloads_by_ip 100; # ddos protection: max 100 downloads at a time limit_conn downloads_by_ip 100; # ddos protection: max 100 downloads at a time
# ensure that skylink that we pass around is base64 encoded (transform base32 encoded ones)
# this is important because we want only one format in cache keys and logs
set_by_lua_block $skylink { return require("skynet.skylink").parse(ngx.var.skylink) }
# $skylink_v1 and $skylink_v2 variables default to the same value but in case the requested skylink was: # $skylink_v1 and $skylink_v2 variables default to the same value but in case the requested skylink was:
# a) skylink v1 - it wouldn't matter, no additional logic is executed # a) skylink v1 - it would not matter, no additional logic is executed
# b) skylink v2 - in a lua block below we will resolve the skylink v2 into skylink v1 and update # b) skylink v2 - in a lua block below we will resolve the skylink v2 into skylink v1 and update
# $skylink_v1 variable so then the proxy request to skyd can be cached in nginx (proxy_cache_key # $skylink_v1 variable so then the proxy request to skyd can be cached in nginx (proxy_cache_key
# in proxy-cache-downloads includes $skylink_v1 as a part of the cache key) # in proxy-cache-downloads includes $skylink_v1 as a part of the cache key)
@ -91,7 +95,7 @@ limit_rate $limit_rate;
proxy_read_timeout 600; proxy_read_timeout 600;
proxy_set_header User-Agent: Sia-Agent; proxy_set_header User-Agent: Sia-Agent;
# in case the requested skylink was v2 and we already resolved it to skylink v1, we're going to pass resolved # in case the requested skylink was v2 and we already resolved it to skylink v1, we are going to pass resolved
# skylink v1 to skyd to save that extra skylink v2 lookup in skyd but in turn, in case skyd returns a redirect # skylink v1 to skyd to save that extra skylink v2 lookup in skyd but in turn, in case skyd returns a redirect
# we need to rewrite the skylink v1 to skylink v2 in the location header with proxy_redirect # we need to rewrite the skylink v1 to skylink v2 in the location header with proxy_redirect
proxy_redirect $skylink_v1 $skylink_v2; proxy_redirect $skylink_v1 $skylink_v2;

View File

@ -7,7 +7,7 @@ log_by_lua_block {
if premature then return end if premature then return end
local httpc = require("resty.http").new() local httpc = require("resty.http").new()
local method = request_method == ngx.HTTP_GET and "read" or "write" local method = request_method == "GET" and "read" or "write"
-- 10.10.10.70 points to accounts service (alias not available when using resty-http) -- 10.10.10.70 points to accounts service (alias not available when using resty-http)
local res, err = httpc:request_uri("http://10.10.10.70:3000/track/registry/" .. method, { local res, err = httpc:request_uri("http://10.10.10.70:3000/track/registry/" .. method, {

View File

@ -1,3 +1,5 @@
lua_shared_dict dnslink 10m;
server { server {
listen 80 default_server; listen 80 default_server;
listen [::]:80 default_server; listen [::]:80 default_server;

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;
} }
@ -102,16 +112,34 @@ location /skynet/registry {
include /etc/nginx/conf.d/include/location-skynet-registry; include /etc/nginx/conf.d/include/location-skynet-registry;
} }
location /skynet/restore {
include /etc/nginx/conf.d/include/cors;
include /etc/nginx/conf.d/include/sia-auth;
client_max_body_size 5M;
# increase request timeouts
proxy_read_timeout 600;
proxy_send_timeout 600;
proxy_request_buffering off; # stream uploaded files through the proxy as it comes in
proxy_set_header Expect $http_expect;
proxy_set_header User-Agent: Sia-Agent;
# proxy this call to siad endpoint (make sure the ip is correct)
proxy_pass http://sia:9980;
}
location /skynet/skyfile { location /skynet/skyfile {
include /etc/nginx/conf.d/include/cors; include /etc/nginx/conf.d/include/cors;
include /etc/nginx/conf.d/include/sia-auth; include /etc/nginx/conf.d/include/sia-auth;
include /etc/nginx/conf.d/include/track-upload; include /etc/nginx/conf.d/include/track-upload;
include /etc/nginx/conf.d/include/generate-siapath; include /etc/nginx/conf.d/include/generate-siapath;
limit_req zone=uploads_by_ip burst=100 nodelay; limit_req zone=uploads_by_ip burst=10 nodelay;
limit_req zone=uploads_by_ip_throttled; limit_req zone=uploads_by_ip_throttled;
limit_conn upload_conn 10; limit_conn upload_conn 5;
limit_conn upload_conn_rl 1; limit_conn upload_conn_rl 1;
client_max_body_size 1000M; # make sure to limit the size of upload to a sane value client_max_body_size 1000M; # make sure to limit the size of upload to a sane value
@ -146,10 +174,16 @@ location /skynet/tus {
include /etc/nginx/conf.d/include/cors-headers; # include cors headers but do not overwrite OPTIONS response include /etc/nginx/conf.d/include/cors-headers; # include cors headers but do not overwrite OPTIONS response
include /etc/nginx/conf.d/include/track-upload; include /etc/nginx/conf.d/include/track-upload;
limit_req zone=uploads_by_ip burst=10 nodelay;
limit_req zone=uploads_by_ip_throttled;
limit_conn upload_conn 5;
limit_conn upload_conn_rl 1;
# TUS chunks size is 40M + leaving 10M of breathing room # TUS chunks size is 40M + leaving 10M of breathing room
client_max_body_size 50M; client_max_body_size 50M;
# Those timeouts need to be elevated since skyd can stall reading # Those timeouts need to be elevated since skyd can stall reading
# data for a while when overloaded which would terminate connection # data for a while when overloaded which would terminate connection
client_body_timeout 1h; client_body_timeout 1h;
proxy_send_timeout 1h; proxy_send_timeout 1h;
@ -211,6 +245,12 @@ location /skynet/pin {
include /etc/nginx/conf.d/include/track-upload; include /etc/nginx/conf.d/include/track-upload;
include /etc/nginx/conf.d/include/generate-siapath; include /etc/nginx/conf.d/include/generate-siapath;
limit_req zone=uploads_by_ip burst=10 nodelay;
limit_req zone=uploads_by_ip_throttled;
limit_conn upload_conn 5;
limit_conn upload_conn_rl 1;
proxy_set_header User-Agent: Sia-Agent; proxy_set_header User-Agent: Sia-Agent;
proxy_pass http://sia:9980$uri?siapath=$dir1/$dir2/$dir3&$args; proxy_pass http://sia:9980$uri?siapath=$dir1/$dir2/$dir3&$args;
} }
@ -221,10 +261,7 @@ location /skynet/metadata {
header_filter_by_lua_block { header_filter_by_lua_block {
ngx.header["Skynet-Portal-Api"] = os.getenv("SKYNET_PORTAL_API") ngx.header["Skynet-Portal-Api"] = os.getenv("SKYNET_PORTAL_API")
ngx.header["Skynet-Server-Api"] = os.getenv("SKYNET_SERVER_API") ngx.header["Skynet-Server-Api"] = os.getenv("SKYNET_SERVER_API")
}
-- do not expose internal header
ngx.header["Skynet-Requested-Skylink"] = ""
}
proxy_set_header User-Agent: Sia-Agent; proxy_set_header User-Agent: Sia-Agent;
proxy_pass http://sia:9980; proxy_pass http://sia:9980;
@ -236,10 +273,7 @@ location /skynet/resolve {
header_filter_by_lua_block { header_filter_by_lua_block {
ngx.header["Skynet-Portal-Api"] = os.getenv("SKYNET_PORTAL_API") ngx.header["Skynet-Portal-Api"] = os.getenv("SKYNET_PORTAL_API")
ngx.header["Skynet-Server-Api"] = os.getenv("SKYNET_SERVER_API") ngx.header["Skynet-Server-Api"] = os.getenv("SKYNET_SERVER_API")
}
-- do not expose internal header
ngx.header["Skynet-Requested-Skylink"] = ""
}
proxy_set_header User-Agent: Sia-Agent; proxy_set_header User-Agent: Sia-Agent;
proxy_pass http://sia:9980; proxy_pass http://sia:9980;

View File

@ -5,21 +5,41 @@ location / {
set $path $uri; set $path $uri;
rewrite_by_lua_block { rewrite_by_lua_block {
local httpc = require("resty.http").new() local cache = ngx.shared.dnslink
local cache_value = cache:get(ngx.var.host)
-- 10.10.10.55 points to dnslink-api service (alias not available when using resty-http) if cache_value == nil then
local res, err = httpc:request_uri("http://10.10.10.55:3100/dnslink/" .. ngx.var.host) local httpc = require("resty.http").new()
if err or (res and res.status ~= ngx.HTTP_OK) then -- 10.10.10.55 points to dnslink-api service (alias not available when using resty-http)
ngx.status = (err and ngx.HTTP_INTERNAL_SERVER_ERROR) or res.status local res, err = httpc:request_uri("http://10.10.10.55:3100/dnslink/" .. ngx.var.host)
ngx.header["content-type"] = "text/plain"
ngx.say(err or res.body) if err or (res and res.status ~= ngx.HTTP_OK) then
ngx.exit(ngx.status) -- check whether we can fallback to regular skylink request
local match_skylink = ngx.re.match(ngx.var.uri, "^/([a-zA-Z0-9-_]{46}|[a-z0-9]{55})(/.*)?")
if match_skylink then
ngx.var.skylink = match_skylink[1]
ngx.var.path = match_skylink[2] or "/"
else
ngx.status = (err and ngx.HTTP_INTERNAL_SERVER_ERROR) or res.status
ngx.header["content-type"] = "text/plain"
ngx.say(err or res.body)
ngx.exit(ngx.status)
end
else
ngx.var.skylink = res.body
local cache_ttl = 300 -- 5 minutes cache expire time
cache:set(ngx.var.host, ngx.var.skylink, cache_ttl)
end
else else
ngx.var.skylink = res.body ngx.var.skylink = cache_value
ngx.var.skylink_v1 = ngx.var.skylink
ngx.var.skylink_v2 = ngx.var.skylink
end end
ngx.var.skylink = require("skynet.skylink").parse(ngx.var.skylink)
ngx.var.skylink_v1 = ngx.var.skylink
ngx.var.skylink_v2 = ngx.var.skylink
} }
include /etc/nginx/conf.d/include/location-skylink; include /etc/nginx/conf.d/include/location-skylink;

View File

@ -0,0 +1,301 @@
-- source: https://github.com/aiq/basexx
-- license: MIT
-- modified: exposed from_basexx and to_basexx generic functions
--------------------------------------------------------------------------------
-- util functions
--------------------------------------------------------------------------------
local function divide_string( str, max )
local result = {}
local start = 1
for i = 1, #str do
if i % max == 0 then
table.insert( result, str:sub( start, i ) )
start = i + 1
elseif i == #str then
table.insert( result, str:sub( start, i ) )
end
end
return result
end
local function number_to_bit( num, length )
local bits = {}
while num > 0 do
local rest = math.floor( math.fmod( num, 2 ) )
table.insert( bits, rest )
num = ( num - rest ) / 2
end
while #bits < length do
table.insert( bits, "0" )
end
return string.reverse( table.concat( bits ) )
end
local function ignore_set( str, set )
if set then
str = str:gsub( "["..set.."]", "" )
end
return str
end
local function pure_from_bit( str )
return ( str:gsub( '........', function ( cc )
return string.char( tonumber( cc, 2 ) )
end ) )
end
local function unexpected_char_error( str, pos )
local c = string.sub( str, pos, pos )
return string.format( "unexpected character at position %d: '%s'", pos, c )
end
--------------------------------------------------------------------------------
local basexx = {}
--------------------------------------------------------------------------------
-- base2(bitfield) decode and encode function
--------------------------------------------------------------------------------
local bitMap = { o = "0", i = "1", l = "1" }
function basexx.from_bit( str, ignore )
str = ignore_set( str, ignore )
str = string.lower( str )
str = str:gsub( '[ilo]', function( c ) return bitMap[ c ] end )
local pos = string.find( str, "[^01]" )
if pos then return nil, unexpected_char_error( str, pos ) end
return pure_from_bit( str )
end
function basexx.to_bit( str )
return ( str:gsub( '.', function ( c )
local byte = string.byte( c )
local bits = {}
for _ = 1,8 do
table.insert( bits, byte % 2 )
byte = math.floor( byte / 2 )
end
return table.concat( bits ):reverse()
end ) )
end
--------------------------------------------------------------------------------
-- base16(hex) decode and encode function
--------------------------------------------------------------------------------
function basexx.from_hex( str, ignore )
str = ignore_set( str, ignore )
local pos = string.find( str, "[^%x]" )
if pos then return nil, unexpected_char_error( str, pos ) end
return ( str:gsub( '..', function ( cc )
return string.char( tonumber( cc, 16 ) )
end ) )
end
function basexx.to_hex( str )
return ( str:gsub( '.', function ( c )
return string.format('%02X', string.byte( c ) )
end ) )
end
--------------------------------------------------------------------------------
-- generic function to decode and encode base32/base64
--------------------------------------------------------------------------------
function basexx.from_basexx( str, alphabet, bits )
local result = {}
for i = 1, #str do
local c = string.sub( str, i, i )
if c ~= '=' then
local index = string.find( alphabet, c, 1, true )
if not index then
return nil, unexpected_char_error( str, i )
end
table.insert( result, number_to_bit( index - 1, bits ) )
end
end
local value = table.concat( result )
local pad = #value % 8
return pure_from_bit( string.sub( value, 1, #value - pad ) )
end
function basexx.to_basexx( str, alphabet, bits, pad )
local bitString = basexx.to_bit( str )
local chunks = divide_string( bitString, bits )
local result = {}
for _,value in ipairs( chunks ) do
if ( #value < bits ) then
value = value .. string.rep( '0', bits - #value )
end
local pos = tonumber( value, 2 ) + 1
table.insert( result, alphabet:sub( pos, pos ) )
end
table.insert( result, pad )
return table.concat( result )
end
--------------------------------------------------------------------------------
-- rfc 3548: http://www.rfc-editor.org/rfc/rfc3548.txt
--------------------------------------------------------------------------------
local base32Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"
local base32PadMap = { "", "======", "====", "===", "=" }
function basexx.from_base32( str, ignore )
str = ignore_set( str, ignore )
return basexx.from_basexx( string.upper( str ), base32Alphabet, 5 )
end
function basexx.to_base32( str )
return basexx.to_basexx( str, base32Alphabet, 5, base32PadMap[ #str % 5 + 1 ] )
end
--------------------------------------------------------------------------------
-- crockford: http://www.crockford.com/wrmg/base32.html
--------------------------------------------------------------------------------
local crockfordAlphabet = "0123456789ABCDEFGHJKMNPQRSTVWXYZ"
local crockfordMap = { O = "0", I = "1", L = "1" }
function basexx.from_crockford( str, ignore )
str = ignore_set( str, ignore )
str = string.upper( str )
str = str:gsub( '[ILOU]', function( c ) return crockfordMap[ c ] end )
return basexx.from_basexx( str, crockfordAlphabet, 5 )
end
function basexx.to_crockford( str )
return basexx.to_basexx( str, crockfordAlphabet, 5, "" )
end
--------------------------------------------------------------------------------
-- base64 decode and encode function
--------------------------------------------------------------------------------
local base64Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"..
"abcdefghijklmnopqrstuvwxyz"..
"0123456789+/"
local base64PadMap = { "", "==", "=" }
function basexx.from_base64( str, ignore )
str = ignore_set( str, ignore )
return basexx.from_basexx( str, base64Alphabet, 6 )
end
function basexx.to_base64( str )
return basexx.to_basexx( str, base64Alphabet, 6, base64PadMap[ #str % 3 + 1 ] )
end
--------------------------------------------------------------------------------
-- URL safe base64 decode and encode function
--------------------------------------------------------------------------------
local url64Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"..
"abcdefghijklmnopqrstuvwxyz"..
"0123456789-_"
function basexx.from_url64( str, ignore )
str = ignore_set( str, ignore )
return basexx.from_basexx( str, url64Alphabet, 6 )
end
function basexx.to_url64( str )
return basexx.to_basexx( str, url64Alphabet, 6, "" )
end
--------------------------------------------------------------------------------
--
--------------------------------------------------------------------------------
local function length_error( len, d )
return string.format( "invalid length: %d - must be a multiple of %d", len, d )
end
local z85Decoder = { 0x00, 0x44, 0x00, 0x54, 0x53, 0x52, 0x48, 0x00,
0x4B, 0x4C, 0x46, 0x41, 0x00, 0x3F, 0x3E, 0x45,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x40, 0x00, 0x49, 0x42, 0x4A, 0x47,
0x51, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A,
0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32,
0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A,
0x3B, 0x3C, 0x3D, 0x4D, 0x00, 0x4E, 0x43, 0x00,
0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20,
0x21, 0x22, 0x23, 0x4F, 0x00, 0x50, 0x00, 0x00 }
function basexx.from_z85( str, ignore )
str = ignore_set( str, ignore )
if ( #str % 5 ) ~= 0 then
return nil, length_error( #str, 5 )
end
local result = {}
local value = 0
for i = 1, #str do
local index = string.byte( str, i ) - 31
if index < 1 or index >= #z85Decoder then
return nil, unexpected_char_error( str, i )
end
value = ( value * 85 ) + z85Decoder[ index ]
if ( i % 5 ) == 0 then
local divisor = 256 * 256 * 256
while divisor ~= 0 do
local b = math.floor( value / divisor ) % 256
table.insert( result, string.char( b ) )
divisor = math.floor( divisor / 256 )
end
value = 0
end
end
return table.concat( result )
end
local z85Encoder = "0123456789"..
"abcdefghijklmnopqrstuvwxyz"..
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"..
".-:+=^!/*?&<>()[]{}@%$#"
function basexx.to_z85( str )
if ( #str % 4 ) ~= 0 then
return nil, length_error( #str, 4 )
end
local result = {}
local value = 0
for i = 1, #str do
local b = string.byte( str, i )
value = ( value * 256 ) + b
if ( i % 4 ) == 0 then
local divisor = 85 * 85 * 85 * 85
while divisor ~= 0 do
local index = ( math.floor( value / divisor ) % 85 ) + 1
table.insert( result, z85Encoder:sub( index, index ) )
divisor = math.floor( divisor / 85 )
end
value = 0
end
end
return table.concat( result )
end
--------------------------------------------------------------------------------
return basexx

View File

@ -0,0 +1,16 @@
local _M = {}
local basexx = require("basexx")
-- parse any skylink and return base64 version
function _M.parse(skylink)
if string.len(skylink) == 55 then
local decoded = basexx.from_basexx(string.upper(skylink), "0123456789ABCDEFGHIJKLMNOPQRSTUV", 5)
return basexx.to_url64(decoded)
end
return skylink
end
return _M

View File

@ -0,0 +1,14 @@
skylink = require("skynet/skylink")
describe("parse", function()
local base32 = "0404dsjvti046fsua4ktor9grrpe76erq9jot9cvopbhsvsu76r4r30"
local base64 = "AQBG8n_sgEM_nlEp3G0w3vLjmdvSZ46ln8ZXHn-eObZNjA"
it("should return unchanged base64 skylink", function()
assert.is.same(skylink.parse(base64), base64)
end)
it("should transform base32 skylink into base64", function()
assert.is.same(skylink.parse(base32), base64)
end)
end)

View File

@ -38,6 +38,8 @@ http {
include mime.types; include mime.types;
default_type application/octet-stream; default_type application/octet-stream;
lua_package_path "/etc/nginx/libs/?.lua;;";
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" ' '$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $upstream_response_time ' '"$http_user_agent" $upstream_response_time '
@ -45,7 +47,7 @@ http {
'"$upstream_http_content_type" "$upstream_cache_status" ' '"$upstream_http_content_type" "$upstream_cache_status" '
'"$server_alias" "$sent_http_skynet_skylink" ' '"$server_alias" "$sent_http_skynet_skylink" '
'$upstream_connect_time $upstream_header_time ' '$upstream_connect_time $upstream_header_time '
'$request_time "$hns_domain"'; '$request_time "$hns_domain" "$skylink"';
access_log logs/access.log main; access_log logs/access.log main;
@ -72,8 +74,9 @@ http {
# this runs before forking out nginx worker processes # this runs before forking out nginx worker processes
init_by_lua_block { init_by_lua_block {
require "cjson" require "cjson"
require "resty.http" require "resty.http"
require "skynet.skylink"
} }
# include skynet-portal-api and skynet-server-api header on every request # include skynet-portal-api and skynet-server-api header on every request

View File

@ -1,4 +1,4 @@
FROM node:16.10.0-alpine FROM node:16.13.0-alpine
WORKDIR /usr/app WORKDIR /usr/app

View File

@ -10,32 +10,32 @@
"dependencies": { "dependencies": {
"@fontsource/metropolis": "4.5.0", "@fontsource/metropolis": "4.5.0",
"@ory/kratos-client": "0.5.4-alpha.1", "@ory/kratos-client": "0.5.4-alpha.1",
"@stripe/react-stripe-js": "1.5.0", "@stripe/react-stripe-js": "1.6.0",
"@stripe/stripe-js": "1.19.0", "@stripe/stripe-js": "1.21.1",
"@tailwindcss/forms": "0.3.4", "@tailwindcss/forms": "0.3.4",
"autoprefixer": "10.3.6", "autoprefixer": "10.4.0",
"classnames": "2.3.1", "classnames": "2.3.1",
"clipboardy": "2.3.0", "copy-text-to-clipboard": "^3.0.1",
"dayjs": "1.10.7", "dayjs": "1.10.7",
"express-jwt": "6.1.0", "express-jwt": "6.1.0",
"fast-levenshtein": "3.0.0", "fast-levenshtein": "3.0.0",
"formik": "2.2.9", "formik": "2.2.9",
"http-status-codes": "2.1.4", "http-status-codes": "2.1.4",
"ky": "0.25.1", "ky": "0.25.1",
"next": "11.1.2", "next": "12.0.3",
"normalize.css": "8.0.1", "normalize.css": "8.0.1",
"postcss": "8.3.8", "postcss": "8.3.11",
"prettier": "2.4.1", "prettier": "2.4.1",
"pretty-bytes": "5.6.0", "pretty-bytes": "5.6.0",
"react": "17.0.2", "react": "17.0.2",
"react-dom": "17.0.2", "react-dom": "17.0.2",
"react-toastify": "8.0.3", "react-toastify": "8.1.0",
"skynet-js": "3.0.2", "skynet-js": "3.0.2",
"stripe": "8.178.0", "stripe": "8.186.1",
"superagent": "6.1.0", "superagent": "6.1.0",
"swr": "1.0.1", "swr": "1.0.1",
"tailwindcss": "2.2.16", "tailwindcss": "2.2.19",
"yup": "0.32.9" "yup": "0.32.11"
}, },
"resolutions": { "resolutions": {
"axios": "0.21.4" "axios": "0.21.4"

View File

@ -1,3 +1,4 @@
import copy from "copy-text-to-clipboard";
import dayjs from "dayjs"; import dayjs from "dayjs";
import relativeTime from "dayjs/plugin/relativeTime"; import relativeTime from "dayjs/plugin/relativeTime";
import prettyBytes from "pretty-bytes"; import prettyBytes from "pretty-bytes";
@ -8,7 +9,6 @@ import { SkynetClient } from "skynet-js";
import config from "../config"; import config from "../config";
import useAccountsApi from "../services/useAccountsApi"; import useAccountsApi from "../services/useAccountsApi";
import { isFreeTier } from "../services/tiers"; import { isFreeTier } from "../services/tiers";
import { write } from "clipboardy";
dayjs.extend(relativeTime); dayjs.extend(relativeTime);
@ -40,7 +40,7 @@ function SkylinkList({ items = [], timestamp }) {
<abbr <abbr
className="text-xs text-gray-400 whitespace-nowrap ml-2 cursor-pointer" className="text-xs text-gray-400 whitespace-nowrap ml-2 cursor-pointer"
title="Click to copy" title="Click to copy"
onClick={() => write(`sia://${item.skylink}`)} onClick={() => copy(`sia://${item.skylink}`)}
> >
sia://{item.skylink.substr(0, 5)}…{item.skylink.substr(-5)} sia://{item.skylink.substr(0, 5)}…{item.skylink.substr(-5)}
</abbr> </abbr>

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
FROM node:16.10.0-alpine FROM node:16.13.0-alpine
WORKDIR /usr/app WORKDIR /usr/app

View File

@ -5,8 +5,7 @@
"license": "SEE LICENSE IN LICENSE.md", "license": "SEE LICENSE IN LICENSE.md",
"dependencies": { "dependencies": {
"express": "^4.17.1", "express": "^4.17.1",
"is-valid-domain": "^0.1.2", "is-valid-domain": "^0.1.4"
"node-cache": "^5.1.2"
}, },
"devDependencies": { "devDependencies": {
"prettier": "^2.4.1" "prettier": "^2.4.1"

View File

@ -1,14 +1,11 @@
const dns = require("dns"); const dns = require("dns");
const express = require("express"); const express = require("express");
const NodeCache = require("node-cache");
const isValidDomain = require("is-valid-domain"); const isValidDomain = require("is-valid-domain");
const host = process.env.DNSLINK_API_HOSTNAME || "0.0.0.0"; const host = process.env.DNSLINK_API_HOSTNAME || "0.0.0.0";
const port = Number(process.env.DNSLINK_API_PORT) || 3100; const port = Number(process.env.DNSLINK_API_PORT) || 3100;
const cacheTTL = Number(process.env.DNSLINK_API_CACHE_TTL) || 300; // default to 5 minutes
const server = express(); const server = express();
const cache = new NodeCache({ stdTTL: cacheTTL });
const dnslinkNamespace = "skynet-ns"; const dnslinkNamespace = "skynet-ns";
const dnslinkRegExp = new RegExp(`^dnslink=/${dnslinkNamespace}/.+$`); const dnslinkRegExp = new RegExp(`^dnslink=/${dnslinkNamespace}/.+$`);
@ -23,10 +20,6 @@ server.get("/dnslink/:name", async (req, res) => {
return failure(`"${req.params.name}" is not a valid domain`); return failure(`"${req.params.name}" is not a valid domain`);
} }
if (cache.has(req.params.name)) {
return success(cache.get(req.params.name));
}
const lookup = `_dnslink.${req.params.name}`; const lookup = `_dnslink.${req.params.name}`;
dns.resolveTxt(lookup, (error, records) => { dns.resolveTxt(lookup, (error, records) => {
@ -65,8 +58,6 @@ server.get("/dnslink/:name", async (req, res) => {
const skylink = matchSkylink[1]; const skylink = matchSkylink[1];
cache.set(req.params.name, skylink);
console.log(`${req.params.name} => ${skylink}`); console.log(`${req.params.name} => ${skylink}`);
return success(skylink); return success(skylink);

View File

@ -36,11 +36,6 @@ bytes@3.1.0:
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6"
integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==
clone@2.x:
version "2.1.2"
resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f"
integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=
content-disposition@0.5.3: content-disposition@0.5.3:
version "0.5.3" version "0.5.3"
resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd"
@ -203,10 +198,10 @@ ipaddr.js@1.9.1:
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3"
integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==
is-valid-domain@^0.1.2: is-valid-domain@^0.1.4:
version "0.1.2" version "0.1.4"
resolved "https://registry.yarnpkg.com/is-valid-domain/-/is-valid-domain-0.1.2.tgz#bd1b144716ca663df5996d62e2e7e45a971c7223" resolved "https://registry.yarnpkg.com/is-valid-domain/-/is-valid-domain-0.1.4.tgz#5d5d811e1627cac9d39f504b645c57e76d946629"
integrity sha512-vm/9Ynw80MusgfSMffjGRuMhO8hjk5MOxLoFL7nYWvWXTPCxTGQtACiCwO055UqHICG8xP6hIvRXK1iwnuU9GA== integrity sha512-Caa6rwGze6pihA29wy3T1yNXzd53caGHvL0OfJ8RLtv0tVVzVZGlxFcQ0W8kls/uG0QUrv2B3J9xi/YB5/cfUQ==
dependencies: dependencies:
punycode "^2.1.1" punycode "^2.1.1"
@ -257,13 +252,6 @@ negotiator@0.6.2:
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb"
integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==
node-cache@^5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/node-cache/-/node-cache-5.1.2.tgz#f264dc2ccad0a780e76253a694e9fd0ed19c398d"
integrity sha512-t1QzWwnk4sjLWaQAS8CHgOJ+RAfmHpxFWmc36IWTiWHQfs0w5JDMBS1b1ZxQteo0vVVuWJvIUKHDkkeK7vIGCg==
dependencies:
clone "2.x"
on-finished@~2.3.0: on-finished@~2.3.0:
version "2.3.0" version "2.3.0"
resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947"

View File

@ -1,4 +1,4 @@
FROM node:16.10.0-alpine FROM node:16.13.0-alpine
WORKDIR /usr/app WORKDIR /usr/app

View File

@ -5,7 +5,7 @@
"license": "SEE LICENSE IN LICENSE.md", "license": "SEE LICENSE IN LICENSE.md",
"dependencies": { "dependencies": {
"express": "^4.17.1", "express": "^4.17.1",
"hs-client": "^0.0.9", "hs-client": "^0.0.10",
"node-cache": "^5.1.2", "node-cache": "^5.1.2",
"punycode": "^2.1.1" "punycode": "^2.1.1"
}, },

View File

@ -15,10 +15,10 @@ array-flatten@1.1.1:
resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2"
integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=
bcfg@~0.1.6: bcfg@~0.1.7:
version "0.1.6" version "0.1.7"
resolved "https://registry.yarnpkg.com/bcfg/-/bcfg-0.1.6.tgz#f77a6323bddef14f3886222e7ef8ccc0bc2143ec" resolved "https://registry.yarnpkg.com/bcfg/-/bcfg-0.1.7.tgz#610198a67a56160305fdc1f54b5b5c90b52530d7"
integrity sha512-BR2vwQZwu24aRm588XHOnPVjjQtbK8sF0RopRFgMuke63/REJMWnePTa2YHKDBefuBYiVdgkowuB1/e4K7Ue3g== integrity sha512-+4beq5bXwfmxdcEoHYQsaXawh1qFzjLcRvPe5k5ww/NEWzZTm56Jk8LuPmfeGB7X584jZ8xGq6UgMaZnNDa5Ww==
dependencies: dependencies:
bsert "~0.0.10" bsert "~0.0.10"
@ -194,12 +194,12 @@ fresh@0.5.2:
resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=
hs-client@^0.0.9: hs-client@^0.0.10:
version "0.0.9" version "0.0.10"
resolved "https://registry.yarnpkg.com/hs-client/-/hs-client-0.0.9.tgz#05790253df1137cecde4bcb59a181ab79bd395b9" resolved "https://registry.yarnpkg.com/hs-client/-/hs-client-0.0.10.tgz#b2801441613fbb255cbeacbc764085a36c42ee5e"
integrity sha512-TAsexmpPhSVdCQ1iiX4bBnuqlThTSdGz/YKq+vjLSS1TZ2TwKxERJ8vZh1Wd6GGaMGLZl99uQR+2wUyk4HLSbg== integrity sha512-15tfeQEMRS1FZA0q9gFbQ1jYs8v4z9oKw9xFwVEyRuckn72hoVAglN4IrFxkOCDMYV7TWCY/nO/yNZp5njYFBw==
dependencies: dependencies:
bcfg "~0.1.6" bcfg "~0.1.7"
bcurl "~0.1.9" bcurl "~0.1.9"
bsert "~0.0.10" bsert "~0.0.10"

View File

@ -1,4 +1,4 @@
FROM node:16.10.0-alpine FROM node:16.13.0-alpine
RUN apk update && apk add dnsmasq RUN apk update && apk add dnsmasq

View File

@ -13,7 +13,7 @@
"http-status-codes": "^2.1.2", "http-status-codes": "^2.1.2",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"lowdb": "^1.0.0", "lowdb": "^1.0.0",
"skynet-js": "^3.0.2", "skynet-js": "^4.0.19-beta",
"testing-corpus": "https://github.com/SkynetLabs/testing-corpus", "testing-corpus": "https://github.com/SkynetLabs/testing-corpus",
"write-file-atomic": "^3.0.3", "write-file-atomic": "^3.0.3",
"yargs": "^17.2.1" "yargs": "^17.2.1"

View File

@ -2,11 +2,36 @@ const got = require("got");
const FormData = require("form-data"); const FormData = require("form-data");
const { isEqual } = require("lodash"); const { isEqual } = require("lodash");
const { calculateElapsedTime, getResponseContent } = require("../utils"); const { calculateElapsedTime, getResponseContent } = require("../utils");
const { SkynetClient, genKeyPairAndSeed } = require("skynet-js"); const { SkynetClient, stringToUint8ArrayUtf8, genKeyPairAndSeed } = require("skynet-js");
const skynetClient = new SkynetClient(process.env.SKYNET_PORTAL_API); const skynetClient = new SkynetClient(process.env.SKYNET_PORTAL_API);
const exampleSkylink = "AACogzrAimYPG42tDOKhS3lXZD8YvlF8Q8R17afe95iV2Q"; const exampleSkylink = "AACogzrAimYPG42tDOKhS3lXZD8YvlF8Q8R17afe95iV2Q";
// check that any relevant configuration is properly set in skyd
async function skydConfigCheck(done) {
const time = process.hrtime();
const data = { up: false };
try {
const response = await got(`http://10.10.10.10:9980/renter`, { headers: { "User-Agent": "Sia-Agent" } }).json();
// make sure initial funding is set to 10SC
if (response.settings.allowance.paymentcontractinitialfunding !== "10000000000000000000000000") {
throw new Error("Skynet Portal Per-Contract Budget is not set correctly!");
}
data.up = true;
data.ip = response.ip;
} catch (error) {
data.statusCode = error.response?.statusCode || error.statusCode || error.status;
data.errorMessage = error.message;
data.errorResponseContent = getResponseContent(error.response);
data.ip = error?.response?.ip ?? null;
}
done({ name: "skyd_config", time: calculateElapsedTime(time), ...data });
}
// uploadCheck returns the result of uploading a sample file // uploadCheck returns the result of uploading a sample file
async function uploadCheck(done) { async function uploadCheck(done) {
const time = process.hrtime(); const time = process.hrtime();
@ -58,6 +83,14 @@ 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 = "AQBG8n_sgEM_nlEp3G0w3vLjmdvSZ46ln8ZXHn-eObZNjA";
const url = await skynetClient.getSkylinkUrl(websiteSkylink, { subdomain: true });
return done(await genericAccessCheck("website_skylink", url));
}
// 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`;
@ -70,11 +103,11 @@ async function registryWriteAndReadCheck(done) {
const time = process.hrtime(); const time = process.hrtime();
const data = { name: "registry_write_and_read", up: false }; const data = { name: "registry_write_and_read", up: false };
const { privateKey, publicKey } = genKeyPairAndSeed(); const { privateKey, publicKey } = genKeyPairAndSeed();
const expected = { datakey: "foo-key", data: "foo-data", revision: BigInt(0) }; const expected = { dataKey: "foo-key", data: stringToUint8ArrayUtf8("foo-data"), revision: BigInt(0) };
try { try {
await skynetClient.registry.setEntry(privateKey, expected); await skynetClient.registry.setEntry(privateKey, expected);
const { entry } = await skynetClient.registry.getEntry(publicKey, expected.datakey); const { entry } = await skynetClient.registry.getEntry(publicKey, expected.dataKey);
if (isEqual(expected, entry)) { if (isEqual(expected, entry)) {
data.up = true; data.up = true;
@ -82,7 +115,7 @@ async function registryWriteAndReadCheck(done) {
data.errors = [{ message: "Data mismatch in registry (read after write)", entry, expected }]; data.errors = [{ message: "Data mismatch in registry (read after write)", entry, expected }];
} }
} catch (error) { } catch (error) {
data.errors = [{ message: error.message }]; data.errors = [{ message: error?.response?.data?.message ?? error.message }];
} }
return done({ ...data, time: calculateElapsedTime(time) }); return done({ ...data, time: calculateElapsedTime(time) });
@ -157,8 +190,10 @@ async function genericAccessCheck(name, url) {
} }
const checks = [ const checks = [
skydConfigCheck,
uploadCheck, uploadCheck,
websiteCheck, websiteCheck,
websiteSkylinkCheck,
downloadCheck, downloadCheck,
skylinkSubdomainCheck, skylinkSubdomainCheck,
handshakeSubdomainCheck, handshakeSubdomainCheck,

View File

@ -2,17 +2,10 @@
# yarn lockfile v1 # yarn lockfile v1
"@babel/runtime@^7.11.2":
version "7.14.8"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.8.tgz#7119a56f421018852694290b9f9148097391b446"
integrity sha512-twj3L8Og5SaCRCErB4x4ajbvBIVV77CGeFglHpeg5WC5FF8TZzBWXtTJ4MqaD9QszLYTtr+IsaAL2rEUevb+eg==
dependencies:
regenerator-runtime "^0.13.4"
"@sindresorhus/is@^4.0.0": "@sindresorhus/is@^4.0.0":
version "4.0.1" version "4.2.0"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.0.1.tgz#d26729db850fa327b7cacc5522252194404226f5" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.2.0.tgz#667bfc6186ae7c9e0b45a08960c551437176e1ca"
integrity sha512-Qm9hBEBu18wt1PO2flE7LPb30BHMQt1eQgbV76YntdNk73XZGpn3izvGTYxbGgzXKgbCjiia0uxTd3aTNQrY/g== integrity sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==
"@szmarczak/http-timer@^4.0.5": "@szmarczak/http-timer@^4.0.5":
version "4.0.6" version "4.0.6"
@ -37,16 +30,16 @@
integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==
"@types/keyv@*": "@types/keyv@*":
version "3.1.2" version "3.1.3"
resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.2.tgz#5d97bb65526c20b6e0845f6b0d2ade4f28604ee5" resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.3.tgz#1c9aae32872ec1f20dcdaee89a9f3ba88f465e41"
integrity sha512-/FvAK2p4jQOaJ6CGDHJTqZcUtbZe820qIeTg7o0Shg7drB4JHeL+V/dhSaly7NXx6u8eSee+r7coT+yuJEvDLg== integrity sha512-FXCJgyyN3ivVgRoml4h94G/p3kY+u/B86La+QptcqJaWtBWtmc6TtkNfS40n9bIvyLteHh7zXOtgbobORKPbDg==
dependencies: dependencies:
"@types/node" "*" "@types/node" "*"
"@types/node@*": "@types/node@*":
version "16.4.3" version "16.11.6"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.4.3.tgz#c01c1a215721f6dec71b47d88b4687463601ba48" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.6.tgz#6bef7a2a0ad684cf6e90fcfe31cecabd9ce0a3ae"
integrity sha512-GKM4FLMkWDc0sfx7tXqPWkM6NBow1kge0fgQh0bOnlqo4iT1kvTvMEKE0c1RtUGnbLlGRXiAA8SumE//90uKAg== integrity sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==
"@types/responselike@*", "@types/responselike@^1.0.0": "@types/responselike@*", "@types/responselike@^1.0.0":
version "1.0.0" version "1.0.0"
@ -63,7 +56,7 @@ accepts@~1.3.7:
mime-types "~2.1.24" mime-types "~2.1.24"
negotiator "0.6.2" negotiator "0.6.2"
ansi-regex@^5.0.0: ansi-regex@^5.0.1:
version "5.0.1" version "5.0.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
@ -85,12 +78,17 @@ asynckit@^0.4.0:
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
axios@^0.21.0: axios@^0.24.0:
version "0.21.4" version "0.24.0"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" resolved "https://registry.yarnpkg.com/axios/-/axios-0.24.0.tgz#804e6fa1e4b9c5288501dd9dff56a7a0940d20d6"
integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== integrity sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==
dependencies: dependencies:
follow-redirects "^1.14.0" follow-redirects "^1.14.4"
base32-decode@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/base32-decode/-/base32-decode-1.0.0.tgz#2a821d6a664890c872f20aa9aca95a4b4b80e2a7"
integrity sha512-KNWUX/R7wKenwE/G/qFMzGScOgVntOmbE27vvc6GrniDGYb6a5+qWcuoXl8WIOQL7q0TpK7nZDm1Y04Yi3Yn5g==
base32-encode@^1.1.1: base32-encode@^1.1.1:
version "1.2.0" version "1.2.0"
@ -125,6 +123,11 @@ body-parser@1.19.0:
raw-body "2.4.0" raw-body "2.4.0"
type-is "~1.6.17" type-is "~1.6.17"
buffer-from@^0.1.1:
version "0.1.2"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-0.1.2.tgz#15f4b9bcef012044df31142c14333caf6e0260d0"
integrity sha512-RiWIenusJsmI2KcvqQABB83tLxCByE3upSP8QU3rJDMVFGPWLvPQJt/O1Su9moRWeH7d+Q2HYb68f6+v+tw2vg==
buffer@^6.0.1: buffer@^6.0.1:
version "6.0.3" version "6.0.3"
resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6"
@ -184,6 +187,14 @@ color-name@~1.1.4:
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
combine-errors@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/combine-errors/-/combine-errors-3.0.3.tgz#f4df6740083e5703a3181110c2b10551f003da86"
integrity sha1-9N9nQAg+VwOjGBEQwrEFUfAD2oY=
dependencies:
custom-error-instance "2.1.1"
lodash.uniqby "4.5.0"
combined-stream@^1.0.8: combined-stream@^1.0.8:
version "1.0.8" version "1.0.8"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
@ -213,6 +224,11 @@ cookie@0.4.0:
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba"
integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==
custom-error-instance@2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/custom-error-instance/-/custom-error-instance-2.1.1.tgz#3cf6391487a6629a6247eb0ca0ce00081b7e361a"
integrity sha1-PPY5FIemYppiR+sMoM4ACBt+Nho=
debug@2.6.9: debug@2.6.9:
version "2.6.9" version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
@ -338,10 +354,10 @@ finalhandler@~1.1.2:
statuses "~1.5.0" statuses "~1.5.0"
unpipe "~1.0.0" unpipe "~1.0.0"
follow-redirects@^1.14.0: follow-redirects@^1.14.4:
version "1.14.3" version "1.14.5"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.3.tgz#6ada78118d8d24caee595595accdc0ac6abd022e" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.5.tgz#f09a5848981d3c772b5392309778523f8d85c381"
integrity sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw== integrity sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==
form-data@^4.0.0: form-data@^4.0.0:
version "4.0.0" version "4.0.0"
@ -391,7 +407,7 @@ got@^11.8.2:
p-cancelable "^2.0.0" p-cancelable "^2.0.0"
responselike "^2.0.0" responselike "^2.0.0"
graceful-fs@^4.1.3, graceful-fs@^4.2.8: graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.2.8:
version "4.2.8" version "4.2.8"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a"
integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==
@ -496,6 +512,11 @@ is-typedarray@^1.0.0:
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
js-base64@^2.6.1:
version "2.6.4"
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.6.4.tgz#f4e686c5de1ea1f867dbcad3d46d969428df98c4"
integrity sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==
json-buffer@3.0.1: json-buffer@3.0.1:
version "3.0.1" version "3.0.1"
resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13"
@ -508,6 +529,56 @@ keyv@^4.0.0:
dependencies: dependencies:
json-buffer "3.0.1" json-buffer "3.0.1"
lodash._baseiteratee@~4.7.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/lodash._baseiteratee/-/lodash._baseiteratee-4.7.0.tgz#34a9b5543572727c3db2e78edae3c0e9e66bd102"
integrity sha1-NKm1VDVycnw9sueO2uPA6eZr0QI=
dependencies:
lodash._stringtopath "~4.8.0"
lodash._basetostring@~4.12.0:
version "4.12.0"
resolved "https://registry.yarnpkg.com/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz#9327c9dc5158866b7fa4b9d42f4638e5766dd9df"
integrity sha1-kyfJ3FFYhmt/pLnUL0Y45XZt2d8=
lodash._baseuniq@~4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8"
integrity sha1-DrtE5FaBSveQXGIS+iybLVG4Qeg=
dependencies:
lodash._createset "~4.0.0"
lodash._root "~3.0.0"
lodash._createset@~4.0.0:
version "4.0.3"
resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26"
integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY=
lodash._root@~3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692"
integrity sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=
lodash._stringtopath@~4.8.0:
version "4.8.0"
resolved "https://registry.yarnpkg.com/lodash._stringtopath/-/lodash._stringtopath-4.8.0.tgz#941bcf0e64266e5fc1d66fed0a6959544c576824"
integrity sha1-lBvPDmQmbl/B1m/tCmlZVExXaCQ=
dependencies:
lodash._basetostring "~4.12.0"
lodash.throttle@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"
integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=
lodash.uniqby@4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.uniqby/-/lodash.uniqby-4.5.0.tgz#a3a17bbf62eeb6240f491846e97c1c4e2a5e1e21"
integrity sha1-o6F7v2LutiQPSRhG6XwcTipeHiE=
dependencies:
lodash._baseiteratee "~4.7.0"
lodash._baseuniq "~4.6.0"
lodash@4, lodash@^4.17.21: lodash@4, lodash@^4.17.21:
version "4.17.21" version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
@ -544,17 +615,17 @@ methods@~1.1.2:
resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee"
integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=
mime-db@1.48.0: mime-db@1.50.0:
version "1.48.0" version "1.50.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.48.0.tgz#e35b31045dd7eada3aaad537ed88a33afbef2d1d" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.50.0.tgz#abd4ac94e98d3c0e185016c67ab45d5fde40c11f"
integrity sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ== integrity sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==
mime-types@^2.1.12, mime-types@~2.1.24: mime-types@^2.1.12, mime-types@~2.1.24:
version "2.1.31" version "2.1.33"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.31.tgz#a00d76b74317c61f9c2db2218b8e9f8e9c5c9e6b" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.33.tgz#1fa12a904472fafd068e48d9e8401f74d3f70edb"
integrity sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg== integrity sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==
dependencies: dependencies:
mime-db "1.48.0" mime-db "1.50.0"
mime@1.6.0: mime@1.6.0:
version "1.6.0" version "1.6.0"
@ -635,11 +706,24 @@ pify@^3.0.0:
resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=
post-me@^0.4.5:
version "0.4.5"
resolved "https://registry.yarnpkg.com/post-me/-/post-me-0.4.5.tgz#6171b721c7b86230c51cfbe48ddea047ef8831ce"
integrity sha512-XgPdktF/2M5jglgVDULr9NUb/QNv3bY3g6RG22iTb5MIMtB07/5FJB5fbVmu5Eaopowc6uZx7K3e7x1shPwnXw==
prettier@^2.4.1: prettier@^2.4.1:
version "2.4.1" version "2.4.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c"
integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==
proper-lockfile@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/proper-lockfile/-/proper-lockfile-2.0.1.tgz#159fb06193d32003f4b3691dd2ec1a634aa80d1d"
integrity sha1-FZ+wYZPTIAP0s2kd0uwaY0qoDR0=
dependencies:
graceful-fs "^4.1.2"
retry "^0.10.0"
proxy-addr@~2.0.5: proxy-addr@~2.0.5:
version "2.0.7" version "2.0.7"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025"
@ -693,11 +777,6 @@ raw-body@2.4.0:
iconv-lite "0.4.24" iconv-lite "0.4.24"
unpipe "1.0.0" unpipe "1.0.0"
regenerator-runtime@^0.13.4:
version "0.13.9"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52"
integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==
require-directory@^2.1.1: require-directory@^2.1.1:
version "2.1.1" version "2.1.1"
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
@ -709,9 +788,9 @@ requires-port@^1.0.0:
integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=
resolve-alpn@^1.0.0: resolve-alpn@^1.0.0:
version "1.2.0" version "1.2.1"
resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.0.tgz#058bb0888d1cd4d12474e9a4b6eb17bdd5addc44" resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9"
integrity sha512-e4FNQs+9cINYMO5NMFc6kOUCdohjqFPSgMuwuZAOUWqrfWsen+Yjy5qZFkV5K7VO7tFSLKcUL97olkED7sCBHA== integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==
responselike@^2.0.0: responselike@^2.0.0:
version "2.0.0" version "2.0.0"
@ -720,6 +799,11 @@ responselike@^2.0.0:
dependencies: dependencies:
lowercase-keys "^2.0.0" lowercase-keys "^2.0.0"
retry@^0.10.0:
version "0.10.1"
resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4"
integrity sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=
safe-buffer@5.1.2: safe-buffer@5.1.2:
version "5.1.2" version "5.1.2"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
@ -770,33 +854,43 @@ setprototypeof@1.1.1:
integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==
signal-exit@^3.0.2: signal-exit@^3.0.2:
version "3.0.3" version "3.0.5"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.5.tgz#9e3e8cc0c75a99472b44321033a7702e7738252f"
integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== integrity sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==
sjcl@^1.0.8: sjcl@^1.0.8:
version "1.0.8" version "1.0.8"
resolved "https://registry.yarnpkg.com/sjcl/-/sjcl-1.0.8.tgz#f2ec8d7dc1f0f21b069b8914a41a8f236b0e252a" resolved "https://registry.yarnpkg.com/sjcl/-/sjcl-1.0.8.tgz#f2ec8d7dc1f0f21b069b8914a41a8f236b0e252a"
integrity sha512-LzIjEQ0S0DpIgnxMEayM1rq9aGwGRG4OnZhCdjx7glTaJtf4zRfpg87ImfjSJjoW9vKpagd82McDOwbRT5kQKQ== integrity sha512-LzIjEQ0S0DpIgnxMEayM1rq9aGwGRG4OnZhCdjx7glTaJtf4zRfpg87ImfjSJjoW9vKpagd82McDOwbRT5kQKQ==
skynet-js@^3.0.2: skynet-js@^4.0.19-beta:
version "3.0.2" version "4.0.19-beta"
resolved "https://registry.yarnpkg.com/skynet-js/-/skynet-js-3.0.2.tgz#d08a33066ee85b86e4ffc7c31591239a88da6fbe" resolved "https://registry.yarnpkg.com/skynet-js/-/skynet-js-4.0.19-beta.tgz#d4c640898c79cf69e45aa1c3c1ed5c80aa1aeced"
integrity sha512-rbmpOGbDwg2FcsZ7HkmGhVaUwWO6kaysRFKTBC3yGiV+b6fbnpPPNCskvh8kWwbTsj+koWkSRUFYqG7cc+eTuA== integrity sha512-d8/q3E3OjUxgCCAW28gNFvbahj0ks8ym122XTopbRyvAZKk9+/Z4ians9v8Tov36Z4k/un+Ilw/0i6DtM8c8Dw==
dependencies: dependencies:
"@babel/runtime" "^7.11.2" axios "^0.24.0"
axios "^0.21.0" base32-decode "^1.0.0"
base32-encode "^1.1.1" base32-encode "^1.1.1"
base64-js "^1.3.1" base64-js "^1.3.1"
blakejs "^1.1.0" blakejs "^1.1.0"
buffer "^6.0.1" buffer "^6.0.1"
mime "^2.5.2" mime "^2.5.2"
path-browserify "^1.0.1" path-browserify "^1.0.1"
post-me "^0.4.5"
randombytes "^2.1.0" randombytes "^2.1.0"
sjcl "^1.0.8" sjcl "^1.0.8"
skynet-mysky-utils "^0.3.0"
tus-js-client "^2.2.0"
tweetnacl "^1.0.3" tweetnacl "^1.0.3"
url-join "^4.0.1" url-join "^4.0.1"
url-parse "^1.4.7" url-parse "^1.5.1"
skynet-mysky-utils@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/skynet-mysky-utils/-/skynet-mysky-utils-0.3.0.tgz#87fdc0a5f8547cf660280ef86b7a762269919bad"
integrity sha512-X9L6SrVTdwTUFook/E6zUWCOpXHdyspLAu0elQbbPkZCWeFpr/XXTMbiyPV3m1liYsesngAKxzaSqylaTWOGUA==
dependencies:
post-me "^0.4.5"
"statuses@>= 1.5.0 < 2", statuses@~1.5.0: "statuses@>= 1.5.0 < 2", statuses@~1.5.0:
version "1.5.0" version "1.5.0"
@ -811,20 +905,20 @@ steno@^0.4.1:
graceful-fs "^4.1.3" graceful-fs "^4.1.3"
string-width@^4.1.0, string-width@^4.2.0: string-width@^4.1.0, string-width@^4.2.0:
version "4.2.2" version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies: dependencies:
emoji-regex "^8.0.0" emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0" is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.0" strip-ansi "^6.0.1"
strip-ansi@^6.0.0: strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.0" version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies: dependencies:
ansi-regex "^5.0.0" ansi-regex "^5.0.1"
"testing-corpus@https://github.com/SkynetLabs/testing-corpus": "testing-corpus@https://github.com/SkynetLabs/testing-corpus":
version "1.0.0" version "1.0.0"
@ -843,6 +937,19 @@ toidentifier@1.0.0:
resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553"
integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==
tus-js-client@^2.2.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/tus-js-client/-/tus-js-client-2.3.0.tgz#5d76145476cea46a4e7c045a0054637cddf8dc39"
integrity sha512-I4cSwm6N5qxqCmBqenvutwSHe9ntf81lLrtf6BmLpG2v4wTl89atCQKqGgqvkodE6Lx+iKIjMbaXmfvStTg01g==
dependencies:
buffer-from "^0.1.1"
combine-errors "^3.0.3"
is-stream "^2.0.0"
js-base64 "^2.6.1"
lodash.throttle "^4.1.1"
proper-lockfile "^2.0.1"
url-parse "^1.4.3"
tweetnacl@^1.0.3: tweetnacl@^1.0.3:
version "1.0.3" version "1.0.3"
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596"
@ -878,7 +985,7 @@ url-join@^4.0.1:
resolved "https://registry.yarnpkg.com/url-join/-/url-join-4.0.1.tgz#b642e21a2646808ffa178c4c5fda39844e12cde7" resolved "https://registry.yarnpkg.com/url-join/-/url-join-4.0.1.tgz#b642e21a2646808ffa178c4c5fda39844e12cde7"
integrity sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA== integrity sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==
url-parse@^1.4.7: url-parse@^1.4.3, url-parse@^1.5.1:
version "1.5.3" version "1.5.3"
resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.3.tgz#71c1303d38fb6639ade183c2992c8cc0686df862" resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.3.tgz#71c1303d38fb6639ade183c2992c8cc0686df862"
integrity sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ== integrity sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ==

View File

@ -1,4 +1,4 @@
FROM node:16.10.0-alpine FROM node:16.13.0-alpine
RUN apk update && apk add autoconf automake build-base libtool nasm pkgconfig RUN apk update && apk add autoconf automake build-base libtool nasm pkgconfig

View File

@ -9,24 +9,24 @@
"@fontsource/source-sans-pro": "^4.5.0", "@fontsource/source-sans-pro": "^4.5.0",
"@svgr/webpack": "^5.5.0", "@svgr/webpack": "^5.5.0",
"@tailwindcss/typography": "^0.4.1", "@tailwindcss/typography": "^0.4.1",
"autoprefixer": "^10.3.6", "autoprefixer": "^10.4.0",
"bytes": "^3.1.0", "bytes": "^3.1.0",
"classnames": "^2.3.1", "classnames": "^2.3.1",
"copy-text-to-clipboard": "^3.0.1", "copy-text-to-clipboard": "^3.0.1",
"crypto-browserify": "^3.12.0", "crypto-browserify": "^3.12.0",
"framer-motion": "^4.1.17", "framer-motion": "^5.2.1",
"gatsby": "^3.14.1", "gatsby": "^3.14.5",
"gatsby-background-image": "^1.5.3", "gatsby-background-image": "^1.5.3",
"gatsby-image": "^3.11.0", "gatsby-image": "^3.11.0",
"gatsby-plugin-image": "^1.14.0", "gatsby-plugin-image": "^1.14.1",
"gatsby-plugin-manifest": "^3.14.0", "gatsby-plugin-manifest": "^3.14.0",
"gatsby-plugin-matomo": "^0.10.0", "gatsby-plugin-matomo": "^0.10.0",
"gatsby-plugin-offline": "^4.14.0", "gatsby-plugin-offline": "^4.14.0",
"gatsby-plugin-postcss": "^4.14.0", "gatsby-plugin-postcss": "^4.14.0",
"gatsby-plugin-purgecss": "^6.0.2", "gatsby-plugin-purgecss": "^6.1.0",
"gatsby-plugin-react-helmet": "^4.14.0", "gatsby-plugin-react-helmet": "^4.14.0",
"gatsby-plugin-robots-txt": "^1.6.10", "gatsby-plugin-robots-txt": "^1.6.14",
"gatsby-plugin-sharp": "^3.14.0", "gatsby-plugin-sharp": "^4.1.0",
"gatsby-plugin-svgr": "^3.0.0-beta.0", "gatsby-plugin-svgr": "^3.0.0-beta.0",
"gatsby-remark-classes": "^1.0.2", "gatsby-remark-classes": "^1.0.2",
"gatsby-remark-copy-linked-files": "^4.11.0", "gatsby-remark-copy-linked-files": "^4.11.0",
@ -43,12 +43,12 @@
"http-status-codes": "^2.1.4", "http-status-codes": "^2.1.4",
"jsonp": "^0.2.1", "jsonp": "^0.2.1",
"ms": "^2.1.2", "ms": "^2.1.2",
"nanoid": "^3.1.28", "nanoid": "^3.1.30",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"path-browserify": "^1.0.1", "path-browserify": "^1.0.1",
"polished": "^4.1.3", "polished": "^4.1.3",
"popmotion": "^10.0.1", "popmotion": "^11.0.0",
"postcss": "^8.3.8", "postcss": "^8.3.11",
"preact-svg-loader": "^0.2.1", "preact-svg-loader": "^0.2.1",
"prop-types": "^15.7.2", "prop-types": "^15.7.2",
"react": "^17.0.2", "react": "^17.0.2",
@ -59,14 +59,14 @@
"react-svg-loader": "^3.0.3", "react-svg-loader": "^3.0.3",
"react-syntax-highlighter": "^15.4.4", "react-syntax-highlighter": "^15.4.4",
"react-use": "^17.3.1", "react-use": "^17.3.1",
"skynet-js": "^4.0.11-beta", "skynet-js": "^4.0.19-beta",
"stream-browserify": "^3.0.0", "stream-browserify": "^3.0.0",
"swr": "^1.0.1", "swr": "^1.0.1",
"tailwindcss": "^2.2.16" "tailwindcss": "^2.2.19"
}, },
"devDependencies": { "devDependencies": {
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"cypress": "^8.5.0", "cypress": "^8.7.0",
"cypress-file-upload": "^5.0.8", "cypress-file-upload": "^5.0.8",
"prettier": "^2.4.1" "prettier": "^2.4.1"
}, },

View File

@ -47,8 +47,9 @@ const Uploader = () => {
const handleDrop = async (files) => { const handleDrop = async (files) => {
if (mode === "directory" && files.length) { if (mode === "directory" && files.length) {
const name = getRootDirectory(files[0]); // get the file path from the first file const name = getRootDirectory(files[0]); // get the file path from the first file
const size = files.reduce((acc, file) => acc + file.size, 0);
files = [{ name, files }]; files = [{ name, size, files }];
} }
setUploads((uploads) => [...files.map((file) => ({ id: nanoid(), file, mode, status: "enqueued" })), ...uploads]); setUploads((uploads) => [...files.map((file) => ({ id: nanoid(), file, mode, status: "enqueued" })), ...uploads]);

View File

@ -85,7 +85,7 @@ export default function UploaderElement({ onUploadStateChange, upload }) {
if (upload.mode === "directory") { if (upload.mode === "directory") {
const files = upload.file.files; const files = upload.file.files;
const directory = files.reduce((acc, file) => ({ ...acc, [getRelativeFilePath(file)]: file }), {}); const directory = files.reduce((acc, file) => ({ ...acc, [getRelativeFilePath(file)]: file }), {});
const name = encodeURIComponent(upload.name); const name = encodeURIComponent(upload.file.name);
response = await client.uploadDirectory(directory, name, { onUploadProgress }); response = await client.uploadDirectory(directory, name, { onUploadProgress });
} else { } else {

View File

@ -2817,16 +2817,16 @@ attr-accept@^2.2.1:
resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-2.2.2.tgz#646613809660110749e92f2c10833b70968d929b" resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-2.2.2.tgz#646613809660110749e92f2c10833b70968d929b"
integrity sha512-7prDjvt9HmqiZ0cl5CRjtS84sEyhsHP2coDkaZKRKVfCDo9s7iw7ChVmar78Gu9pC4SoR/28wFu/G5JJhTnqEg== integrity sha512-7prDjvt9HmqiZ0cl5CRjtS84sEyhsHP2coDkaZKRKVfCDo9s7iw7ChVmar78Gu9pC4SoR/28wFu/G5JJhTnqEg==
autoprefixer@^10.2.4, autoprefixer@^10.3.6: autoprefixer@^10.2.4, autoprefixer@^10.4.0:
version "10.3.6" version "10.4.0"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.3.6.tgz#537c8a046e32ec46bfe528bcc9e2a5f2d87cd4c4" resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.0.tgz#c3577eb32a1079a440ec253e404eaf1eb21388c8"
integrity sha512-3bDjTfF0MfZntwVCSd18XAT2Zndufh3Mep+mafbzdIQEeWbncVRUVDjH8/EPANV9Hq40seJ24QcYAyhUsFz7gQ== integrity sha512-7FdJ1ONtwzV1G43GDD0kpVMn/qbiNqyOPMFTX5nRffI+7vgWoFEc6DcXOxHJxrWNDXrZh18eDsZjvZGUljSRGA==
dependencies: dependencies:
browserslist "^4.17.1" browserslist "^4.17.5"
caniuse-lite "^1.0.30001260" caniuse-lite "^1.0.30001272"
fraction.js "^4.1.1" fraction.js "^4.1.1"
nanocolors "^0.2.8"
normalize-range "^0.1.2" normalize-range "^0.1.2"
picocolors "^1.0.0"
postcss-value-parser "^4.1.0" postcss-value-parser "^4.1.0"
aws-sign2@~0.7.0: aws-sign2@~0.7.0:
@ -2844,13 +2844,20 @@ axe-core@^4.0.2:
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.3.3.tgz#b55cd8e8ddf659fe89b064680e1c6a4dceab0325" resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.3.3.tgz#b55cd8e8ddf659fe89b064680e1c6a4dceab0325"
integrity sha512-/lqqLAmuIPi79WYfRpy2i8z+x+vxU3zX2uAm0gs1q52qTuKwolOj1P8XbufpXcsydrpKx2yGn2wzAnxCMV86QA== integrity sha512-/lqqLAmuIPi79WYfRpy2i8z+x+vxU3zX2uAm0gs1q52qTuKwolOj1P8XbufpXcsydrpKx2yGn2wzAnxCMV86QA==
axios@^0.21.0, axios@^0.21.1, axios@^0.21.4: axios@^0.21.1, axios@^0.21.4:
version "0.21.4" version "0.21.4"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575"
integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==
dependencies: dependencies:
follow-redirects "^1.14.0" follow-redirects "^1.14.0"
axios@^0.24.0:
version "0.24.0"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.24.0.tgz#804e6fa1e4b9c5288501dd9dff56a7a0940d20d6"
integrity sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==
dependencies:
follow-redirects "^1.14.4"
axobject-query@^2.2.0: axobject-query@^2.2.0:
version "2.2.0" version "2.2.0"
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be"
@ -3280,16 +3287,16 @@ browserslist@4.14.2:
escalade "^3.0.2" escalade "^3.0.2"
node-releases "^1.1.61" node-releases "^1.1.61"
browserslist@^4.0.0, browserslist@^4.12.2, browserslist@^4.14.5, browserslist@^4.16.0, browserslist@^4.16.3, browserslist@^4.16.6, browserslist@^4.17.1: browserslist@^4.0.0, browserslist@^4.12.2, browserslist@^4.14.5, browserslist@^4.16.0, browserslist@^4.16.3, browserslist@^4.16.6, browserslist@^4.17.1, browserslist@^4.17.5:
version "4.17.1" version "4.17.5"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.1.tgz#a98d104f54af441290b7d592626dd541fa642eb9" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.5.tgz#c827bbe172a4c22b123f5e337533ceebadfdd559"
integrity sha512-aLD0ZMDSnF4lUt4ZDNgqi5BUn9BZ7YdQdI/cYlILrhdSSZJLU9aNZoD5/NBmM4SK34APB2e83MOsRt1EnkuyaQ== integrity sha512-I3ekeB92mmpctWBoLXe0d5wPS2cBuRvvW0JyyJHMrk9/HmP2ZjrTboNAZ8iuGqaEIlKguljbQY32OkOJIRrgoA==
dependencies: dependencies:
caniuse-lite "^1.0.30001259" caniuse-lite "^1.0.30001271"
electron-to-chromium "^1.3.846" electron-to-chromium "^1.3.878"
escalade "^3.1.1" escalade "^3.1.1"
nanocolors "^0.1.5" node-releases "^2.0.1"
node-releases "^1.1.76" picocolors "^1.0.0"
buffer-crc32@~0.2.3: buffer-crc32@~0.2.3:
version "0.2.13" version "0.2.13"
@ -3465,12 +3472,10 @@ caniuse-api@^3.0.0:
lodash.memoize "^4.1.2" lodash.memoize "^4.1.2"
lodash.uniq "^4.5.0" lodash.uniq "^4.5.0"
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001125, caniuse-lite@^1.0.30001259, caniuse-lite@^1.0.30001260: caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001125, caniuse-lite@^1.0.30001271, caniuse-lite@^1.0.30001272:
version "1.0.30001260" version "1.0.30001274"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001260.tgz#e3be3f34ddad735ca4a2736fa9e768ef34316270" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001274.tgz#26ca36204d15b17601ba6fc35dbdad950a647cc7"
integrity sha512-Fhjc/k8725ItmrvW5QomzxLeojewxvqiYCKeFcfFEhut28IVLdpHU19dneOmltZQIE5HNbawj1HYD+1f2bM1Dg== integrity sha512-+Nkvv0fHyhISkiMIjnyjmf5YJcQ1IQHZN6U9TLUMroWR38FNwpsC51Gb68yueafX1V6ifOisInSgP9WJFS13ew==
dependencies:
nanocolors "^0.1.0"
caseless@~0.12.0: caseless@~0.12.0:
version "0.12.0" version "0.12.0"
@ -4360,10 +4365,10 @@ cypress-file-upload@^5.0.8:
resolved "https://registry.yarnpkg.com/cypress-file-upload/-/cypress-file-upload-5.0.8.tgz#d8824cbeaab798e44be8009769f9a6c9daa1b4a1" resolved "https://registry.yarnpkg.com/cypress-file-upload/-/cypress-file-upload-5.0.8.tgz#d8824cbeaab798e44be8009769f9a6c9daa1b4a1"
integrity sha512-+8VzNabRk3zG6x8f8BWArF/xA/W0VK4IZNx3MV0jFWrJS/qKn8eHfa5nU73P9fOQAgwHFJx7zjg4lwOnljMO8g== integrity sha512-+8VzNabRk3zG6x8f8BWArF/xA/W0VK4IZNx3MV0jFWrJS/qKn8eHfa5nU73P9fOQAgwHFJx7zjg4lwOnljMO8g==
cypress@^8.5.0: cypress@^8.7.0:
version "8.5.0" version "8.7.0"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-8.5.0.tgz#5712ca170913f8344bf167301205c4217c1eb9bd" resolved "https://registry.yarnpkg.com/cypress/-/cypress-8.7.0.tgz#2ee371f383d8f233d3425b6cc26ddeec2668b6da"
integrity sha512-MMkXIS+Ro2KETn4gAlG3tIc/7FiljuuCZP0zpd9QsRG6MZSyZW/l1J3D4iQM6WHsVxuX4rFChn5jPFlC2tNSvQ== integrity sha512-b1bMC3VQydC6sXzBMFnSqcvwc9dTZMgcaOzT0vpSD+Gq1yFc+72JDWi55sfUK5eIeNLAtWOGy1NNb6UlhMvB+Q==
dependencies: dependencies:
"@cypress/request" "^2.88.6" "@cypress/request" "^2.88.6"
"@cypress/xvfb" "^1.2.4" "@cypress/xvfb" "^1.2.4"
@ -4838,11 +4843,16 @@ ee-first@1.1.1:
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
electron-to-chromium@^1.3.564, electron-to-chromium@^1.3.846: electron-to-chromium@^1.3.564:
version "1.3.850" version "1.3.850"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.850.tgz#c56c72abfeab051b4b328beb894461c5912d0456" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.850.tgz#c56c72abfeab051b4b328beb894461c5912d0456"
integrity sha512-ZzkDcdzePeF4dhoGZQT77V2CyJOpwfTZEOg4h0x6R/jQhGt/rIRpbRyVreWLtD7B/WsVxo91URm2WxMKR9JQZA== integrity sha512-ZzkDcdzePeF4dhoGZQT77V2CyJOpwfTZEOg4h0x6R/jQhGt/rIRpbRyVreWLtD7B/WsVxo91URm2WxMKR9JQZA==
electron-to-chromium@^1.3.878:
version "1.3.885"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.885.tgz#c8cec32fbc61364127849ae00f2395a1bae7c454"
integrity sha512-JXKFJcVWrdHa09n4CNZYfYaK6EW5aAew7/wr3L1OnsD1L+JHL+RCtd7QgIsxUbFPeTwPlvnpqNNTOLkoefmtXg==
elliptic@^6.5.3: elliptic@^6.5.3:
version "6.5.4" version "6.5.4"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb"
@ -5780,6 +5790,11 @@ follow-redirects@^1.0.0, follow-redirects@^1.14.0:
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.4.tgz#838fdf48a8bbdd79e52ee51fb1c94e3ed98b9379" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.4.tgz#838fdf48a8bbdd79e52ee51fb1c94e3ed98b9379"
integrity sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g== integrity sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==
follow-redirects@^1.14.4:
version "1.14.5"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.5.tgz#f09a5848981d3c772b5392309778523f8d85c381"
integrity sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==
for-in@^1.0.2: for-in@^1.0.2:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
@ -5852,30 +5867,23 @@ fragment-cache@^0.2.1:
dependencies: dependencies:
map-cache "^0.2.2" map-cache "^0.2.2"
framer-motion@^4.1.17: framer-motion@^5.2.1:
version "4.1.17" version "5.2.1"
resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-4.1.17.tgz#4029469252a62ea599902e5a92b537120cc89721" resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-5.2.1.tgz#5cfa59984649d73e3741d7bf189918f34fd3635e"
integrity sha512-thx1wvKzblzbs0XaK2X0G1JuwIdARcoNOW7VVwjO8BUltzXPyONGAElLu6CiCScsOQRI7FIk/45YTFtJw5Yozw== integrity sha512-igeMZaa0FnaB4NkCE+/ENGSuSvhRhUVFJCwWg/FGQn+CwnLPI/XjO6Zim8m+pN+4wBNlaesBRpqOQbq/VH7mew==
dependencies: dependencies:
framesync "5.3.0" framesync "6.0.1"
hey-listen "^1.0.8" hey-listen "^1.0.8"
popmotion "9.3.6" popmotion "11.0.0"
style-value-types "4.1.4" style-value-types "5.0.0"
tslib "^2.1.0" tslib "^2.1.0"
optionalDependencies: optionalDependencies:
"@emotion/is-prop-valid" "^0.8.2" "@emotion/is-prop-valid" "^0.8.2"
framesync@5.3.0: framesync@6.0.1, framesync@^6.0.1:
version "5.3.0" version "6.0.1"
resolved "https://registry.yarnpkg.com/framesync/-/framesync-5.3.0.tgz#0ecfc955e8f5a6ddc8fdb0cc024070947e1a0d9b" resolved "https://registry.yarnpkg.com/framesync/-/framesync-6.0.1.tgz#5e32fc01f1c42b39c654c35b16440e07a25d6f20"
integrity sha512-oc5m68HDO/tuK2blj7ZcdEBRx3p1PjrgHazL8GYEpvULhrtGIFbQArN6cQS2QhW8mitffaB+VYzMjDqBxxQeoA== integrity sha512-fUY88kXvGiIItgNC7wcTOl0SNRCVXMKSWW2Yzfmn7EKNc+MpCzcz9DhdHcdjbrtN3c6R4H5dTY2jiCpPdysEjA==
dependencies:
tslib "^2.1.0"
framesync@6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/framesync/-/framesync-6.0.0.tgz#e6ad8ec128d33291a03cc34e58365c41265a1dae"
integrity sha512-9iBw/uZ/5fDURdpLrgc/eoFXiX9HC3DeOSLtTL5lZSyX/vQb+kjEz9CPNTiTObfK5PKyGgIUTstU8PK9W6EvoA==
dependencies: dependencies:
tslib "^2.1.0" tslib "^2.1.0"
@ -5958,10 +5966,10 @@ gatsby-background-image@^1.5.3:
short-uuid "^4.1.0" short-uuid "^4.1.0"
sort-media-queries "^0.2.2" sort-media-queries "^0.2.2"
gatsby-cli@^3.14.0: gatsby-cli@^3.14.2:
version "3.14.0" version "3.14.2"
resolved "https://registry.yarnpkg.com/gatsby-cli/-/gatsby-cli-3.14.0.tgz#98fc989062d9956e26304b1c3eac33cd4b5fda70" resolved "https://registry.yarnpkg.com/gatsby-cli/-/gatsby-cli-3.14.2.tgz#1d4ebeb199c3a910d80abc13f458888c8cd7f2f8"
integrity sha512-1Az1EEQu0txRE8eZmOo9GOxRSjhJtFseinraiIEtSeHkYuM0/gjuoKVSrtmbBFNWdOZll6QYCO3sRl6sOrwb+g== integrity sha512-p3E6XyzwVPGpHd0AYVkvnPkZoEElWLWjAG10173k5aGtpoM6dIuJuSlgBPrjeev9PQ7y3oCoCO3zBjnGdB1/WQ==
dependencies: dependencies:
"@babel/code-frame" "^7.14.0" "@babel/code-frame" "^7.14.0"
"@babel/runtime" "^7.15.4" "@babel/runtime" "^7.15.4"
@ -6019,6 +6027,22 @@ gatsby-core-utils@^2.14.0:
tmp "^0.2.1" tmp "^0.2.1"
xdg-basedir "^4.0.0" xdg-basedir "^4.0.0"
gatsby-core-utils@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/gatsby-core-utils/-/gatsby-core-utils-3.1.0.tgz#bf01ebd78046606ac812591319b450516f75b448"
integrity sha512-ErgJr5xgjUoorhCVeyMyNfnZhxBTA33KRB/aFtFWNeTXFsUNlDZBqheSp2XAaD3+gvAmDqbz2m+jKF1sI8vLAg==
dependencies:
"@babel/runtime" "^7.15.4"
ci-info "2.0.0"
configstore "^5.0.1"
file-type "^16.5.3"
fs-extra "^10.0.0"
got "^11.8.2"
node-object-hash "^2.3.9"
proper-lockfile "^4.1.2"
tmp "^0.2.1"
xdg-basedir "^4.0.0"
gatsby-graphiql-explorer@^1.14.0: gatsby-graphiql-explorer@^1.14.0:
version "1.14.0" version "1.14.0"
resolved "https://registry.yarnpkg.com/gatsby-graphiql-explorer/-/gatsby-graphiql-explorer-1.14.0.tgz#2049d6b2cf1612c80faf3983c72a41cb9d6bb116" resolved "https://registry.yarnpkg.com/gatsby-graphiql-explorer/-/gatsby-graphiql-explorer-1.14.0.tgz#2049d6b2cf1612c80faf3983c72a41cb9d6bb116"
@ -6066,10 +6090,10 @@ gatsby-page-utils@^1.14.0:
lodash "^4.17.21" lodash "^4.17.21"
micromatch "^4.0.4" micromatch "^4.0.4"
gatsby-plugin-image@^1.14.0: gatsby-plugin-image@^1.14.1:
version "1.14.0" version "1.14.1"
resolved "https://registry.yarnpkg.com/gatsby-plugin-image/-/gatsby-plugin-image-1.14.0.tgz#b6d3c14b280b150ad32b3975e90e685b50365bf4" resolved "https://registry.yarnpkg.com/gatsby-plugin-image/-/gatsby-plugin-image-1.14.1.tgz#5d40dd35be4bab41e8dd5b9207e9b2485c734f6e"
integrity sha512-o5D4k4OQDdzXQu1VUWM4TLmi86D2fnGNxLKc/SgvGiqCr8e/opNJcWHELU52XQ11zqSU0jzOkDRQGu9tWesRlg== integrity sha512-3ZiCFyIVjWxlpral04HlFZbeWC4Eoo7DYGA/Eh3qNMZ3tPKxySk4xXUdrnhIt967KBGATFuuYnPR9kKEHatCuQ==
dependencies: dependencies:
"@babel/code-frame" "^7.14.0" "@babel/code-frame" "^7.14.0"
"@babel/parser" "^7.15.5" "@babel/parser" "^7.15.5"
@ -6139,10 +6163,10 @@ gatsby-plugin-postcss@^4.14.0:
"@babel/runtime" "^7.15.4" "@babel/runtime" "^7.15.4"
postcss-loader "^4.3.0" postcss-loader "^4.3.0"
gatsby-plugin-purgecss@^6.0.2: gatsby-plugin-purgecss@^6.1.0:
version "6.0.2" version "6.1.0"
resolved "https://registry.yarnpkg.com/gatsby-plugin-purgecss/-/gatsby-plugin-purgecss-6.0.2.tgz#31f7b3c8a1e1d5ee8df0350f5339c0d78360479f" resolved "https://registry.yarnpkg.com/gatsby-plugin-purgecss/-/gatsby-plugin-purgecss-6.1.0.tgz#de5f90c67f2e567c6739941ec31b1228caa3e595"
integrity sha512-7LefFqQ9ZGqcmgE3wWbFdOna7lIUTAiS1KISmvAl5M25u2IKreN1Yj7xbOF1RVz8Ta6ClAmTtc9fgNCWlr7oKQ== integrity sha512-uykab5jWsUJDx4vhgim0UxIGY3i232dv5z/35nyCuc2KLyYgC3Vl1ptz/bh6fohlJaALZmAOiIoaShDMxvZUEQ==
dependencies: dependencies:
fs-extra "^9.0.1" fs-extra "^9.0.1"
loader-utils "^2.0.0" loader-utils "^2.0.0"
@ -6156,27 +6180,27 @@ gatsby-plugin-react-helmet@^4.14.0:
dependencies: dependencies:
"@babel/runtime" "^7.15.4" "@babel/runtime" "^7.15.4"
gatsby-plugin-robots-txt@^1.6.10: gatsby-plugin-robots-txt@^1.6.14:
version "1.6.10" version "1.6.14"
resolved "https://registry.yarnpkg.com/gatsby-plugin-robots-txt/-/gatsby-plugin-robots-txt-1.6.10.tgz#b178efe3da65718a39d1acd2e5768f687b205cf0" resolved "https://registry.yarnpkg.com/gatsby-plugin-robots-txt/-/gatsby-plugin-robots-txt-1.6.14.tgz#e7ce50b137fecc81c1ac384ddc544a4bafd8da89"
integrity sha512-soQT765LF0J8/dfrZGFuA/ZB/JUyvt2nVyHEFLUMd/qxgiem9x0EOZquJPId78xDHYePMkxNCPk9UsLcTZdFZw== integrity sha512-5NLdgKPw7xHjvowNDU5aWzl/g3M3WU0Equn73aXGGdEue9Nuq7zh/Lh3oX+OM+MZolRCiM9GNHxdIvYPDWNXgA==
dependencies: dependencies:
"@babel/runtime" "^7.14.0" "@babel/runtime" "^7.15.4"
generate-robotstxt "^8.0.3" generate-robotstxt "^8.0.3"
gatsby-plugin-sharp@^3.14.0: gatsby-plugin-sharp@^4.1.0:
version "3.14.0" version "4.1.0"
resolved "https://registry.yarnpkg.com/gatsby-plugin-sharp/-/gatsby-plugin-sharp-3.14.0.tgz#e087b37d03704e019803439adfb7696339b2262d" resolved "https://registry.yarnpkg.com/gatsby-plugin-sharp/-/gatsby-plugin-sharp-4.1.0.tgz#1757c6de4561345d4d5a9ff42ba9b130be399d86"
integrity sha512-i4jrmOElr0mB2tWlpfxzX72zimiheGny0GF+jPPYY77Uoie43AH7GGZm6wyhdtqKlphYDhgatOMU7xeiWQar6g== integrity sha512-tft2KEf/4cFRmdpEgIgSJIHQw9yEX7Ns80eiMACGj6rI3POABXhk4+MrRvSpD89JIVzhqu+Muzu+W7JPcqc7ig==
dependencies: dependencies:
"@babel/runtime" "^7.15.4" "@babel/runtime" "^7.15.4"
async "^3.2.1" async "^3.2.1"
bluebird "^3.7.2" bluebird "^3.7.2"
filenamify "^4.3.0" filenamify "^4.3.0"
fs-extra "^10.0.0" fs-extra "^10.0.0"
gatsby-core-utils "^2.14.0" gatsby-core-utils "^3.1.0"
gatsby-plugin-utils "^1.14.0" gatsby-plugin-utils "^2.1.0"
gatsby-telemetry "^2.14.0" gatsby-telemetry "^3.1.0"
got "^11.8.2" got "^11.8.2"
lodash "^4.17.21" lodash "^4.17.21"
mini-svg-data-uri "^1.3.3" mini-svg-data-uri "^1.3.3"
@ -6184,7 +6208,7 @@ gatsby-plugin-sharp@^3.14.0:
probe-image-size "^6.0.0" probe-image-size "^6.0.0"
progress "^2.0.3" progress "^2.0.3"
semver "^7.3.5" semver "^7.3.5"
sharp "^0.29.0" sharp "^0.29.1"
svgo "1.3.2" svgo "1.3.2"
uuid "3.4.0" uuid "3.4.0"
@ -6214,6 +6238,14 @@ gatsby-plugin-utils@^1.14.0:
"@babel/runtime" "^7.15.4" "@babel/runtime" "^7.15.4"
joi "^17.4.2" joi "^17.4.2"
gatsby-plugin-utils@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/gatsby-plugin-utils/-/gatsby-plugin-utils-2.1.0.tgz#90aaf61fa60d5d4c1730c7b204eb3fbc645da0c0"
integrity sha512-sJZWsiLhYOuBN56LCX2Qy2ZDoQvqlY1TntXH8ns+zZHzglvVR28xI/iQEP7bVhzmkMX47i+E87o1/EET0RuK4A==
dependencies:
"@babel/runtime" "^7.15.4"
joi "^17.4.2"
gatsby-react-router-scroll@^4.14.0: gatsby-react-router-scroll@^4.14.0:
version "4.14.0" version "4.14.0"
resolved "https://registry.yarnpkg.com/gatsby-react-router-scroll/-/gatsby-react-router-scroll-4.14.0.tgz#8825c437f2ce07144dff2013f405b43af8159069" resolved "https://registry.yarnpkg.com/gatsby-react-router-scroll/-/gatsby-react-router-scroll-4.14.0.tgz#8825c437f2ce07144dff2013f405b43af8159069"
@ -6393,6 +6425,25 @@ gatsby-telemetry@^2.14.0:
node-fetch "^2.6.1" node-fetch "^2.6.1"
uuid "3.4.0" uuid "3.4.0"
gatsby-telemetry@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/gatsby-telemetry/-/gatsby-telemetry-3.1.0.tgz#326792d985619204ec2988ce61de1aa27351e81b"
integrity sha512-XoKh80BROhmtqbFXDhKxr66vYqxt23PfANqUhyFugHFfW+ETx33kTOS8t9IY23icrsqoo780vcx0nVFRjidWEg==
dependencies:
"@babel/code-frame" "^7.14.0"
"@babel/runtime" "^7.15.4"
"@turist/fetch" "^7.1.7"
"@turist/time" "^0.0.2"
async-retry-ng "^2.0.1"
boxen "^4.2.0"
configstore "^5.0.1"
fs-extra "^10.0.0"
gatsby-core-utils "^3.1.0"
git-up "^4.0.5"
is-docker "^2.2.1"
lodash "^4.17.21"
node-fetch "^2.6.5"
gatsby-transformer-json@^3.14.0: gatsby-transformer-json@^3.14.0:
version "3.14.0" version "3.14.0"
resolved "https://registry.yarnpkg.com/gatsby-transformer-json/-/gatsby-transformer-json-3.14.0.tgz#b1624a25e20f6bbf70181f5c1284e67abfac7c7a" resolved "https://registry.yarnpkg.com/gatsby-transformer-json/-/gatsby-transformer-json-3.14.0.tgz#b1624a25e20f6bbf70181f5c1284e67abfac7c7a"
@ -6461,10 +6512,10 @@ gatsby-worker@^0.5.0:
"@babel/core" "^7.15.5" "@babel/core" "^7.15.5"
"@babel/runtime" "^7.15.4" "@babel/runtime" "^7.15.4"
gatsby@^3.14.1: gatsby@^3.14.5:
version "3.14.1" version "3.14.5"
resolved "https://registry.yarnpkg.com/gatsby/-/gatsby-3.14.1.tgz#0b0edde45bedd18845ec338ca65b1e88d4de3384" resolved "https://registry.yarnpkg.com/gatsby/-/gatsby-3.14.5.tgz#917dfa512f83ec3feddca2f68b236ab70eeb8df7"
integrity sha512-6wt1MDMOfm6Zm8yiS8zDwjkth5spX7RorKKnYNNfZFyD0lztdql9jgAXFCxO0FxRDagDKxxfxj3cYyHHzPlalg== integrity sha512-j1Dvm6iIlUcfYXXNKZWULanOF7UI/01uRMbIBP10iqjJClv+ZbqnFnkwQKvFwLaC88h6jPcEIbR7kZFTqbfbZQ==
dependencies: dependencies:
"@babel/code-frame" "^7.14.0" "@babel/code-frame" "^7.14.0"
"@babel/core" "^7.15.5" "@babel/core" "^7.15.5"
@ -6533,7 +6584,7 @@ gatsby@^3.14.1:
find-cache-dir "^3.3.1" find-cache-dir "^3.3.1"
fs-exists-cached "1.0.0" fs-exists-cached "1.0.0"
fs-extra "^10.0.0" fs-extra "^10.0.0"
gatsby-cli "^3.14.0" gatsby-cli "^3.14.2"
gatsby-core-utils "^2.14.0" gatsby-core-utils "^2.14.0"
gatsby-graphiql-explorer "^1.14.0" gatsby-graphiql-explorer "^1.14.0"
gatsby-legacy-polyfills "^1.14.0" gatsby-legacy-polyfills "^1.14.0"
@ -6572,7 +6623,6 @@ gatsby@^3.14.1:
opentracing "^0.14.4" opentracing "^0.14.4"
p-defer "^3.0.0" p-defer "^3.0.0"
parseurl "^1.3.3" parseurl "^1.3.3"
path-to-regexp "0.1.7"
physical-cpu-count "^2.0.0" physical-cpu-count "^2.0.0"
platform "^1.3.6" platform "^1.3.6"
postcss "^8.3.5" postcss "^8.3.5"
@ -9393,20 +9443,20 @@ nano-css@^5.3.1:
stacktrace-js "^2.0.2" stacktrace-js "^2.0.2"
stylis "^4.0.6" stylis "^4.0.6"
nanocolors@^0.1.0, nanocolors@^0.1.12, nanocolors@^0.1.5: nanocolors@^0.1.12:
version "0.1.12" version "0.1.12"
resolved "https://registry.yarnpkg.com/nanocolors/-/nanocolors-0.1.12.tgz#8577482c58cbd7b5bb1681db4cf48f11a87fd5f6" resolved "https://registry.yarnpkg.com/nanocolors/-/nanocolors-0.1.12.tgz#8577482c58cbd7b5bb1681db4cf48f11a87fd5f6"
integrity sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ== integrity sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ==
nanocolors@^0.2.2, nanocolors@^0.2.8: nanocolors@^0.2.2:
version "0.2.10" version "0.2.10"
resolved "https://registry.yarnpkg.com/nanocolors/-/nanocolors-0.2.10.tgz#a712df4d3c1bf12d9b4fb8b5aa61b5ba31337503" resolved "https://registry.yarnpkg.com/nanocolors/-/nanocolors-0.2.10.tgz#a712df4d3c1bf12d9b4fb8b5aa61b5ba31337503"
integrity sha512-i+EDWGsJClQwR/bhLIG/CObZZwaYaS5qt+yjxZbfV+77QiNHNzE9nj4d9Ut1TGZ0R0eSwPcQWzReASzXuw/7oA== integrity sha512-i+EDWGsJClQwR/bhLIG/CObZZwaYaS5qt+yjxZbfV+77QiNHNzE9nj4d9Ut1TGZ0R0eSwPcQWzReASzXuw/7oA==
nanoid@^3.1.25, nanoid@^3.1.28: nanoid@^3.1.30:
version "3.1.28" version "3.1.30"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.28.tgz#3c01bac14cb6c5680569014cc65a2f26424c6bd4" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362"
integrity sha512-gSu9VZ2HtmoKYe/lmyPFES5nknFrHa+/DT9muUFWFMi6Jh9E1I7bkvlQ8xxf1Kos9pi9o8lBnIOkatMhKX/YUw== integrity sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ==
nanomatch@^1.2.9: nanomatch@^1.2.9:
version "1.2.13" version "1.2.13"
@ -9496,7 +9546,7 @@ node-abi@^2.21.0:
dependencies: dependencies:
semver "^5.4.1" semver "^5.4.1"
node-addon-api@^4.1.0: node-addon-api@^4.2.0:
version "4.2.0" version "4.2.0"
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-4.2.0.tgz#117cbb5a959dff0992e1c586ae0393573e4d2a87" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-4.2.0.tgz#117cbb5a959dff0992e1c586ae0393573e4d2a87"
integrity sha512-eazsqzwG2lskuzBqCGPi7Ac2UgOoMz8JVOXVhTvvPDYhthvNpefx8jWD8Np7Gv+2Sz0FlPWZk0nJV0z598Wn8Q== integrity sha512-eazsqzwG2lskuzBqCGPi7Ac2UgOoMz8JVOXVhTvvPDYhthvNpefx8jWD8Np7Gv+2Sz0FlPWZk0nJV0z598Wn8Q==
@ -9525,16 +9575,28 @@ node-fetch@^2.5.0, node-fetch@^2.6.1:
dependencies: dependencies:
whatwg-url "^5.0.0" whatwg-url "^5.0.0"
node-fetch@^2.6.5:
version "2.6.6"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.6.tgz#1751a7c01834e8e1697758732e9efb6eeadfaf89"
integrity sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA==
dependencies:
whatwg-url "^5.0.0"
node-object-hash@^2.3.9: node-object-hash@^2.3.9:
version "2.3.10" version "2.3.10"
resolved "https://registry.yarnpkg.com/node-object-hash/-/node-object-hash-2.3.10.tgz#4b0c1a3a8239e955f0db71f8e00b38b5c0b33992" resolved "https://registry.yarnpkg.com/node-object-hash/-/node-object-hash-2.3.10.tgz#4b0c1a3a8239e955f0db71f8e00b38b5c0b33992"
integrity sha512-jY5dPJzw6NHd/KPSfPKJ+IHoFS81/tJ43r34ZeNMXGzCOM8jwQDCD12HYayKIB6MuznrnqIYy2e891NA2g0ibA== integrity sha512-jY5dPJzw6NHd/KPSfPKJ+IHoFS81/tJ43r34ZeNMXGzCOM8jwQDCD12HYayKIB6MuznrnqIYy2e891NA2g0ibA==
node-releases@^1.1.61, node-releases@^1.1.76: node-releases@^1.1.61:
version "1.1.76" version "1.1.76"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.76.tgz#df245b062b0cafbd5282ab6792f7dccc2d97f36e" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.76.tgz#df245b062b0cafbd5282ab6792f7dccc2d97f36e"
integrity sha512-9/IECtNr8dXNmPWmFXepT0/7o5eolGesHUa3mtr0KlgnCvnZxwh2qensKL42JJY2vQKC3nIBXetFAqR+PW1CmA== integrity sha512-9/IECtNr8dXNmPWmFXepT0/7o5eolGesHUa3mtr0KlgnCvnZxwh2qensKL42JJY2vQKC3nIBXetFAqR+PW1CmA==
node-releases@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5"
integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==
normalize-package-data@^2.3.2, normalize-package-data@^2.5.0: normalize-package-data@^2.3.2, normalize-package-data@^2.5.0:
version "2.5.0" version "2.5.0"
resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8"
@ -10191,6 +10253,11 @@ physical-cpu-count@^2.0.0:
resolved "https://registry.yarnpkg.com/physical-cpu-count/-/physical-cpu-count-2.0.0.tgz#18de2f97e4bf7a9551ad7511942b5496f7aba660" resolved "https://registry.yarnpkg.com/physical-cpu-count/-/physical-cpu-count-2.0.0.tgz#18de2f97e4bf7a9551ad7511942b5496f7aba660"
integrity sha1-GN4vl+S/epVRrXURlCtUlverpmA= integrity sha1-GN4vl+S/epVRrXURlCtUlverpmA=
picocolors@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3:
version "2.3.0" version "2.3.0"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972"
@ -10263,22 +10330,12 @@ polished@^4.1.3:
dependencies: dependencies:
"@babel/runtime" "^7.14.0" "@babel/runtime" "^7.14.0"
popmotion@9.3.6: popmotion@11.0.0, popmotion@^11.0.0:
version "9.3.6" version "11.0.0"
resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-9.3.6.tgz#b5236fa28f242aff3871b9e23721f093133248d1" resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-11.0.0.tgz#910e2e7077d9aeba520db8744d40bb5354992212"
integrity sha512-ZTbXiu6zIggXzIliMi8LGxXBF5ST+wkpXGEjeTUDUOCdSQ356hij/xjeUdv0F8zCQNeqB1+PR5/BB+gC+QLAPw== integrity sha512-kJDyaG00TtcANP5JZ51od+DCqopxBm2a/Txh3Usu23L9qntjY5wumvcVf578N8qXEHR1a+jx9XCv8zOntdYalQ==
dependencies: dependencies:
framesync "5.3.0" framesync "^6.0.1"
hey-listen "^1.0.8"
style-value-types "4.1.4"
tslib "^2.1.0"
popmotion@^10.0.1:
version "10.0.1"
resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-10.0.1.tgz#5be5b80112a1386b7f2a11d081a1ea3ca7508d8e"
integrity sha512-jmVmbXMAl/qrrogQXCMGFR8+F290J6gl9kKHSYzAKBRTHm7B1unadmEeLSXX7rGtzPxOfKVnWHA3t3m3CVnxqw==
dependencies:
framesync "6.0.0"
hey-listen "^1.0.8" hey-listen "^1.0.8"
style-value-types "5.0.0" style-value-types "5.0.0"
tslib "^2.1.0" tslib "^2.1.0"
@ -10604,13 +10661,13 @@ postcss@^7.0.27:
nanocolors "^0.2.2" nanocolors "^0.2.2"
source-map "^0.6.1" source-map "^0.6.1"
postcss@^8.1.6, postcss@^8.2.1, postcss@^8.2.15, postcss@^8.2.9, postcss@^8.3.5, postcss@^8.3.8: postcss@^8.1.6, postcss@^8.2.1, postcss@^8.2.15, postcss@^8.2.9, postcss@^8.3.11, postcss@^8.3.5:
version "8.3.8" version "8.3.11"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.8.tgz#9ebe2a127396b4b4570ae9f7770e7fb83db2bac1" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.11.tgz#c3beca7ea811cd5e1c4a3ec6d2e7599ef1f8f858"
integrity sha512-GT5bTjjZnwDifajzczOC+r3FI3Cu+PgPvrsjhQdRqa2kTJ4968/X9CUce9xttIB0xOs5c6xf0TCWZo/y9lF6bA== integrity sha512-hCmlUAIlUiav8Xdqw3Io4LcpA1DOt7h3LSTAC4G6JGHFFaWzI6qvFt9oilvl8BmkbBRX1IhM90ZAmpk68zccQA==
dependencies: dependencies:
nanocolors "^0.2.2" nanoid "^3.1.30"
nanoid "^3.1.25" picocolors "^1.0.0"
source-map-js "^0.6.2" source-map-js "^0.6.2"
potrace@^2.1.8: potrace@^2.1.8:
@ -11906,14 +11963,14 @@ shallow-compare@^1.2.2:
resolved "https://registry.yarnpkg.com/shallow-compare/-/shallow-compare-1.2.2.tgz#fa4794627bf455a47c4f56881d8a6132d581ffdb" resolved "https://registry.yarnpkg.com/shallow-compare/-/shallow-compare-1.2.2.tgz#fa4794627bf455a47c4f56881d8a6132d581ffdb"
integrity sha512-LUMFi+RppPlrHzbqmFnINTrazo0lPNwhcgzuAXVVcfy/mqPDrQmHAyz5bvV0gDAuRFrk804V0HpQ6u9sZ0tBeg== integrity sha512-LUMFi+RppPlrHzbqmFnINTrazo0lPNwhcgzuAXVVcfy/mqPDrQmHAyz5bvV0gDAuRFrk804V0HpQ6u9sZ0tBeg==
sharp@^0.29.0: sharp@^0.29.0, sharp@^0.29.1:
version "0.29.1" version "0.29.2"
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.29.1.tgz#f60b50f24f399464a24187c86bd2da41aae50b85" resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.29.2.tgz#e8c003cd9cb321585b32dbda6eed3baa7d6f2308"
integrity sha512-DpgdAny9TuS+oWCQ7MRS8XyY9x6q1+yW3a5wNx0J3HrGuB/Jot/8WcT+lElHY9iJu2pwtegSGxqMaqFiMhs4rQ== integrity sha512-XWRdiYLIJ3tDUejRyG24KERnJzMfIoyiJBntd2S6/uj3NEeNgRFRLgiBlvPxMa8aml14dKKD98yHinSNKp1xzQ==
dependencies: dependencies:
color "^4.0.1" color "^4.0.1"
detect-libc "^1.0.3" detect-libc "^1.0.3"
node-addon-api "^4.1.0" node-addon-api "^4.2.0"
prebuild-install "^6.1.4" prebuild-install "^6.1.4"
semver "^7.3.5" semver "^7.3.5"
simple-get "^3.1.0" simple-get "^3.1.0"
@ -12009,12 +12066,12 @@ sjcl@^1.0.8:
resolved "https://registry.yarnpkg.com/sjcl/-/sjcl-1.0.8.tgz#f2ec8d7dc1f0f21b069b8914a41a8f236b0e252a" resolved "https://registry.yarnpkg.com/sjcl/-/sjcl-1.0.8.tgz#f2ec8d7dc1f0f21b069b8914a41a8f236b0e252a"
integrity sha512-LzIjEQ0S0DpIgnxMEayM1rq9aGwGRG4OnZhCdjx7glTaJtf4zRfpg87ImfjSJjoW9vKpagd82McDOwbRT5kQKQ== integrity sha512-LzIjEQ0S0DpIgnxMEayM1rq9aGwGRG4OnZhCdjx7glTaJtf4zRfpg87ImfjSJjoW9vKpagd82McDOwbRT5kQKQ==
skynet-js@^4.0.11-beta: skynet-js@^4.0.19-beta:
version "4.0.11-beta" version "4.0.19-beta"
resolved "https://registry.yarnpkg.com/skynet-js/-/skynet-js-4.0.11-beta.tgz#ec313d586f8e026e0b3b4b608f2f3b4a449e8a71" resolved "https://registry.yarnpkg.com/skynet-js/-/skynet-js-4.0.19-beta.tgz#d4c640898c79cf69e45aa1c3c1ed5c80aa1aeced"
integrity sha512-/fpxBeegGJeK+VWE8svUhBc2tVX0kJAZod5K172kKPO1g/GECeQLLSuWL2yvCMbSSTyH0dIFr5gemwGNsZHlMQ== integrity sha512-d8/q3E3OjUxgCCAW28gNFvbahj0ks8ym122XTopbRyvAZKk9+/Z4ians9v8Tov36Z4k/un+Ilw/0i6DtM8c8Dw==
dependencies: dependencies:
axios "^0.21.0" axios "^0.24.0"
base32-decode "^1.0.0" base32-decode "^1.0.0"
base32-encode "^1.1.1" base32-encode "^1.1.1"
base64-js "^1.3.1" base64-js "^1.3.1"
@ -12025,16 +12082,16 @@ skynet-js@^4.0.11-beta:
post-me "^0.4.5" post-me "^0.4.5"
randombytes "^2.1.0" randombytes "^2.1.0"
sjcl "^1.0.8" sjcl "^1.0.8"
skynet-mysky-utils "^0.2.2" skynet-mysky-utils "^0.3.0"
tus-js-client "^2.2.0" tus-js-client "^2.2.0"
tweetnacl "^1.0.3" tweetnacl "^1.0.3"
url-join "^4.0.1" url-join "^4.0.1"
url-parse "^1.5.1" url-parse "^1.5.1"
skynet-mysky-utils@^0.2.2: skynet-mysky-utils@^0.3.0:
version "0.2.3" version "0.3.0"
resolved "https://registry.yarnpkg.com/skynet-mysky-utils/-/skynet-mysky-utils-0.2.3.tgz#5007cf8f7599b665ccf016003b37a4ed0fb19abf" resolved "https://registry.yarnpkg.com/skynet-mysky-utils/-/skynet-mysky-utils-0.3.0.tgz#87fdc0a5f8547cf660280ef86b7a762269919bad"
integrity sha512-wRrAASn4haux2fu+2pJLv+uV/TGbBecXT1jaqD3/IQgqbEwZUpDNJJrYnYAfp/0cY5Xmuc2ZX90NNr34neAcWg== integrity sha512-X9L6SrVTdwTUFook/E6zUWCOpXHdyspLAu0elQbbPkZCWeFpr/XXTMbiyPV3m1liYsesngAKxzaSqylaTWOGUA==
dependencies: dependencies:
post-me "^0.4.5" post-me "^0.4.5"
@ -12591,14 +12648,6 @@ style-to-object@^0.3.0:
dependencies: dependencies:
inline-style-parser "0.1.1" inline-style-parser "0.1.1"
style-value-types@4.1.4:
version "4.1.4"
resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-4.1.4.tgz#80f37cb4fb024d6394087403dfb275e8bb627e75"
integrity sha512-LCJL6tB+vPSUoxgUBt9juXIlNJHtBMy8jkXzUJSBzeHWdBu6lhzHqCvLVkXFGsFIlNa2ln1sQHya/gzaFmB2Lg==
dependencies:
hey-listen "^1.0.8"
tslib "^2.1.0"
style-value-types@5.0.0: style-value-types@5.0.0:
version "5.0.0" version "5.0.0"
resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-5.0.0.tgz#76c35f0e579843d523187989da866729411fc8ad" resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-5.0.0.tgz#76c35f0e579843d523187989da866729411fc8ad"
@ -12726,10 +12775,10 @@ table@^6.0.9:
string-width "^4.2.0" string-width "^4.2.0"
strip-ansi "^6.0.0" strip-ansi "^6.0.0"
tailwindcss@^2.2.16: tailwindcss@^2.2.19:
version "2.2.16" version "2.2.19"
resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-2.2.16.tgz#32f81bdf1758b639cb83b9d30bf7cbecdda49e5e" resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-2.2.19.tgz#540e464832cd462bb9649c1484b0a38315c2653c"
integrity sha512-EireCtpQyyJ4Xz8NYzHafBoy4baCOO96flM0+HgtsFcIQ9KFy/YBK3GEtlnD+rXen0e4xm8t3WiUcKBJmN6yjg== integrity sha512-6Ui7JSVtXadtTUo2NtkBBacobzWiQYVjYW0ZnKaP9S1ZCKQ0w7KVNz+YSDI/j7O7KCMHbOkz94ZMQhbT9pOqjw==
dependencies: dependencies:
arg "^5.0.1" arg "^5.0.1"
bytes "^3.0.0" bytes "^3.0.0"

View File

@ -1,9 +1,10 @@
#! /usr/bin/env bash #! /usr/bin/env bash
# This script is meant to be used when manually adding a skylink to the # This script adds a skylink to the sia blocklist and removes the skylink from
# blocklist on all the skynet web portals. The automatic script that is used to # nginx cache. The script should be run locally on each skynet webportal
# continuously sync a google sheets list with the blocklist on the web portals # server. The automatic script that is used to continuously sync an Airtable
# is /setup-scripts/blocklist-airtable.py # sheet list with the blocklist on the web portals is
# /setup-scripts/blocklist-airtable.py
set -e # exit on first error set -e # exit on first error
@ -17,44 +18,39 @@ fi
######################################################### #########################################################
skylinks=() skylinks=()
if test -f "$1"; then if test -f "$1"; then
OLDIFS=$IFS
IFS=','
line_number=1 line_number=1
while read line
# Read file including the last line even when it doesn't end with newline
while IFS="" read -r line || [ -n "$line" ];
do do
if [[ $line =~ ([a-zA-Z0-9_-]{46}) ]]; then if [[ $line =~ (^[a-zA-Z0-9_-]{46}$) ]]; then
skylinks+=("$BASH_REMATCH") skylinks+=("$line")
else else
echo "Incorrect skylink at line ${line_number}: $line" && exit 1 echo "Incorrect skylink at line ${line_number}: $line" && exit 1
fi fi
let line_number+=1 let line_number+=1
done < $1; done < $1;
IFS=$OLDIFS
else else
skylinks=("$1") # just single skylink passed as input argument skylinks=("$1") # just single skylink passed as input argument
fi fi
######################################################################### for skylink in "${skylinks[@]}";
# iterate through all servers, block the skylinks and purge it from cache
#########################################################################
declare -a servers=( "eu-ger-1.siasky.net" "eu-ger-2.siasky.net" "eu-ger-3.siasky.net" "eu-ger-4.siasky.net" "eu-ger-5.siasky.net" "eu-ger-6.siasky.net" "eu-ger-7.siasky.net" "eu-ger-8.siasky.net"
"eu-fin-1.siasky.net" "eu-fin-2.siasky.net" "eu-fin-3.siasky.net" "eu-fin-4.siasky.net"
"eu-pol-1.siasky.net" "eu-pol-2.siasky.net" "eu-pol-3.siasky.net"
"us-or-1.siasky.net" "us-or-2.siasky.net"
"us-pa-1.siasky.net" "us-pa-2.siasky.net"
"us-va-1.siasky.net" "us-va-2.siasky.net" "us-va-3.siasky.net"
"as-hk-1.siasky.net"
"siasky.xyz" "dev1.siasky.dev" "dev2.siasky.dev" "dev3.siasky.dev")
for server in "${servers[@]}";
do do
for skylink in "${skylinks[@]}"; echo ".. ⌁ Blocking skylink ${skylink}"
do
echo ".. ⌁ Blocking skylink ${skylink} on ${server}" # Add to Sia blocklist
cached_files_command="find /data/nginx/cache/ -type f | xargs -r grep -Elsq '^Skynet-Skylink: ${skylink}'" docker exec sia siac skynet blocklist add "${skylink}"
ssh -q -t user@${server} "docker exec -it nginx bash -c ${cached_files_command} | xargs -r rm"
echo ".. ⌁ Skylink ${skylink} Blocked on ${server}" # Remove from NGINX cache
echo "--------------------------------------------" # NOTE:
done # If there are changes to how the NGINX cache is being cleared, the same
# changes need to be applied to the /setup-scripts/blocklist-airtable.py
# script.
cached_files_command="find /data/nginx/cache/ -type f | xargs -r grep -Els '^Skynet-Skylink: ${skylink}'"
docker exec -it nginx bash -c "${cached_files_command} | xargs -r rm"
echo ".. ⌁ Skylink ${skylink} Blocked"
echo "--------------------------------------------"
done done
echo "✓ All done !" echo "✓ All done !"

View File

@ -27,26 +27,6 @@ fi
# Take the current datetime: # Take the current datetime:
DT=$(date +%Y-%m-%d) DT=$(date +%Y-%m-%d)
### COCKROACH DB ###
echo "Creating a backup of CockroachDB:"
# Check if a backup already exists:
totalFoundObjects=$(aws s3 ls $S3_BACKUP_PATH/$DT --recursive --summarize | grep "cockroach" | wc -l)
if [ "$totalFoundObjects" -ge "1" ]; then
echo "Backup already exists for today. Skipping."
else
# Create a cockroachdb backup:
docker exec cockroach \
cockroach sql \
--host cockroach:26257 \
--certs-dir=/certs \
--execute="BACKUP TO '$S3_BACKUP_PATH/$DT/cockroach/?AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID&AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY';"
if [[ $? > 0 ]]; then
echo "Creating a CockroachDB backup failed. Skipping."
else
echo "Successfully backed up CockroachDB."
fi
fi
### MONGO DB ### ### MONGO DB ###
echo "Creating a backup of MongoDB:" echo "Creating a backup of MongoDB:"
# Check if a backup already exists: # Check if a backup already exists:
@ -73,3 +53,23 @@ else
fi fi
docker exec mongo rm -rf /data/db/backups/$DT docker exec mongo rm -rf /data/db/backups/$DT
fi fi
### COCKROACH DB ###
echo "Creating a backup of CockroachDB:"
# Check if a backup already exists:
totalFoundObjects=$(aws s3 ls $S3_BACKUP_PATH/$DT --recursive --summarize | grep "cockroach" | wc -l)
if [ "$totalFoundObjects" -ge "1" ]; then
echo "Backup already exists for today. Skipping."
else
# Create a cockroachdb backup:
docker exec cockroach \
cockroach sql \
--host cockroach:26257 \
--certs-dir=/certs \
--execute="BACKUP TO '$S3_BACKUP_PATH/$DT/cockroach/?AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID&AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY';"
if [[ $? > 0 ]]; then
echo "Creating a CockroachDB backup failed. Skipping."
else
echo "Successfully backed up CockroachDB."
fi
fi

View File

@ -1,5 +1,8 @@
#!/bin/bash #!/bin/bash
# First of all, let's pamper awscli because Python is so special:
pip3 install --upgrade awscli
BACKUP=$1 BACKUP=$1
if [[ $BACKUP == "" ]]; then if [[ $BACKUP == "" ]]; then
echo "No backup name given. It should look like '2020-01-29'." echo "No backup name given. It should look like '2020-01-29'."
@ -97,7 +100,7 @@ rm mongo.tgz
# The name of the backup is not `mongo` due to the way we're creating it, # The name of the backup is not `mongo` due to the way we're creating it,
# it's $BACKUP. # it's $BACKUP.
docker exec mongo \ docker exec mongo \
mongorestore \ mongorestore --drop \
mongodb://$SKYNET_DB_USER:$SKYNET_DB_PASS@$SKYNET_DB_HOST:$SKYNET_DB_PORT \ mongodb://$SKYNET_DB_USER:$SKYNET_DB_PASS@$SKYNET_DB_HOST:$SKYNET_DB_PORT \
/data/db/backups/to_restore/$BACKUP /data/db/backups/to_restore/$BACKUP
# Clean up: # Clean up:

View File

@ -6,6 +6,7 @@ from time import sleep
import traceback import traceback
import os import os
import sys
import re import re
import asyncio import asyncio
import requests import requests
@ -13,10 +14,16 @@ import json
setup() setup()
AIRTABLE_API_KEY = os.getenv("AIRTABLE_API_KEY") AIRTABLE_API_KEY = os.getenv("AIRTABLE_API_KEY")
AIRTABLE_BASE = os.getenv("AIRTABLE_BASE", "app89plJvA9EqTJEc") AIRTABLE_BASE = os.getenv("AIRTABLE_BASE")
AIRTABLE_TABLE = os.getenv("AIRTABLE_TABLE", "Table%201") AIRTABLE_TABLE = os.getenv("AIRTABLE_TABLE")
AIRTABLE_FIELD = os.getenv("AIRTABLE_FIELD", "Link") AIRTABLE_FIELD = os.getenv("AIRTABLE_FIELD")
# Check environment variables are defined
for value in [AIRTABLE_API_KEY, AIRTABLE_BASE, AIRTABLE_TABLE, AIRTABLE_FIELD]:
if not value:
sys.exit("Configuration error: Missing AirTable environment variable.")
async def run_checks(): async def run_checks():
@ -93,8 +100,8 @@ async def block_skylinks_from_airtable():
entry["fields"].get(AIRTABLE_FIELD, "") for entry in data["records"] entry["fields"].get(AIRTABLE_FIELD, "") for entry in data["records"]
] ]
skylinks = [ skylinks = [
skylink for skylink in skylinks if skylink skylink.strip() for skylink in skylinks if skylink
] # filter empty skylinks, most likely empty rows ] # filter empty skylinks, most likely empty rows, trim whitespace
offset = data.get("offset") offset = data.get("offset")
@ -141,6 +148,10 @@ async def block_skylinks_from_airtable():
) )
return await send_msg(message, force_notify=False) return await send_msg(message, force_notify=False)
# Remove from NGINX cache
# NOTE:
# If there are changes to how the NGINX cache is being cleared, the same
# changes need to be applied to the /scripts/blocklist-skylink.sh script.
print("Searching nginx cache for blocked files") print("Searching nginx cache for blocked files")
cached_files_count = 0 cached_files_count = 0
batch_size = 1000 batch_size = 1000