Switch from `/home/user/.sia/sia.env` to `/home/user/skynet-webportal/.env`.

This commit is contained in:
Ivaylo Novakov 2020-08-19 19:14:55 +03:00
parent 341c65eba8
commit af49e65b04
No known key found for this signature in database
GPG Key ID: 06B9354AB08BE9C6
2 changed files with 8 additions and 5 deletions

View File

@ -17,17 +17,20 @@ sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-
sudo chmod +x /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version # sanity check docker-compose --version # sanity check
# Create dummy .env file for docker-compose usage with veriables # Create dummy .env file for docker-compose usage with variables
# * DOMAIN_NAME - the domain name your server is using ie. example.com # * DOMAIN_NAME - the domain name your server is using ie. example.com
# * EMAIL_ADDRESS - this is the administrator contact email you need to supply for communication regarding SSL certification # * EMAIL_ADDRESS - this is the administrator contact email you need to supply for communication regarding SSL certification
# * HSD_API_KEY - this is auto generated secure key for your handshake service integration # * HSD_API_KEY - this is auto generated secure key for your handshake service integration
# * CLOUDFLARE_AUTH_TOKEN` - (optional) if using cloudflare as dns loadbalancer (need to change it in Caddyfile too) # * CLOUDFLARE_AUTH_TOKEN` - (optional) if using cloudflare as dns loadbalancer (need to change it in Caddyfile too)
# * AWS_ACCESS_KEY_ID - (optional) if using route53 as a dns loadbalancer # * AWS_ACCESS_KEY_ID - (optional) if using route53 as a dns loadbalancer
# * AWS_SECRET_ACCESS_KEY - (optional) if using route53 as a dns loadbalancer # * AWS_SECRET_ACCESS_KEY - (optional) if using route53 as a dns loadbalancer
# * API_PORT - (optional) the port on which siad is listening, defaults to 9980
# * PORTAL_NAME - the name of the portal, required by the discord bot
# * DISCORD_BOT_TOKEN - required by the discord bot
if ! [ -f /home/user/skynet-webportal/.env ]; then if ! [ -f /home/user/skynet-webportal/.env ]; then
HSD_API_KEY=$(openssl rand -base64 32) # generate safe random key for handshake HSD_API_KEY=$(openssl rand -base64 32) # generate safe random key for handshake
printf "DOMAIN_NAME=example.com\nEMAIL_ADDRESS=email@example.com\nSIA_WALLET_PASSWORD=\nHSD_API_KEY=${HSD_API_KEY}\nCLOUDFLARE_AUTH_TOKEN=\nAWS_ACCESS_KEY_ID=\nAWS_SECRET_ACCESS_KEY=\n" > /home/user/skynet-webportal/.env printf "DOMAIN_NAME=example.com\nEMAIL_ADDRESS=email@example.com\nSIA_WALLET_PASSWORD=\nHSD_API_KEY=${HSD_API_KEY}\nCLOUDFLARE_AUTH_TOKEN=\nAWS_ACCESS_KEY_ID=\nAWS_SECRET_ACCESS_KEY=\nPORTAL_NAME=\nDISCORD_BOT_TOKEN=\n" > /home/user/skynet-webportal/.env
fi fi
# Start docker container with nginx and client # Start docker container with nginx and client
docker-compose -f docker-compose.yml up --build -d docker-compose -f docker-compose.yml up --build -d

View File

@ -8,8 +8,8 @@ sudo apt-get -y install python3-pip
pip3 install discord.py pip3 install discord.py
pip3 install python-dotenv pip3 install python-dotenv
fundsCheck="0 0,8,16 * * * /home/user/skynet-webportal/setup-scripts/funds-checker.py /home/user/.sia/sia.env" fundsCheck="0 0,8,16 * * * /home/user/skynet-webportal/setup-scripts/funds-checker.py /home/user/skynet-webportal/.env"
logsCheck="0 0,8,16 * * * /home/user/skynet-webportal/setup-scripts/log-checker.py /home/user/.sia/sia.env sia 8" logsCheck="0 0,8,16 * * * /home/user/skynet-webportal/setup-scripts/log-checker.py /home/user/skynet-webportal/.env sia 8"
(crontab -u user -l; echo "$fundsCheck" ) | crontab -u user - (crontab -u user -l; echo "$fundsCheck" ) | crontab -u user -
(crontab -u user -l; echo "$logsCheck" ) | crontab -u user - (crontab -u user -l; echo "$logsCheck" ) | crontab -u user -