Merge remote-tracking branch 'origin/master' into wildcard-api

This commit is contained in:
Karol Wypchlo 2021-10-26 12:48:00 +02:00
commit d4bc9df1ce
No known key found for this signature in database
GPG Key ID: C92C016317A964D0
37 changed files with 214 additions and 138 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

@ -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

@ -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 @@
- Set skyd up to connect to the local mongodb cluster for storing TUS metadata

View File

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

View File

@ -1 +0,0 @@
- Move MongoDB to a separate service (use `PORTAL_MODULES=m` to use it without accounts)

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 @@
- 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

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

View File

@ -9,7 +9,7 @@ x-logging: &default-logging
services: services:
mongo: mongo:
image: mongo:4.4.1 image: mongo:4.4.1
command: --keyFile=/data/mgkey --replSet=skynet command: --keyFile=/data/mgkey --replSet=${SKYNET_DB_REPLICASET:-skynet}
container_name: mongo container_name: mongo
restart: unless-stopped restart: unless-stopped
logging: *default-logging logging: *default-logging

View File

@ -24,7 +24,7 @@ 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_URI=mongodb://${SKYNET_DB_HOST}:${SKYNET_DB_PORT}
- MONGODB_USER=${SKYNET_DB_USER} - MONGODB_USER=${SKYNET_DB_USER}
- MONGODB_PASSWORD=${SKYNET_DB_PASS} - MONGODB_PASSWORD=${SKYNET_DB_PASS}

View File

@ -1,4 +1,4 @@
FROM node:16.10.0-alpine FROM node:16.12.0-alpine
WORKDIR /opt/hsd WORKDIR /opt/hsd

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

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

View File

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

View File

@ -10,8 +10,8 @@
"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.1", "@stripe/stripe-js": "1.20.3",
"@tailwindcss/forms": "0.3.4", "@tailwindcss/forms": "0.3.4",
"autoprefixer": "10.3.7", "autoprefixer": "10.3.7",
"classnames": "2.3.1", "classnames": "2.3.1",
@ -24,18 +24,18 @@
"ky": "0.25.1", "ky": "0.25.1",
"next": "11.1.2", "next": "11.1.2",
"normalize.css": "8.0.1", "normalize.css": "8.0.1",
"postcss": "8.3.9", "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.0.3",
"skynet-js": "3.0.2", "skynet-js": "3.0.2",
"stripe": "8.181.0", "stripe": "8.184.0",
"superagent": "6.1.0", "superagent": "6.1.0",
"swr": "1.0.1", "swr": "1.0.1",
"tailwindcss": "2.2.16", "tailwindcss": "2.2.17",
"yup": "0.32.9" "yup": "0.32.11"
}, },
"resolutions": { "resolutions": {
"axios": "0.21.4" "axios": "0.21.4"

View File

@ -49,7 +49,7 @@
dependencies: dependencies:
regenerator-runtime "^0.13.4" regenerator-runtime "^0.13.4"
"@babel/runtime@^7.10.5", "@babel/runtime@^7.11.2": "@babel/runtime@^7.11.2", "@babel/runtime@^7.15.4":
version "7.15.4" version "7.15.4"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.4.tgz#fd17d16bfdf878e6dd02d19753a39fa8a8d9c84a" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.4.tgz#fd17d16bfdf878e6dd02d19753a39fa8a8d9c84a"
integrity sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw== integrity sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw==
@ -181,17 +181,17 @@
dependencies: dependencies:
axios "^0.19.2" axios "^0.19.2"
"@stripe/react-stripe-js@1.5.0": "@stripe/react-stripe-js@1.6.0":
version "1.5.0" version "1.6.0"
resolved "https://registry.yarnpkg.com/@stripe/react-stripe-js/-/react-stripe-js-1.5.0.tgz#7e4d80077e88e1f2c1f10ac255f2838d7c9488c2" resolved "https://registry.yarnpkg.com/@stripe/react-stripe-js/-/react-stripe-js-1.6.0.tgz#e3adf6a6ea6d839193164fa3cfe73cf52db3a080"
integrity sha512-A7+bNeb0O/kw3JdtMeiB6frokPcks5obi+TIjuFRXUMZ5o/o1Qe7eLgLnsb0KOO/g3KJqNCpHiYcKCLESZJJbQ== integrity sha512-tMmsPD+wkpiiVJZgQ1E06tklG5MZHG462s6OWja9abpxq76kerAxMFN+KdhUg0LIEY79THbzvH3s/WGHasnV3w==
dependencies: dependencies:
prop-types "^15.7.2" prop-types "^15.7.2"
"@stripe/stripe-js@1.19.1": "@stripe/stripe-js@1.20.3":
version "1.19.1" version "1.20.3"
resolved "https://registry.yarnpkg.com/@stripe/stripe-js/-/stripe-js-1.19.1.tgz#51017bb1c6e12f0e74747534667e42e77b2c9978" resolved "https://registry.yarnpkg.com/@stripe/stripe-js/-/stripe-js-1.20.3.tgz#6f479d53ad933b8b17b6c708bbc2840b7512d80e"
integrity sha512-gvaQ51FXHHKMypXMlSPZbpb7e5671oqySqEfU2MviAQCsikV/+vnvPPxOged4RvNwNM7v4ocsKadQwqIwPhgrQ== integrity sha512-pFhPvajrZJUzoOZDC3/2YsOeL5VD63CVlbOXs+AriIchmy6Kb2CQqrcHPCuK72FM726lwo4neF0wPRBtsLYXuw==
"@tailwindcss/forms@0.3.4": "@tailwindcss/forms@0.3.4":
version "0.3.4" version "0.3.4"
@ -200,10 +200,10 @@
dependencies: dependencies:
mini-svg-data-uri "^1.2.3" mini-svg-data-uri "^1.2.3"
"@types/lodash@^4.14.165": "@types/lodash@^4.14.175":
version "4.14.174" version "4.14.175"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.174.tgz#b4b06b6eced9850eed6b6a8f1abdd0f5192803c1" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.175.tgz#b78dfa959192b01fae0ad90e166478769b215f45"
integrity sha512-KMBLT6+g9qrGXpDt7ohjWPUD34WA/jasrtjTEHStF0NPdEwJ1N9SZ+4GaMVDeuk/y0+X5j9xFm6mNiXS7UoaLQ== integrity sha512-XmdEOrKQ8a1Y/yxQFOMbC47G/V2VDO1GvMRnl4O75M4GW/abC5tnfzadQYkqEveqRM1dEJGFFegfPNA2vvx2iw==
"@types/node@*", "@types/node@>=8.1.0": "@types/node@*", "@types/node@>=8.1.0":
version "16.10.1" version "16.10.1"
@ -1757,7 +1757,7 @@ locate-path@^5.0.0:
dependencies: dependencies:
p-locate "^4.1.0" p-locate "^4.1.0"
lodash-es@^4.17.15, lodash-es@^4.17.21: lodash-es@^4.17.21:
version "4.17.21" version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee"
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw== integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==
@ -1812,7 +1812,7 @@ lodash.topath@^4.5.2:
resolved "https://registry.yarnpkg.com/lodash.topath/-/lodash.topath-4.5.2.tgz#3616351f3bba61994a0931989660bd03254fd009" resolved "https://registry.yarnpkg.com/lodash.topath/-/lodash.topath-4.5.2.tgz#3616351f3bba61994a0931989660bd03254fd009"
integrity sha1-NhY1Hzu6YZlKCTGYlmC9AyVP0Ak= integrity sha1-NhY1Hzu6YZlKCTGYlmC9AyVP0Ak=
lodash@^4.17.20, lodash@^4.17.21: 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"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
@ -1947,10 +1947,10 @@ nanoclone@^0.2.1:
resolved "https://registry.yarnpkg.com/nanoclone/-/nanoclone-0.2.1.tgz#dd4090f8f1a110d26bb32c49ed2f5b9235209ed4" resolved "https://registry.yarnpkg.com/nanoclone/-/nanoclone-0.2.1.tgz#dd4090f8f1a110d26bb32c49ed2f5b9235209ed4"
integrity sha512-wynEP02LmIbLpcYw8uBKpcfF6dmg2vcpKqxeH5UcoKEYdExslsdUA4ugFauuaeYdTB76ez6gJW8XAZ6CgkXYxA== integrity sha512-wynEP02LmIbLpcYw8uBKpcfF6dmg2vcpKqxeH5UcoKEYdExslsdUA4ugFauuaeYdTB76ez6gJW8XAZ6CgkXYxA==
nanoid@^3.1.23, nanoid@^3.1.28: nanoid@^3.1.23, nanoid@^3.1.30:
version "3.1.29" version "3.1.30"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.29.tgz#214fb2d7a33e1a5bef4757b779dfaeb6a4e5aeb4" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362"
integrity sha512-dW2pUSGZ8ZnCFIlBIA31SV8huOGCHb6OwzVCc7A69rb/a+SgPBwfmLvK5TKQ3INPbRkcI8a/Owo0XbiTNH19wg== integrity sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ==
native-url@0.3.4: native-url@0.3.4:
version "0.3.4" version "0.3.4"
@ -2270,6 +2270,11 @@ picocolors@^0.2.1:
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f"
integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA== integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==
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"
@ -2345,13 +2350,13 @@ postcss@8.2.15:
nanoid "^3.1.23" nanoid "^3.1.23"
source-map "^0.6.1" source-map "^0.6.1"
postcss@8.3.9, postcss@^8.1.6, postcss@^8.2.1: postcss@8.3.11, postcss@^8.1.6, postcss@^8.2.1:
version "8.3.9" version "8.3.11"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.9.tgz#98754caa06c4ee9eb59cc48bd073bb6bd3437c31" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.11.tgz#c3beca7ea811cd5e1c4a3ec6d2e7599ef1f8f858"
integrity sha512-f/ZFyAKh9Dnqytx5X62jgjhhzttjZS7hMsohcI7HEI5tjELX/HxCy3EFhsRxyzGvrzFF+82XPvCS8T9TFleVJw== integrity sha512-hCmlUAIlUiav8Xdqw3Io4LcpA1DOt7h3LSTAC4G6JGHFFaWzI6qvFt9oilvl8BmkbBRX1IhM90ZAmpk68zccQA==
dependencies: dependencies:
nanoid "^3.1.28" nanoid "^3.1.30"
picocolors "^0.2.1" picocolors "^1.0.0"
source-map-js "^0.6.2" source-map-js "^0.6.2"
prettier@2.4.1: prettier@2.4.1:
@ -2905,10 +2910,10 @@ strip-eof@^1.0.0:
resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf"
integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=
stripe@8.181.0: stripe@8.184.0:
version "8.181.0" version "8.184.0"
resolved "https://registry.yarnpkg.com/stripe/-/stripe-8.181.0.tgz#e49514b10c54d146cc5306204410658c2d689386" resolved "https://registry.yarnpkg.com/stripe/-/stripe-8.184.0.tgz#ea68470ca6045bb47516c4fea3b775fd6ce15a36"
integrity sha512-yEKT+/a/5OMYqGPhI/4jy/kiKHKeew1n9BvNtHbOA9lQDM8yVIYDx0nbQMj5rMowivAMqY67mejDJeSBlcPASA== integrity sha512-ZUdvyX+sizTxXLEbUjgTShrulSWSkMIt7hIKdAkhnajYrHdzVtdmhBJl8sQbR9chMVox3Ig5ohilyeIrvcCE2g==
dependencies: dependencies:
"@types/node" ">=8.1.0" "@types/node" ">=8.1.0"
qs "^6.6.0" qs "^6.6.0"
@ -2982,10 +2987,10 @@ swr@1.0.1:
dependencies: dependencies:
dequal "2.0.2" dequal "2.0.2"
tailwindcss@2.2.16: tailwindcss@2.2.17:
version "2.2.16" version "2.2.17"
resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-2.2.16.tgz#32f81bdf1758b639cb83b9d30bf7cbecdda49e5e" resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-2.2.17.tgz#c6332731f9ff1b6628ff589c95c38685347775e3"
integrity sha512-EireCtpQyyJ4Xz8NYzHafBoy4baCOO96flM0+HgtsFcIQ9KFy/YBK3GEtlnD+rXen0e4xm8t3WiUcKBJmN6yjg== integrity sha512-WgRpn+Pxn7eWqlruxnxEbL9ByVRWi3iC10z4b6dW0zSdnkPVC4hPMSWLQkkW8GCyBIv/vbJ0bxIi9dVrl4CfoA==
dependencies: dependencies:
arg "^5.0.1" arg "^5.0.1"
bytes "^3.0.0" bytes "^3.0.0"
@ -3269,15 +3274,15 @@ yocto-queue@^0.1.0:
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
yup@0.32.9: yup@0.32.11:
version "0.32.9" version "0.32.11"
resolved "https://registry.yarnpkg.com/yup/-/yup-0.32.9.tgz#9367bec6b1b0e39211ecbca598702e106019d872" resolved "https://registry.yarnpkg.com/yup/-/yup-0.32.11.tgz#d67fb83eefa4698607982e63f7ca4c5ed3cf18c5"
integrity sha512-Ci1qN+i2H0XpY7syDQ0k5zKQ/DoxO0LzPg8PAR/X4Mpj6DqaeCoIYEEjDJwhArh3Fa7GWbQQVDZKeXYlSH4JMg== integrity sha512-Z2Fe1bn+eLstG8DRR6FTavGD+MeAwyfmouhHsIUgaADz8jvFKbO/fXc2trJKZg+5EBjh4gGm3iU/t3onKlXHIg==
dependencies: dependencies:
"@babel/runtime" "^7.10.5" "@babel/runtime" "^7.15.4"
"@types/lodash" "^4.14.165" "@types/lodash" "^4.14.175"
lodash "^4.17.20" lodash "^4.17.21"
lodash-es "^4.17.15" lodash-es "^4.17.21"
nanoclone "^0.2.1" nanoclone "^0.2.1"
property-expr "^2.0.4" property-expr "^2.0.4"
toposort "^2.0.2" toposort "^2.0.2"

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
FROM node:16.10.0-alpine FROM node:16.12.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

@ -15,7 +15,7 @@
"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": "^4.1.17",
"gatsby": "^3.14.2", "gatsby": "^3.14.4",
"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.1", "gatsby-plugin-image": "^1.14.1",
@ -25,7 +25,7 @@
"gatsby-plugin-postcss": "^4.14.0", "gatsby-plugin-postcss": "^4.14.0",
"gatsby-plugin-purgecss": "^6.0.2", "gatsby-plugin-purgecss": "^6.0.2",
"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.13",
"gatsby-plugin-sharp": "^3.14.1", "gatsby-plugin-sharp": "^3.14.1",
"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",
@ -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.29", "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": "^10.0.2",
"postcss": "^8.3.9", "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",
@ -62,7 +62,7 @@
"skynet-js": "^4.0.11-beta", "skynet-js": "^4.0.11-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.17"
}, },
"devDependencies": { "devDependencies": {
"cross-env": "^7.0.3", "cross-env": "^7.0.3",

View File

@ -5875,10 +5875,10 @@ framesync@5.3.0:
dependencies: dependencies:
tslib "^2.1.0" tslib "^2.1.0"
framesync@6.0.0: framesync@^6.0.1:
version "6.0.0" version "6.0.1"
resolved "https://registry.yarnpkg.com/framesync/-/framesync-6.0.0.tgz#e6ad8ec128d33291a03cc34e58365c41265a1dae" resolved "https://registry.yarnpkg.com/framesync/-/framesync-6.0.1.tgz#5e32fc01f1c42b39c654c35b16440e07a25d6f20"
integrity sha512-9iBw/uZ/5fDURdpLrgc/eoFXiX9HC3DeOSLtTL5lZSyX/vQb+kjEz9CPNTiTObfK5PKyGgIUTstU8PK9W6EvoA== integrity sha512-fUY88kXvGiIItgNC7wcTOl0SNRCVXMKSWW2Yzfmn7EKNc+MpCzcz9DhdHcdjbrtN3c6R4H5dTY2jiCpPdysEjA==
dependencies: dependencies:
tslib "^2.1.0" tslib "^2.1.0"
@ -5961,10 +5961,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.1: gatsby-cli@^3.14.2:
version "3.14.1" version "3.14.2"
resolved "https://registry.yarnpkg.com/gatsby-cli/-/gatsby-cli-3.14.1.tgz#508515760d708b36cd8491f30f062cc451dd2252" resolved "https://registry.yarnpkg.com/gatsby-cli/-/gatsby-cli-3.14.2.tgz#1d4ebeb199c3a910d80abc13f458888c8cd7f2f8"
integrity sha512-0k8fJU2oE35U1D3sj4qFHMmKj32LJRmXeUSsDtJWdvNZ8+xhBNyIh+YGcqfqbCNicLXiPyfzvt6UwBIbOOTCRQ== 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"
@ -6159,10 +6159,10 @@ 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.13:
version "1.6.10" version "1.6.13"
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.13.tgz#01e1ce68e3f4e07f957ac9a20cd2a9e12fdd3f79"
integrity sha512-soQT765LF0J8/dfrZGFuA/ZB/JUyvt2nVyHEFLUMd/qxgiem9x0EOZquJPId78xDHYePMkxNCPk9UsLcTZdFZw== integrity sha512-MUPJsvkALwSmfRb1L3IVNmzIqwV35fol1RVot425ZYXvtD+s0OtZli5VnhLNxsX0beodyavzFl0SRJCCQZz0/g==
dependencies: dependencies:
"@babel/runtime" "^7.14.0" "@babel/runtime" "^7.14.0"
generate-robotstxt "^8.0.3" generate-robotstxt "^8.0.3"
@ -6464,10 +6464,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.2: gatsby@^3.14.4:
version "3.14.2" version "3.14.4"
resolved "https://registry.yarnpkg.com/gatsby/-/gatsby-3.14.2.tgz#684a49ed9521abe5e72ff36b1fc3a4ed96fee0fb" resolved "https://registry.yarnpkg.com/gatsby/-/gatsby-3.14.4.tgz#e7ef5c3c1eda45ea3ad0bc1273f014fbc46b316c"
integrity sha512-1cjyfGkQ9zXtou+RhtYBprv8nYXTPuRIs4IFzBP373vBD1CdwabAC/R8kjqHfdvyNrorzg3sqRjLjActtfU8NA== integrity sha512-cpsMhl2qkE0+TL0znwflVfycy143fFucGtFDkNxu8dbY0GRjA9MiDwlS/aSqg5U2HhhF39IcBvwuntiaP6vQ0g==
dependencies: dependencies:
"@babel/code-frame" "^7.14.0" "@babel/code-frame" "^7.14.0"
"@babel/core" "^7.15.5" "@babel/core" "^7.15.5"
@ -6536,7 +6536,7 @@ gatsby@^3.14.2:
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.1" 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"
@ -6575,7 +6575,6 @@ gatsby@^3.14.2:
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"
@ -9406,10 +9405,10 @@ nanocolors@^0.2.2:
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.28, nanoid@^3.1.29: nanoid@^3.1.30:
version "3.1.29" version "3.1.30"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.29.tgz#214fb2d7a33e1a5bef4757b779dfaeb6a4e5aeb4" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362"
integrity sha512-dW2pUSGZ8ZnCFIlBIA31SV8huOGCHb6OwzVCc7A69rb/a+SgPBwfmLvK5TKQ3INPbRkcI8a/Owo0XbiTNH19wg== integrity sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ==
nanomatch@^1.2.9: nanomatch@^1.2.9:
version "1.2.13" version "1.2.13"
@ -10204,6 +10203,11 @@ picocolors@^0.2.1:
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f"
integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA== integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==
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"
@ -10286,12 +10290,12 @@ popmotion@9.3.6:
style-value-types "4.1.4" style-value-types "4.1.4"
tslib "^2.1.0" tslib "^2.1.0"
popmotion@^10.0.1: popmotion@^10.0.2:
version "10.0.1" version "10.0.2"
resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-10.0.1.tgz#5be5b80112a1386b7f2a11d081a1ea3ca7508d8e" resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-10.0.2.tgz#edb87efb2ba39505d07f79d3ca8cc4b1cbe101bf"
integrity sha512-jmVmbXMAl/qrrogQXCMGFR8+F290J6gl9kKHSYzAKBRTHm7B1unadmEeLSXX7rGtzPxOfKVnWHA3t3m3CVnxqw== integrity sha512-8vgx02LL7Odk/kwSGigAnlPRLJK+Dfked571ZAHGzkxPNWThkU5mQX0xPmibIMAULZehWBV7hGN7LSCpaV3cfw==
dependencies: dependencies:
framesync "6.0.0" framesync "^6.0.1"
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"
@ -10617,13 +10621,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.9: 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.9" version "8.3.11"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.9.tgz#98754caa06c4ee9eb59cc48bd073bb6bd3437c31" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.11.tgz#c3beca7ea811cd5e1c4a3ec6d2e7599ef1f8f858"
integrity sha512-f/ZFyAKh9Dnqytx5X62jgjhhzttjZS7hMsohcI7HEI5tjELX/HxCy3EFhsRxyzGvrzFF+82XPvCS8T9TFleVJw== integrity sha512-hCmlUAIlUiav8Xdqw3Io4LcpA1DOt7h3LSTAC4G6JGHFFaWzI6qvFt9oilvl8BmkbBRX1IhM90ZAmpk68zccQA==
dependencies: dependencies:
nanoid "^3.1.28" nanoid "^3.1.30"
picocolors "^0.2.1" picocolors "^1.0.0"
source-map-js "^0.6.2" source-map-js "^0.6.2"
potrace@^2.1.8: potrace@^2.1.8:
@ -12739,10 +12743,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.17:
version "2.2.16" version "2.2.17"
resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-2.2.16.tgz#32f81bdf1758b639cb83b9d30bf7cbecdda49e5e" resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-2.2.17.tgz#c6332731f9ff1b6628ff589c95c38685347775e3"
integrity sha512-EireCtpQyyJ4Xz8NYzHafBoy4baCOO96flM0+HgtsFcIQ9KFy/YBK3GEtlnD+rXen0e4xm8t3WiUcKBJmN6yjg== integrity sha512-WgRpn+Pxn7eWqlruxnxEbL9ByVRWi3iC10z4b6dW0zSdnkPVC4hPMSWLQkkW8GCyBIv/vbJ0bxIi9dVrl4CfoA==
dependencies: dependencies:
arg "^5.0.1" arg "^5.0.1"
bytes "^3.0.0" bytes "^3.0.0"

View File

@ -38,20 +38,30 @@ fi
# iterate through all servers, block the skylinks and purge it from cache # 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" 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-ger-9.siasky.net" "eu-ger-10.siasky.net" "eu-ger-11.siasky.net" "eu-ger-12.siasky.net"
"eu-pol-1.siasky.net" "eu-pol-2.siasky.net" "eu-pol-3.siasky.net" "eu-fin-1.siasky.net" "eu-fin-2.siasky.net" "eu-fin-3.siasky.net" "eu-fin-4.siasky.net" "eu-fin-5.siasky.net" "eu-fin-6.siasky.net" "eu-fin-7-siasky.net" "eu-fin-8.siasky.net"
"eu-fin-9.siasky.net" "eu-fin-10.siasky.net" "eu-fin-11.siasky.net" "eu-fin-12.siasky.net" "eu-fin-13.siasky.net" "eu-fin-14.siasky.net" "eu-fin-15.siasky.net"
"eu-pol-1.siasky.net" "eu-pol-2.siasky.net" "eu-pol-3.siasky.net" "eu-pol-4.siasky.net" "eu-pol-5.siasky.net"
"us-ny-1.siasky.net" "us-ny-2.siasky.net"
"us-or-1.siasky.net" "us-or-2.siasky.net" "us-or-1.siasky.net" "us-or-2.siasky.net"
"us-la-1.siasky.net" "us-la-2.siasky.net" "us-la-3.siasky.net"
"us-pa-1.siasky.net" "us-pa-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" "us-va-1.siasky.net" "us-va-2.siasky.net" "us-va-3.siasky.net" "us-va-4.siasky.net" "us-va-5.siasky.net" "us-va-6.siasky.net"
"as-hk-1.siasky.net" "as-hk-1.siasky.net" "as-sp-1.siasky.net" "as-sp-2.siasky.net"
"siasky.xyz" "dev1.siasky.dev" "dev2.siasky.dev" "dev3.siasky.dev") "siasky.xyz" "dev1.siasky.dev" "dev2.siasky.dev" "dev3.siasky.dev")
for server in "${servers[@]}"; for server in "${servers[@]}";
do do
for skylink in "${skylinks[@]}"; for skylink in "${skylinks[@]}";
do do
echo ".. ⌁ Blocking skylink ${skylink} on ${server}" echo ".. ⌁ Blocking skylink ${skylink} on ${server}"
cached_files_command="find /data/nginx/cache/ -type f | xargs -r grep -Elsq '^Skynet-Skylink: ${skylink}'"
# Add to blocklist
ssh -q -t user@${server} "docker exec sia siac skynet blocklist add ${skylink}"
# Remove from NGINX cache
cached_files_command="find /data/nginx/cache/ -type f | xargs -r grep -Els '^Skynet-Skylink: ${skylink}'"
ssh -q -t user@${server} "docker exec -it nginx bash -c ${cached_files_command} | xargs -r rm" ssh -q -t user@${server} "docker exec -it nginx bash -c ${cached_files_command} | xargs -r rm"
echo ".. ⌁ Skylink ${skylink} Blocked on ${server}" echo ".. ⌁ Skylink ${skylink} Blocked on ${server}"
echo "--------------------------------------------" echo "--------------------------------------------"
done 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: