Merge pull request #1973 from SkynetLabs/ivo/update_portal_scripts

Update portal control scripts
This commit is contained in:
Ivaylo Novakov 2022-04-11 18:09:17 +02:00 committed by GitHub
commit d0a253c5fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 7 deletions

View File

@ -5,8 +5,8 @@
Latest Skynet Webportal setup documentation and the setup process Skynet Labs Latest Skynet Webportal setup documentation and the setup process Skynet Labs
supports is located at https://docs.siasky.net/webportal-management/overview. supports is located at https://docs.siasky.net/webportal-management/overview.
Some of the scripts and setup documentation contained in this repository Some scripts and setup documentation contained in this repository
(`skynet-webportal`) can be outdated and generally should not be used. (`skynet-webportal`) may be outdated and generally should not be used.
## Web application ## Web application
@ -35,7 +35,7 @@ For the purposes of complying with our code license, you can use the following S
`fb6c9320bc7e01fbb9cd8d8c3caaa371386928793c736837832e634aaaa484650a3177d6714a` `fb6c9320bc7e01fbb9cd8d8c3caaa371386928793c736837832e634aaaa484650a3177d6714a`
## Running a Portal ## Running a Portal
For those interested in running a Webportal, head over to our developer docs [here](https://docs.siasky.net/webportal-management/overview.) to learn more. For those interested in running a Webportal, head over to our developer docs [here](https://portal-docs.skynetlabs.com/) to learn more.
## Contributing ## Contributing

View File

@ -2,16 +2,22 @@
set -e # exit on first error set -e # exit on first error
while getopts d:t: flag while getopts d:t:r: flag
do do
case "${flag}" in case "${flag}" in
d) delay=${OPTARG};; d) delay=${OPTARG};;
t) timeout=${OPTARG};; t) timeout=${OPTARG};;
r) reason=${OPTARG};;
esac esac
done done
delay=${delay:-0} # default to no delay delay=${delay:-0} # default to no delay
timeout=${timeout:-300} # default timeout is 300s timeout=${timeout:-300} # default timeout is 300s
if [[ -z $reason ]]; then
echo "Please provide a reason for disabling the portal (use '-r <reason>')."
exit 1
fi
countdown() { countdown() {
local secs=$1 local secs=$1
while [ $secs -gt 0 ]; do while [ $secs -gt 0 ]; do
@ -24,8 +30,8 @@ countdown() {
# delay disabling the portal # delay disabling the portal
countdown $delay countdown $delay
# stop healh-check so the server is taken our of load balancer # stop health-check so the server is taken our of load balancer
docker exec health-check cli/disable docker exec health-check cli disable $reason
# then wait 5 minutes for the load balancer to propagate the dns records # then wait 5 minutes for the load balancer to propagate the dns records
countdown $timeout countdown $timeout

View File

@ -3,4 +3,4 @@
set -e # exit on first error set -e # exit on first error
# start the health-checks service # start the health-checks service
docker exec health-check cli/enable docker exec health-check cli enable