Skip to content

Commit

Permalink
fix: review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
msagi committed Apr 5, 2024
1 parent 19ef023 commit f93c0a8
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 22 deletions.
104 changes: 99 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.1.0",
"description": "Deploy custom push protections and policies on top of Git.",
"scripts": {
"cli": "node ./src/cli/git-proxy-cli.js",
"cli": "node ./packages/git-proxy-cli/index.js",
"client": "vite --config vite.config.js",
"clientinstall": "npm install --prefix client",
"server": "node index.js",
Expand Down Expand Up @@ -77,7 +77,7 @@
"eslint-config-prettier": "^9.0.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "^7.21.5",
Expand Down
8 changes: 8 additions & 0 deletions website/docs/configuration/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ export GIT_PROXY_SERVER_PORT="9090"
Note that `GIT_PROXY_UI_PORT` is needed for both server and UI Node processes,
whereas `GIT_PROXY_SERVER_PORT` is only needed by the server process.

By default, Git Proxy CLI connects to Git Proxy running on localhost and default port. This can be
changed by setting the `GIT_PROXY_UI_HOST` and `GIT_PROXY_UI_PORT` environment variables:

```
export GIT_PROXY_UI_HOST="http://www.git-proxy.com"
export GIT_PROXY_UI_PORT="5000"
```

### Validate configuration

To validate your Git Proxy configuration, run:
Expand Down
4 changes: 2 additions & 2 deletions website/docs/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To install Git Proxy, you must first install [Node.js](https://nodejs.org/en/dow
npm install -g @finos/git-proxy
```

To install the GitProxy Command Line Interface (CLI), run:
To install the Git Proxy Command Line Interface (CLI), run:
```bash
npm install -g @finos/git-proxy-cli
```
Expand All @@ -24,7 +24,7 @@ To install a specific version of Git Proxy, append the version to the end of the
npm install -g @finos/git-proxy@1.1.0
```

To install a specific version of the GitProxy CLI, append the version to the end of the install command:
To install a specific version of the Git Proxy CLI, append the version to the end of the install command:

```bash
npm install -g @finos/git-proxy-cli@1.0.0
Expand Down
14 changes: 5 additions & 9 deletions website/docs/quickstart/approve.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ curl -H "Content-Type: application/json" -c git-proxy-cookie -X POST \
Using the [cookie](/docs/quickstart/approve#2-authenticate-with-the-api) generated, execute a `GET` request to confirm that your push with `ID` exists in the database:

```bash
curl -b ./git-proxy-cookie \
-X GET http://localhost:8080/api/v1/push/${ID}
curl -I -b ./git-proxy-cookie http://localhost:8080/api/v1/push/${ID}
```

You should receive a `200 OK` in the response. Note: if given `ID` does not exist then you receive a `404 not found`.
You should receive a `200 OK` in the response. If `ID` does not exist then you'll receive a `404` error.

#### 4. Approve the push with `ID`

Expand Down Expand Up @@ -104,18 +103,16 @@ Use the default & auto-generated Git Proxy username & password credentials to au

```bash
$ npx -- @finos/git-proxy-cli login --username admin --password admin
Git-Proxy URL: http://git-proxy.com:8080
Login 'admin': OK
Login "admin" <admin@place.com> (admin): OK
```

#### 3. Approve the push with `ID`

Use the commit `ID` to approve your push with the CLI:

```bash
$ npx -- @finos/git-proxy-cli approve --commitId 0000000000000000000000000000000000000000__79b4d8953cbc324bcc1eb53d6412ff89666c241f
Git-Proxy URL: http://git-proxy.com:8080
Approve: ID: '0000000000000000000000000000000000000000__79b4d8953cbc324bcc1eb53d6412ff89666c241f': OK
$ npx -- @finos/git-proxy-cli authorise --id 0000000000000000000000000000000000000000__79b4d8953cbc324bcc1eb53d6412ff89666c241f
Authorise: ID: '0000000000000000000000000000000000000000__79b4d8953cbc324bcc1eb53d6412ff89666c241f': OK
```

#### 4. Re-push your code
Expand All @@ -139,7 +136,6 @@ Clean up your connect cookie via logging out:

```bash
$ npx -- @finos/git-proxy-cli logout
Git-Proxy URL: http://git-proxy.com:8080
Logout: OK
```

Expand Down
6 changes: 2 additions & 4 deletions website/docs/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,19 @@ Once you have followed the [installation](installation) steps, run:
git-proxy
```

To run Git Proxy CLI
To run Git Proxy using the CLI
```bash
git-proxy-cli
```

### Using [npx instead of npm](https://www.freecodecamp.org/news/npm-vs-npx-whats-the-difference/)

You can also install & run `git-proxy` and `git-proxy-cli` in one step:
You can also install & run `git-proxy` and `git-proxy-cli` in two steps:

Git Proxy
```bash
npx -- @finos/git-proxy
```

Git Proxy CLI
```bash
npx -- @finos/git-proxy-cli
```

0 comments on commit f93c0a8

Please sign in to comment.