Skip to content

Commit

Permalink
simplify instructions for adding private key to .env file see dwyl/le…
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Mar 26, 2018
1 parent a81aa97 commit 1651955
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,24 +260,30 @@ it's just for demonstration purposes. <br />
but this is what your RSA private key will
**look** like, a block of random characters ..._</small>


The downloaded file contains the private key.
Save this file in the root
of the `github-backup` repo on your `localhost`.

For _example_ in _our_ case the GitHub app is called "**gitbu**", <br />
so our Private Key file starts with the app name
and the date the key was generated:
`gitbu.2018-03-23.private-key.pem`
and the _date_ the key was generated. <br />
e.g: `gitbu.2018-03-23.private-key.pem`


> <small>_**Don't worry**, all `.pem` (private key) files
are ignored in the `.gitignore` file so your file will stay private._</small>
Once you have copied the file into your project root, run the following command:
```sh
source keytoenvar.sh PRIVATE_KEY ./gitbu.2018-03-23.private-key.pem
echo "export PRIVATE_KEY='`cat ./gitbu.2018-03-23.private-key.pem`'" >> .env
```
Replace the `gitbu.2018-03-23.private-key.pem` part in the command
with the name of _your_ private key file
e.g: `my-github-backup-app.2018-04-01.private-key.pem`

That will create an entry in the `.env` file for your `PRIVATE_KEY`
environment variable.


#### 7. Copy the App Name and App `ID` from GitHub App Settings Page

Expand Down Expand Up @@ -425,9 +431,13 @@ Open http://localhost:4000 in your web browser. You should see something like:
To test your github-backup server try installing your app
onto one of your repos.

#### 1. Visit Your App's GitHub Page

Visit your App's URL on GitHub e.g: https://github.com/apps/gitbu


Install the app on one of your Repositories e.g:

You should see the payload of the request in the tab you
have open in your terminal for the phoenix server:

Expand Down
4 changes: 0 additions & 4 deletions keytoenvar.sh

This file was deleted.

0 comments on commit 1651955

Please sign in to comment.