Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #23 from uniquelyparticular/feat/secureFirestore
Browse files Browse the repository at this point in the history
feat: Added secure firestore, fix: now deployment issues w npm vs yarn
  • Loading branch information
agrohs authored Jun 5, 2019
2 parents 61f63f9 + 9a82cb1 commit c4359c4
Show file tree
Hide file tree
Showing 6 changed files with 801 additions and 14,496 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ Create a `.env` at the project root with the following credentials:

```dosini
DEPLOYED_URI
FIREBASE_API_KEY
FIREBASE_PROJECT_ID
FIREBASE_CLIENT_ID
FIREBASE_PRIVATE_KEY_ID
FIREBASE_PRIVATE_KEY
SHOPIFY_OAUTH_SCOPES
SHOPIFY_API_KEY
SHOPIFY_API_SECRET
Expand All @@ -36,7 +38,17 @@ SHOPIFY_API_SECRET

`DEPLOYED_URI` should be set to your `ngrok URL` from above (ie. `https://312a9670.ngrok.io`)

Open the [Firebase Console](https://console.firebase.google.com) to create a new Project (or you can use an existing one) to use for storing temporary nonce date. Click `Add Project`, enter anything in the `Project Name` field then click `Create Project`. When you receive the 'Your new project is ready' confirmation, click `Continue`. Under the 'Get started by adding Firebase to your app', click the icon for `Web` < /> and then in that popup you will find your configuration information to use for `FIREBASE_API_KEY` (apiKey) and `FIREBASE_PROJECT_ID` (projectId).
Open the [Firebase Console](https://console.firebase.google.com) to create a new Project (or you can use an existing one) to use for storing temporary nonce date. Click `Add Project`, enter anything in the `Project Name` field then click `Create Project`. When you receive the 'Your new project is ready' confirmation, click `Continue`.

Go into the `Settings` for your new project (click gear icon) and click on `Service Accounts` tab. Click the `Generate new private key` button to download a JSON file containing your Service Account credentials.

From that JSON file, copy the following to your env entries:
`project_id` >> `FIREBASE_PROJECT_ID`
`client_id` >> `FIREBASE_CLIENT_ID`
`private_key_id` >> `FIREBASE_PRIVATE_KEY_ID`

Grab the value of the key containing between `-----BEGIN PRIVATE KEY-----` and `-----END PRIVATE KEY-----\n` to set as the value of `FIREBASE_PRIVATE_KEY`
\*If deploying to Zeit Now instead of ngrok, make sure to replace `\n` in the string w/ `\\n` before storing as a secret.

---

Expand Down
6 changes: 4 additions & 2 deletions now.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
"SHOPIFY_OAUTH_SCOPES": "@demo-shopify-oauth-scopes",
"SHOPIFY_API_KEY": "@demo-shopify-api-key",
"SHOPIFY_API_SECRET": "@demo-shopify-api-secret",
"FIREBASE_API_KEY": "@demo-firebase-api-key",
"FIREBASE_PROJECT_ID": "@demo-firebase-project-id"
"FIREBASE_PROJECT_ID": "@particular-firebase-project-id",
"FIREBASE_CLIENT_ID": "@particular-firebase-client-id",
"FIREBASE_PRIVATE_KEY_ID": "@particular-firebase-pk-id",
"FIREBASE_PRIVATE_KEY": "@particular-firebase-pk"
},
"routes": [{ "src": "/(.*)", "dest": "/src" }],
"builds": [
Expand Down
Loading

1 comment on commit c4359c4

@vercel
Copy link

@vercel vercel bot commented on c4359c4 Jun 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.