Updated firebase vapid key to use ENV.

This commit is contained in:
Patrick Fic
2020-05-06 17:43:58 -07:00
parent 33bbcc8c95
commit 61baf30052
2 changed files with 15 additions and 16 deletions

View File

@@ -40,10 +40,9 @@ Add the SSH key to the drop creation screen.
1. $ git clone git@bitbucket.org:snaptsoft/bodyshop.git //Requires SSH setup.
2. $ cd bodyshop && npm install //Install all server dependencies.
8. Setup PM2
1. $ npm install pm2 -g
2. copy the environment variables to the local .env file.
3. $ pm2 start ecosystem.config.js
4. $ pm2 startup ubuntu //Ensure it starts when server does.
1. $ npm install pm2 -g //Had to be run as root.
2. $ pm2 start ecosystem.config.js
3. $ pm2 startup ubuntu //Ensure it starts when server does.
9. Alter Nginx config
1. sudo nano /etc/nginx/sites-available/default
2. //Add Appropriate server names to the file. www. and non-www.
@@ -54,20 +53,20 @@ Add the SSH key to the drop creation screen.
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
9. Install Certbot
1. $ sudo add-apt-repository ppa:certbot/certbot //Potential issue on ubuntu 20.04
2. $ sudo apt-get update
3. $ sudo apt install python-certbot-nginx
4. $ sudo nano /etc/nginx/sites-available/default
5. Find the existing server_name line and replace the underscore with your domain name:
10. Install Certbot
4. $ sudo add-apt-repository ppa:certbot/certbot //Potential issue on ubuntu 20.04
5. $ sudo apt-get update
6. $ sudo apt install python-certbot-nginx
7. $ sudo nano /etc/nginx/sites-available/default
8. Find the existing server_name line and replace the underscore with your domain name:
...
server_name example.com www.example.com;
...
6. $ sudo nginx -t //Verify syntax.
7. $ sudo systemctl reload nginx
10. Generate Certificate
1. $ sudo certbot --nginx -d example.com -d www.example.com //Follow prompts.
2. $ sudo certbot renew --dry-run //Dry run to test auto renewal.
9. $ sudo nginx -t //Verify syntax.
10. $ sudo systemctl reload nginx
11. Generate Certificate
11. $ sudo certbot --nginx -d example.com -d www.example.com //Follow prompts.
12. $ sudo certbot renew --dry-run //Dry run to test auto renewal.
ADding Yarn

View File

@@ -39,7 +39,7 @@ try {
messaging = firebase.messaging();
messaging.usePublicVapidKey(
// Project Settings => Cloud Messaging => Web Push certificates
"BBlvtEL73vYinkiAgK5t51jgDTYj6961OO_5niP4Q5py_l5yhTL8IGYkpONyMGoXs8ZTdVhEWsu3_IEXcW0cIIg"
process.env.REACT_APP_FIREBASE_PUBLIC_VAPID_KEY
);
console.log("Firebase Messaging initialized successfully.");
} catch {