Staging Env Files
This commit is contained in:
@@ -20,3 +20,5 @@ npx deadfile ./src/index.js --exclude build templates
|
|||||||
cd client && yarn build && cd build && scp -r \*\* imex@prod-tor1.imex.online:~/bodyshop/client/build && cd .. &&cd ..
|
cd client && yarn build && cd build && scp -r \*\* imex@prod-tor1.imex.online:~/bodyshop/client/build && cd .. &&cd ..
|
||||||
|
|
||||||
gq https://bodyshop-dev-db.herokuapp.com/v1/graphql -H "X-Hasura-Admin-Secret: Dev-BodyShopAppBySnaptSoftware\!" --introspect > schema.graphql
|
gq https://bodyshop-dev-db.herokuapp.com/v1/graphql -H "X-Hasura-Admin-Secret: Dev-BodyShopAppBySnaptSoftware\!" --introspect > schema.graphql
|
||||||
|
|
||||||
|
npx hasura migrate apply --endpoint https://db.test.bodyshop.app/ --admin-secret 'Test-ImEXOnlineBySnaptSoftware!'
|
||||||
|
|||||||
@@ -3,13 +3,14 @@
|
|||||||
ssh-keygen -t rsa -C "your_email@example.com"
|
ssh-keygen -t rsa -C "your_email@example.com"
|
||||||
|
|
||||||
Copy the new key to clipboard:
|
Copy the new key to clipboard:
|
||||||
* Windows: clip < id_rsa.pub
|
|
||||||
* Linux: sudo apt-get install xclip
|
|
||||||
xclip -sel clip < ~/.ssh/id_rsa.pub
|
|
||||||
* Mac: pbcopy < ~/.ssh/id_rsa.pub
|
|
||||||
* Manual Copy: cat ~/.ssh/id_rsa.pub
|
|
||||||
|
|
||||||
Add the SSH key to the drop creation screen.
|
- Windows: clip < id_rsa.pub
|
||||||
|
- Linux: sudo apt-get install xclip
|
||||||
|
xclip -sel clip < ~/.ssh/id_rsa.pub
|
||||||
|
- Mac: pbcopy < ~/.ssh/id_rsa.pub
|
||||||
|
- Manual Copy: cat ~/.ssh/id_rsa.pub
|
||||||
|
|
||||||
|
Add the SSH key to the drop creation screen.
|
||||||
|
|
||||||
1. Create a new user to replace root user
|
1. Create a new user to replace root user
|
||||||
1. # adduser imex
|
1. # adduser imex
|
||||||
@@ -19,7 +20,7 @@ Add the SSH key to the drop creation screen.
|
|||||||
5. $ chmod 700 ~/.ssh
|
5. $ chmod 700 ~/.ssh
|
||||||
6. $ nano ~/.ssh/authorized_keys
|
6. $ nano ~/.ssh/authorized_keys
|
||||||
7. Add the copied SSH key and save.
|
7. Add the copied SSH key and save.
|
||||||
8. $ chmod 600 ~/.ssh/authorized_keys #Restrict access to authorized keys.
|
8. $ chmod 600 ~/.ssh/authorized_keys #Restrict access to authorized keys.
|
||||||
2. Setup the Firewall
|
2. Setup the Firewall
|
||||||
1. $ sudo ufw allow OpenSSH.
|
1. $ sudo ufw allow OpenSSH.
|
||||||
2. $ sudo ufw enable
|
2. $ sudo ufw enable
|
||||||
@@ -32,44 +33,47 @@ Add the SSH key to the drop creation screen.
|
|||||||
2. Nginx Http: Opens only port 80 (normal, unencrypted web traffic)
|
2. Nginx Http: Opens only port 80 (normal, unencrypted web traffic)
|
||||||
3. Nginx Https: Opens only port 443 (TLS/SSL encrypted traffic)
|
3. Nginx Https: Opens only port 443 (TLS/SSL encrypted traffic)
|
||||||
5. Should now be able to go to IP and see nginx responding with a blank page.
|
5. Should now be able to go to IP and see nginx responding with a blank page.
|
||||||
6. Install NodeJs
|
4. Install NodeJs
|
||||||
1. $ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
|
1. $ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
|
||||||
2. $ sudo apt install nodejs
|
2. $ sudo apt install nodejs
|
||||||
3. $ node --version
|
3. $ node --version
|
||||||
7. Clone Source Code
|
5. Clone Source Code
|
||||||
1. $ git clone git@bitbucket.org:snaptsoft/bodyshop.git //Requires SSH setup.
|
1. $ git clone git@bitbucket.org:snaptsoft/bodyshop.git //Requires SSH setup.
|
||||||
2. $ cd bodyshop && npm install //Install all server dependencies.
|
2. $ cd bodyshop && npm install //Install all server dependencies.
|
||||||
8. Setup PM2
|
6. Setup PM2
|
||||||
1. $ npm install pm2 -g //Had to be run as root.
|
1. $ npm install pm2 -g //Had to be run as root.
|
||||||
2. $ pm2 start ecosystem.config.js
|
2. $ pm2 start ecosystem.config.js
|
||||||
3. $ pm2 startup ubuntu //Ensure it starts when server does.
|
3. $ pm2 startup ubuntu //Ensure it starts when server does.
|
||||||
9. Alter Nginx config
|
7. Alter Nginx config
|
||||||
1. sudo nano /etc/nginx/sites-available/default
|
1. sudo nano /etc/nginx/sites-available/default
|
||||||
2. //Add Appropriate server names to the file. www. and non-www.
|
2. //Add Appropriate server names to the file. www. and non-www.
|
||||||
3. Add the following inside the location of the server block:
|
3. Add the following inside the location of the server block:
|
||||||
proxy_pass http://localhost:5000;
|
proxy_pass http://localhost:5000;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection 'upgrade';
|
proxy_set_header Connection 'upgrade';
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_cache_bypass $http_upgrade;
|
proxy_cache_bypass $http_upgrade;
|
||||||
10. Install Certbot
|
8. Install Certbot
|
||||||
4. $ sudo add-apt-repository ppa:certbot/certbot //Potential issue on ubuntu 20.04
|
9. $ sudo add-apt-repository ppa:certbot/certbot //Potential issue on ubuntu 20.04
|
||||||
5. $ sudo apt-get update
|
10. $ sudo apt-get update
|
||||||
6. $ sudo apt install python-certbot-nginx
|
11. $ sudo apt install python-certbot-nginx
|
||||||
7. $ sudo nano /etc/nginx/sites-available/default
|
12. $ sudo nano /etc/nginx/sites-available/default
|
||||||
8. Find the existing server_name line and replace the underscore with your domain name:
|
13. Find the existing server_name line and replace the underscore with your domain name:
|
||||||
...
|
...
|
||||||
server_name example.com www.example.com;
|
server_name example.com www.example.com;
|
||||||
...
|
...
|
||||||
9. $ sudo nginx -t //Verify syntax.
|
14. $ sudo nginx -t //Verify syntax.
|
||||||
10. $ sudo systemctl reload nginx
|
15. $ sudo systemctl reload nginx
|
||||||
11. Generate Certificate
|
##AWS INSTRUCTIONS
|
||||||
11. $ sudo certbot --nginx -d example.com -d www.example.com //Follow prompts.
|
$ sudo snap install core; sudo snap refresh core
|
||||||
12. $ sudo certbot renew --dry-run //Dry run to test auto renewal.
|
$ sudo snap install --classic certbot
|
||||||
|
$ sudo ln -s /snap/bin/certbot /usr/bin/certbot
|
||||||
|
16. Generate Certificate
|
||||||
|
17. $ sudo certbot --nginx -d example.com -d www.example.com //Follow prompts.
|
||||||
|
18. $ sudo certbot renew --dry-run //Dry run to test auto renewal.
|
||||||
|
|
||||||
ADding Yarn
|
ADding Yarn
|
||||||
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
||||||
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
||||||
sudo apt-get update && sudo apt-get install yarn
|
sudo apt-get update && sudo apt-get install yarn
|
||||||
|
|||||||
Reference in New Issue
Block a user