Skip to content

Commit 5a7569d

Browse files
committed
ORGANIC-443. Added instructions to run git-gateway.
1 parent f643682 commit 5a7569d

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.env
2+
my.env
23
gorm.db
34
vendor/
45
git-gateway

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ However, for most use cases you won’t want to require all content editors to h
1010

1111
Netlify’s Git Gateway lets you setup a gateway to your choice of Git provider's API ( now available with both GitHub and GitLab 🎉 ) that lets tools like Netlify CMS work with content, branches and pull requests on your users’ behalf.
1212

13-
The Git Gateway works with any identity service that can issue JWTs and only allows access when a JSON Web Token with sufficient permissions is present.
13+
The Git Gateway works with some supported identity service that can issue JWTs and only allows access when a JSON Web Token with sufficient permissions is present.
1414

1515
To configure the gateway, see our `example.env` file
1616

@@ -29,3 +29,32 @@ for GitLab:
2929
/repos/:owner/:name/commits/
3030
/repos/:owner/:name/tree/
3131
```
32+
33+
**Running git-gateway to test locally**
34+
**(Do not merge this section back to the open source project)**
35+
**(Do not deploy it to production. It is a Proof of Concept has has not been secured. See @TODO items in code.**
36+
**(the instruction assume Okta, and github.com)**
37+
38+
1. pull down this project
39+
2. generate a `personal access token` on github. (recommended: using a test account and w/ `repo:status` and `public_repo` permission only)
40+
https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
41+
3. `cp example.env my.env`
42+
4. update `GITGATEWAY_GITHUB_ACCESS_TOKEN` value in `my.env` accordingly
43+
5. update `GITGATEWAY_GITHUB_REPO` value in `my.env` (it will be where the content being stored, eg, `owner/netlify-test`.)
44+
6. sign up for a Dev account on Okta: https://developer.okta.com/signup/
45+
7. create a SPA Application onto the Dev account:
46+
a. fill out the details
47+
b. Pick "Send ID Token directly to app (Okta Simplified)"
48+
c. have redirect uri points to the url of your content-cms ip:port
49+
(eg, `http://localhost:8080/admin` etc, see, https://github.com/<< your org >>/content-cms)
50+
8. update `ISSUER` value in `my.env` accordingly (eg, `https://dev-1234.oktapreview.com/oauth2/default`)
51+
9. update `CLIENT_ID` value in `my.env` accordingly (eg, `32q897q234q324rq42322q`)
52+
10. install Docker and add the `localdev` network
53+
11. inspect Dockfile and then build the docker with this command:
54+
`docker build -t netlify/git-gateway:latest .`
55+
12. run `git-gateway` with this command:
56+
`docker run --rm --env-file my.env --net localdev -p 127.0.0.1:8087:8087 --expose 8087 -ti --name netlify-git-gateway "netlify/git-gateway:latest"`
57+
13. update `config.yml` in your content-cms repo (ie, https://github.com/<< your org >>/content-cms).
58+
change `backend.name` value to `git-gateway`
59+
change `backend.gateway_url` value to `http://localhost:8087`
60+
14. run `content-cms` following the README.md

0 commit comments

Comments
 (0)