The Game of Games
All pull requests must be branched off of and then requested to merge into the dev branch. We will periodically merge the dev branch into the main prod branch as releases.
Environment variables must either be set or included in .env file inside of the backend folder.
AWS access keys for S3 uploading:
Be sure to use sudo -E
when running node on port 80 to pass environment variables to the root user.
ACCESS_KEY_ID=******************
SECRET_ACCESS_KEY=****************************
setup nginx + let's encrypt ssl + pm2 to auto renew certificates without disrupting server.
https://www.learnwithjason.dev/blog/deploy-nodejs-ssl-digitalocean
Then start server
pm2 start 'node server.js -p 5000'
Edit the file to add a post hook so that nginx restarts when certificate is renewed
sudo vi /etc/letsencrypt/renewal/server.playruski.com.conf
and add
post_hook = /bin/systemctl reload nginx
somewhere below
[renewalparams]
Run crontab -e
to edit your crontab and add the following line:
11 23 * * * ~/ruski/backend/cronjob-script.py 1> ~/ruski/backend/yack-beer-totals.json
{
"Version": "2008-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::***********:user/username"
},
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::myBucket/*"
},
{
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::myBucket/*"
}
]
}
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"PUT"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": []
}
]