Updated firebase vapid key to use ENV.
This commit is contained in:
@@ -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.
|
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
|
8. Setup PM2
|
||||||
1. $ npm install pm2 -g
|
1. $ npm install pm2 -g //Had to be run as root.
|
||||||
2. copy the environment variables to the local .env file.
|
2. $ pm2 start ecosystem.config.js
|
||||||
3. $ pm2 start ecosystem.config.js
|
3. $ pm2 startup ubuntu //Ensure it starts when server does.
|
||||||
4. $ pm2 startup ubuntu //Ensure it starts when server does.
|
|
||||||
9. Alter Nginx config
|
9. 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.
|
||||||
@@ -54,20 +53,20 @@ Add the SSH key to the drop creation screen.
|
|||||||
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;
|
||||||
9. Install Certbot
|
10. Install Certbot
|
||||||
1. $ sudo add-apt-repository ppa:certbot/certbot //Potential issue on ubuntu 20.04
|
4. $ sudo add-apt-repository ppa:certbot/certbot //Potential issue on ubuntu 20.04
|
||||||
2. $ sudo apt-get update
|
5. $ sudo apt-get update
|
||||||
3. $ sudo apt install python-certbot-nginx
|
6. $ sudo apt install python-certbot-nginx
|
||||||
4. $ sudo nano /etc/nginx/sites-available/default
|
7. $ sudo nano /etc/nginx/sites-available/default
|
||||||
5. Find the existing server_name line and replace the underscore with your domain name:
|
8. 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;
|
||||||
...
|
...
|
||||||
6. $ sudo nginx -t //Verify syntax.
|
9. $ sudo nginx -t //Verify syntax.
|
||||||
7. $ sudo systemctl reload nginx
|
10. $ sudo systemctl reload nginx
|
||||||
10. Generate Certificate
|
11. Generate Certificate
|
||||||
1. $ sudo certbot --nginx -d example.com -d www.example.com //Follow prompts.
|
11. $ sudo certbot --nginx -d example.com -d www.example.com //Follow prompts.
|
||||||
2. $ sudo certbot renew --dry-run //Dry run to test auto renewal.
|
12. $ sudo certbot renew --dry-run //Dry run to test auto renewal.
|
||||||
|
|
||||||
|
|
||||||
ADding Yarn
|
ADding Yarn
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ try {
|
|||||||
messaging = firebase.messaging();
|
messaging = firebase.messaging();
|
||||||
messaging.usePublicVapidKey(
|
messaging.usePublicVapidKey(
|
||||||
// Project Settings => Cloud Messaging => Web Push certificates
|
// 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.");
|
console.log("Firebase Messaging initialized successfully.");
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
Reference in New Issue
Block a user