From 96aee9a98bd0465b547934e15c4618d69b7167ea Mon Sep 17 00:00:00 2001 From: Thomas Cooper Date: Thu, 26 Oct 2023 22:41:17 -0400 Subject: [PATCH 01/12] docs: cleanup README, clarify npx usage - shorten the README to include minimal instructions. Link to doc site for detailed documentation. - remove boilerplate from README for contributing steps. Moved those guidelines to CONTRIBUTING doc - use simplified npx commands for executing git-proxy --- CONTRIBUTING.md | 3 + README.md | 254 ++++---------------------- website/docs/quickstart/intercept.mdx | 2 +- website/docs/usage.mdx | 4 +- 4 files changed, 45 insertions(+), 218 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 70cfa101..9570a7db 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,6 +11,9 @@ Before making a contribution, please take the following steps: 4. Fork the project repository and prepare your proposed contribution. 5. Submit a pull request. +If this is your first time contributing to open source projects on GitHub, it's recommended that you +follow the [contribution guide for first-time contributors](https://github.com/firstcontributions/first-contributions#first-contributions). + NOTE: All contributors must have a contributor license agreement (CLA) on file with FINOS before their pull requests will be merged. Please review the FINOS [contribution requirements](https://finosfoundation.atlassian.net/wiki/spaces/FINOS/pages/75530375/Contribution+Compliance+Requirements) and submit (or have your employer submit) the required CLA before submitting a pull request. ## Governance diff --git a/README.md b/README.md index cd60e2b0..9a62394d 100644 --- a/README.md +++ b/README.md @@ -46,234 +46,59 @@ Git Proxy deploys custom push protections and policies on top of Git. It is a hi Git Proxy is built with a developer-first mindset. By presenting simple-to-follow remediation instructions in the CLI/Terminal, it minimises the friction of use and adoption, and keeps developers focused on what matters; committing and pushing code. -## Installation +## Getting Started 🚀 -To install Git Proxy, you must first install [Node.js](https://nodejs.org/en/download). Then, use the [npm](https://www.npmjs.com/) package manager: +Install & run git-proxy (requires [Nodejs](https://nodejs.org/en/download/)): ```bash -npm install -g @finos/git-proxy +$ npx -- @finos/git-proxy +Need to install the following packages: + @finos/git-proxy@1.1.0 +Ok to proceed? (y) +... +creating user + user=admin, + gitAccount=none + email=admin@place.com, + admin=true +Service Listening on 8080 +Listening on 8000 ``` -To install a specific version of Git Proxy, append the version to the end of the `install` command: +Clone a repository, set the remote to the Git Proxy URL and push your changes: ```bash -npm install -g @finos/git-proxy@1.1.0 +$ git clone https://github.com/octocat/Hello-World.git && cd Hello-World +$ gh repo fork +✓ Created fork yourGithubUser/Hello-World +... +$ git remote set-url origin http://localhost:8000/yourGithubUser/Hello-World.git +$ git push +Enumerating objects: 4, done. +Counting objects: 100% (4/4), done. +Delta compression using up to 8 threads +Compressing objects: 100% (2/2), done. +Writing objects: 100% (3/3), 946 bytes | 946.00 KiB/s, done. +Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 +remote: ERR Rejecting repo coopernetes/Hello-World.git not in the authorisedList +fatal: the remote end hung up unexpectedly +error: failed to push some refs to 'http://localhost:8000/coopernetes/Hello-World.git' ``` -## Run Git Proxy ⚡ +Git Proxy intercepts the push and _blocks_ it, as the default configuration only permits pushes +to this repository (`github.com/finos/git-proxy`). To allow pushes to your fork, you must configure Git Proxy. -Once you have followed the [installation](#installation) steps, run Git Proxy with: +## Documentation +For detailed step-by-step instructions for how to install, deploy & configure Git Proxy and +customize for your environment, see the [project's documentation](https://git-proxy.finos.org/docs/): -```bash -git-proxy -``` - -Alternatively, if you prefer the magic of [npx over npm](https://www.freecodecamp.org/news/npm-vs-npx-whats-the-difference/), you can run Git Proxy with: - -```bash -npx --package=@finos/git-proxy@1.1.0 -- git-proxy # No installation required... -``` - -## Quickstart 🚀 - -#### 1. Run Git Proxy with simple config - -Create a `proxy.config.json` in a workspace with the following: - -```json -{ - "authorisedList": [ - { - "project": "", - "name": "git-proxy", - "url": "https://github.com//git-proxy.git" - } - ], -} -``` - -Then run Git Proxy and load your `proxy.config.json` configuration file from your workspace: - -```bash -npx --package=@finos/git-proxy@1.1.0 -- git-proxy --config ./proxy.config.json -``` - -#### 2. Pick a repository - -Git Proxy sits between the local clone of your repository and its remote upstream. Essentially, instead of communicating directly with the **live** version of your repository, you configure your local clone to speak with Git Proxy first. - -For demonstration purposes, we recommend 👉 [forking Git Proxy](https://github.com/finos/git-proxy/fork) and cloning the repository to your PC: - -```bash -git clone https://github.com//git-proxy.git -``` - -Pretty meta, huh? Testing Git Proxy on Git Proxy... - -#### 3. Introduce Git Proxy to your clone - -Navigate into your test-bed repository on your PC: - -```bash -cd ./git-proxy -``` - -By default the clone of your repository will communicate with GitHub. To change this, so that your local copy of the repository speaks with Git Proxy, run: - -```bash -git remote set-url origin http://localhost:8000//git-proxy.git -``` - -#### 4. Make some changes to the codebase - -Open up the `README.md` and turn this frown upside-down: ☚ī¸ - -Once you've cheered up our friend above, run: - -```bash -git add README.md -git commit -m "fix: turn frown upside-down" -``` - -#### 5. Push your changes via Git Proxy - -```bash -git push -``` - -Git Proxy will prompt the entry of your git credentials. These credentials are your GitHub username and a [Personal Access Token](https://github.com/settings/tokens). For the ability to push and pull code through Git Proxy, you will only require the `public_repo` scope. - -Git Proxy will reprompt you for credentials each time you push. To automatically re-use your credentials, you can run: - -```bash -git config --global credential.helper osxkeychain # MacOS - -git config --global credential.helper manager # Windows - -git config --global credential.helper store # Linux -``` - -#### 6. Success - -Immediately after a push, you should receive the following message in your terminal: - -```bash -remote: -remote: Git Proxy has received your push: -remote: -remote: http://localhost:8080/requests/000000__b12557 -remote: -``` - -## Configuring Git Proxy ⚙ī¸ - -By default, Git Proxy ships with an out-of-the-box configuration. - -To customise your Git Proxy configuration, create a `proxy.config.json` in your directory. - -To specify a different file name for your Git Proxy configuration, use: - -```bash -git-proxy --config ./config.json -``` - -Or with npx: - -```bash -npx -- @finos/git-proxy --config ./config.json -``` - -## Know Your Configuration (KYC) ✅ - -To check that your Git Proxy configuration is valid, run: - -```bash -git-proxy --validate -``` - -To validate your configuration at a custom file location, run: - -```bash -git-proxy --validate --config ./config.json -``` +- [Quickstart](https://git-proxy.finos.org/docs/category/quickstart/) +- [Installation](https://git-proxy.finos.org/docs/installation) +- [Configuration](https://git-proxy.finos.org/docs/configuration) ## Contributing -Your contributions are at the core of making this a true open source project. Any contributions you make are **greatly appreciated**. - -
- - -fork this repository - - -#### Fork the repository - -Click on the **fork** button at the top of the page. This will create a copy of this repository under your GitHub account. - -
-
- -#### Clone the repository - -copy URL to clipboard - -**Clone** the repository to your machine. Go to the repository via your GitHub account and click on the **Code** button. - -Run the following command in your CLI/Terminal: - -```bash -git clone https://github.com/YOUR_GITHUB_USRERNAME/git-proxy.git -``` - -
-
- -#### Branch, code, commit and push - -
- -##### Branch - -You can start coding on the default branch on your fork of the project, commonly `master` or `main`. If you want to create a branch to clearly identify your work, run: - -```bash -git checkout -b feature/name-of-the-feature-you-are-creating -``` - -
- -##### Code - -This part is up to you. Be creative and write some magical code! 🧙đŸĒ„ - -
- -##### Commit - -Once you have finished making all of your improvements and changes, run the following: - -```bash -git commit -m "YOUR COMMIT MESSAGE" -``` - -
- -##### Push - -Now that you've created a commit with your changes, it's time to push to GitHub: - -```bash -git push -``` - -
- -##### Open a pull request - -With your changes applied to your fork of the project, it's time to [open a pull request from your repository](https://github.com/finos/git-proxy/compare)... - -
+Your contributions are at the core of making this a true open source project. Any contributions you make are **greatly appreciated**. See [`CONTRIBUTING.md`](CONTRIBUTING.md) for more information. ## Security @@ -290,4 +115,3 @@ This project is distributed under the Apache-2.0 license. See + 1. [Optional] Property Git Proxy configuration file > authorisedList + + +
+ +| | | +| ------------ | ------- | +| **Type** | `array` | +| **Required** | No | + +**Description:** List of repositories that are authorised to be pushed to through the proxy. + +| Each item of this array must be | Description | +| --------------------------------------- | ----------- | +| [authorisedRepo](#authorisedList_items) | - | + +### 1.1. Git Proxy configuration file > authorisedList > authorisedRepo + +| | | +| ------------------------- | ------------------------------------------------------------------------- | +| **Type** | `object` | +| **Required** | No | +| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") | +| **Defined in** | #/definitions/authorisedRepo | + +
+ 1.1.1. [Required] Property Git Proxy configuration file > authorisedList > authorisedList items > project + + +
+ +| | | +| ------------ | -------- | +| **Type** | `string` | +| **Required** | Yes | + +
+
+ +
+ 1.1.2. [Required] Property Git Proxy configuration file > authorisedList > authorisedList items > name + + +
+ +| | | +| ------------ | -------- | +| **Type** | `string` | +| **Required** | Yes | + +
+
+ +
+ 1.1.3. [Required] Property Git Proxy configuration file > authorisedList > authorisedList items > url + + +
+ +| | | +| ------------ | -------- | +| **Type** | `string` | +| **Required** | Yes | + +
+
+ +
+ + +
+ 2. [Optional] Property Git Proxy configuration file > sink + + +
+ +| | | +| ------------ | ------- | +| **Type** | `array` | +| **Required** | No | + +**Description:** List of database sources. The first source in the configuration with enabled=true will be used. + +| Each item of this array must be | Description | +| ------------------------------- | ----------- | +| [database](#sink_items) | - | + +### 2.1. Git Proxy configuration file > sink > database + +| | | +| ------------------------- | ------------------------------------------------------------------------- | +| **Type** | `object` | +| **Required** | No | +| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") | +| **Defined in** | #/definitions/database | + +
+ 2.1.1. [Required] Property Git Proxy configuration file > sink > sink items > type + + +
+ +| | | +| ------------ | -------- | +| **Type** | `string` | +| **Required** | Yes | + +
+
+ +
+ 2.1.2. [Required] Property Git Proxy configuration file > sink > sink items > enabled + + +
+ +| | | +| ------------ | --------- | +| **Type** | `boolean` | +| **Required** | Yes | + +
+
+ +
+ 2.1.3. [Optional] Property Git Proxy configuration file > sink > sink items > connectionString + + +
+ +| | | +| ------------ | -------- | +| **Type** | `string` | +| **Required** | No | + +
+
+ +
+ 2.1.4. [Optional] Property Git Proxy configuration file > sink > sink items > options + + +
+ +| | | +| ------------------------- | ------------------------------------------------------------------------- | +| **Type** | `object` | +| **Required** | No | +| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") | + +
+
+ +
+ 2.1.5. [Optional] Property Git Proxy configuration file > sink > sink items > params + + +
+ +| | | +| ------------------------- | ------------------------------------------------------------------------- | +| **Type** | `object` | +| **Required** | No | +| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") | + +
+
+ +
+
+ +
+ 3. [Optional] Property Git Proxy configuration file > authentication + + +
+ +| | | +| ------------ | ------- | +| **Type** | `array` | +| **Required** | No | + +**Description:** List of authentication sources. The first source in the configuration with enabled=true will be used. + +| Each item of this array must be | Description | +| --------------------------------------- | ----------- | +| [authentication](#authentication_items) | - | + +### 3.1. Git Proxy configuration file > authentication > authentication + +| | | +| ------------------------- | ------------------------------------------------------------------------- | +| **Type** | `object` | +| **Required** | No | +| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") | +| **Defined in** | #/definitions/authentication | + +
+ 3.1.1. [Required] Property Git Proxy configuration file > authentication > authentication items > type + + +
+ +| | | +| ------------ | -------- | +| **Type** | `string` | +| **Required** | Yes | + +
+
+ +
+ 3.1.2. [Required] Property Git Proxy configuration file > authentication > authentication items > enabled + + +
+ +| | | +| ------------ | --------- | +| **Type** | `boolean` | +| **Required** | Yes | + +
+
+ +
+ 3.1.3. [Optional] Property Git Proxy configuration file > authentication > authentication items > options + + +
+ +| | | +| ------------------------- | ------------------------------------------------------------------------- | +| **Type** | `object` | +| **Required** | No | +| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") | + +
+
+ +
+
+ +
+ 4. [Optional] Property Git Proxy configuration file > tempPassword + + +
+ +| | | +| ------------------------- | ------------------------------------------------------------------------- | +| **Type** | `object` | +| **Required** | No | +| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") | + +**Description:** Toggle the generation of temporary password for git-proxy admin user + +
+ 4.1. [Optional] Property Git Proxy configuration file > tempPassword > sendEmail + + +
+ +| | | +| ------------ | --------- | +| **Type** | `boolean` | +| **Required** | No | + +
+
+ +
+ 4.2. [Optional] Property Git Proxy configuration file > tempPassword > emailConfig + + +
+ +| | | +| ------------------------- | ------------------------------------------------------------------------- | +| **Type** | `object` | +| **Required** | No | +| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") | + +**Description:** Generic object to configure nodemailer. For full type information, please see https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nodemailer + +
+
+ +
+
+ +---------------------------------------------------------------------------------------------------------------------------- +Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2023-10-26 at 23:14:44 -0400 diff --git a/website/sidebars.js b/website/sidebars.js index 5baee475..fb555b1d 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -17,6 +17,19 @@ module.exports = { }, 'installation', 'usage', - 'configuration', + { + type: 'category', + label: 'Configuration', + link: { + type: 'generated-index', + title: 'Configuration', + slug: '/category/configuration', + keywords: ['config', 'configuration'], + image: '/img/github-mark.png', + }, + collapsible: true, + collapsed: false, + items: ['configuration/overview', 'configuration/reference'], + }, ], }; From 2516d6a0494ea7617fc2200f778ba9614dfc9ec5 Mon Sep 17 00:00:00 2001 From: Jamie Slome Date: Tue, 31 Oct 2023 10:06:26 +0000 Subject: [PATCH 03/12] Update website/docs/usage.mdx --- website/docs/usage.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/usage.mdx b/website/docs/usage.mdx index ceddba74..281deeb6 100644 --- a/website/docs/usage.mdx +++ b/website/docs/usage.mdx @@ -12,7 +12,7 @@ git-proxy ### Using [npx instead of npm](https://www.freecodecamp.org/news/npm-vs-npx-whats-the-difference/) -You can install & run git-proxy in one step using npx: +You can also install & run `git-proxy` in one step: ```bash npx -- @finos/git-proxy From 80f4444952513ccf36bccf1199ea2fa6fa4ea426 Mon Sep 17 00:00:00 2001 From: Jamie Slome Date: Thu, 2 Nov 2023 15:49:07 +0000 Subject: [PATCH 04/12] Update website/docs/configuration/overview.mdx --- website/docs/configuration/overview.mdx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/website/docs/configuration/overview.mdx b/website/docs/configuration/overview.mdx index 045570bd..bf4987e4 100644 --- a/website/docs/configuration/overview.mdx +++ b/website/docs/configuration/overview.mdx @@ -5,11 +5,8 @@ description: How to customise push protections and policies ### Default configuration -On installation, Git Proxy ships with an out-of-the-box configuration. This is fine for +On installation, Git Proxy ships with an [out-of-the-box configuration](https://github.com/finos/git-proxy/blob/main/proxy.config.json). This is fine for demonstration purposes but is likely not what you want to deploy into your environment. - -The default configuration can be found here: [default proxy.config.json](https://github.com/finos/git-proxy/blob/main/proxy.config.json) - ### Customise configuration To customise your Git Proxy configuration, create a `proxy.config.json` in your current From 5e9ce0406037ce9d72028a1e9f6253f38f4350d2 Mon Sep 17 00:00:00 2001 From: Jamie Slome Date: Thu, 2 Nov 2023 15:49:20 +0000 Subject: [PATCH 05/12] Update website/docs/configuration/reference.mdx --- website/docs/configuration/reference.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/configuration/reference.mdx b/website/docs/configuration/reference.mdx index 67ff550a..38c5af65 100644 --- a/website/docs/configuration/reference.mdx +++ b/website/docs/configuration/reference.mdx @@ -3,7 +3,7 @@ title: Schema Reference description: JSON schema reference documentation for Git Proxy --- -# Git Proxy configuration file +# Schema Reference **Title:** Git Proxy configuration file From d7244429ffc57b9794ff2c12434b8d687fafd58f Mon Sep 17 00:00:00 2001 From: Thomas Cooper Date: Sun, 5 Nov 2023 12:48:30 -0500 Subject: [PATCH 06/12] docs: clarify use of github CLI in README * add rationale for forking and explaining the use of GitHub CLI in the introductory README --- README.md | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 1f0ffbcb..ed406502 100644 --- a/README.md +++ b/README.md @@ -52,41 +52,26 @@ Install & run git-proxy (requires [Nodejs](https://nodejs.org/en/download/)): ```bash $ npx -- @finos/git-proxy -Need to install the following packages: - @finos/git-proxy@1.1.0 -Ok to proceed? (y) -... -creating user - user=admin, - gitAccount=none - email=admin@place.com, - admin=true -Service Listening on 8080 -Listening on 8000 ``` Clone a repository, set the remote to the Git Proxy URL and push your changes: ```bash $ git clone https://github.com/octocat/Hello-World.git && cd Hello-World +# The below command is using the GitHub official CLI to fork the repo that is cloned. +# You can also fork on the GitHub UI. For usage details on the CLI, see https://github.com/cli/cli +# You must fork the repo into our own account to demonstrate pushing through Git Proxy since it +# is necessary to have write access on the repo for git-proxy to function. If you do not have push +# access, you will receive a 403 error. $ gh repo fork ✓ Created fork yourGithubUser/Hello-World ... -$ git remote set-url origin http://localhost:8000/yourGithubUser/Hello-World.git -$ git push -Enumerating objects: 4, done. -Counting objects: 100% (4/4), done. -Delta compression using up to 8 threads -Compressing objects: 100% (2/2), done. -Writing objects: 100% (3/3), 946 bytes | 946.00 KiB/s, done. -Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 -remote: ERR Rejecting repo yourGithubUser/Hello-World.git not in the authorisedList -fatal: the remote end hung up unexpectedly -error: failed to push some refs to 'http://localhost:8000/yourGithubUser/Hello-World.git' +$ git remote add proxy http://localhost:8000/yourGithubUser/Hello-World.git +$ git push proxy master ``` -Git Proxy intercepts the push and _blocks_ it, as the default configuration only permits pushes -to this repository (`github.com/finos/git-proxy`). To allow pushes to your fork, you must configure Git Proxy. +Using the default configuration, Git Proxy intercepts the push and _blocks_ it because the forked repository +is not listed in the authorisedList. To allow pushes to your fork, you must configure Git Proxy. ## Documentation For detailed step-by-step instructions for how to install, deploy & configure Git Proxy and From 6b4bf9f459a80d951597a0fceb90ae3f20de38b0 Mon Sep 17 00:00:00 2001 From: Thomas Cooper Date: Mon, 20 Nov 2023 10:00:13 -0500 Subject: [PATCH 07/12] docs: remove extra comment, cfg clarification * make the output smaller * mention that the authorisedList is a configured list of repos permitted through the proxy --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index ed406502..2cf9d9d4 100644 --- a/README.md +++ b/README.md @@ -60,9 +60,6 @@ Clone a repository, set the remote to the Git Proxy URL and push your changes: $ git clone https://github.com/octocat/Hello-World.git && cd Hello-World # The below command is using the GitHub official CLI to fork the repo that is cloned. # You can also fork on the GitHub UI. For usage details on the CLI, see https://github.com/cli/cli -# You must fork the repo into our own account to demonstrate pushing through Git Proxy since it -# is necessary to have write access on the repo for git-proxy to function. If you do not have push -# access, you will receive a 403 error. $ gh repo fork ✓ Created fork yourGithubUser/Hello-World ... @@ -71,7 +68,7 @@ $ git push proxy master ``` Using the default configuration, Git Proxy intercepts the push and _blocks_ it because the forked repository -is not listed in the authorisedList. To allow pushes to your fork, you must configure Git Proxy. +is not listed in the `authorisedList` of repos allowed through the proxy. To allow pushes to your fork, you must configure Git Proxy. ## Documentation For detailed step-by-step instructions for how to install, deploy & configure Git Proxy and From 0aaa400c85d3165becc0bf9d3e6d81dd5e8b966e Mon Sep 17 00:00:00 2001 From: Jamie Slome Date: Thu, 23 Nov 2023 15:54:42 +0000 Subject: [PATCH 08/12] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 2cf9d9d4..928463b1 100644 --- a/README.md +++ b/README.md @@ -67,8 +67,7 @@ $ git remote add proxy http://localhost:8000/yourGithubUser/Hello-World.git $ git push proxy master ``` -Using the default configuration, Git Proxy intercepts the push and _blocks_ it because the forked repository -is not listed in the `authorisedList` of repos allowed through the proxy. To allow pushes to your fork, you must configure Git Proxy. +Using the default configuration, Git Proxy intercepts the push and _blocks_ it. To enable code pushing to your fork via Git Proxy, add your repository URL into the Git Proxy config file (`proxy.config.json`). For more information, refer to [Documentation](#Documentation). ## Documentation For detailed step-by-step instructions for how to install, deploy & configure Git Proxy and From edccc6eed4519e1c6ca0747f105e9f99425e0905 Mon Sep 17 00:00:00 2001 From: Jamie Slome Date: Thu, 23 Nov 2023 15:55:17 +0000 Subject: [PATCH 09/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 928463b1..878a494c 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ $ git remote add proxy http://localhost:8000/yourGithubUser/Hello-World.git $ git push proxy master ``` -Using the default configuration, Git Proxy intercepts the push and _blocks_ it. To enable code pushing to your fork via Git Proxy, add your repository URL into the Git Proxy config file (`proxy.config.json`). For more information, refer to [Documentation](#Documentation). +Using the default configuration, Git Proxy intercepts the push and _blocks_ it. To enable code pushing to your fork via Git Proxy, add your repository URL into the Git Proxy config file (`proxy.config.json`). For more information, refer to [Documentation](##Documentation). ## Documentation For detailed step-by-step instructions for how to install, deploy & configure Git Proxy and From 083a7646c8c5202c6cace7f50f5df5daded46c9c Mon Sep 17 00:00:00 2001 From: Jamie Slome Date: Thu, 23 Nov 2023 15:56:49 +0000 Subject: [PATCH 10/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 878a494c..bab49ce9 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ $ git remote add proxy http://localhost:8000/yourGithubUser/Hello-World.git $ git push proxy master ``` -Using the default configuration, Git Proxy intercepts the push and _blocks_ it. To enable code pushing to your fork via Git Proxy, add your repository URL into the Git Proxy config file (`proxy.config.json`). For more information, refer to [Documentation](##Documentation). +Using the default configuration, Git Proxy intercepts the push and _blocks_ it. To enable code pushing to your fork via Git Proxy, add your repository URL into the Git Proxy config file (`proxy.config.json`). For more information, refer to [our documentation](https://git-proxy.finos.org). ## Documentation For detailed step-by-step instructions for how to install, deploy & configure Git Proxy and From 7750ca0901fdc42d0d879343d1e73ef027b2a2e8 Mon Sep 17 00:00:00 2001 From: Thomas Cooper Date: Sun, 10 Dec 2023 15:15:10 -0500 Subject: [PATCH 11/12] docs: resolve mdx build errors - generate doc now complies with MDX and compiles correctly with docusaurus - replace the title as per PR comments via script Signed-off-by: Thomas Cooper --- scripts/doc-schema.js | 13 ++--- website/docs/configuration/reference.mdx | 70 ++++++------------------ 2 files changed, 24 insertions(+), 59 deletions(-) diff --git a/scripts/doc-schema.js b/scripts/doc-schema.js index 0b183277..3da5d9ec 100644 --- a/scripts/doc-schema.js +++ b/scripts/doc-schema.js @@ -19,18 +19,17 @@ try { ]).toString('utf-8'); console.log(genDocOutput); - const schemaDoc = readFileSync(`${tempdir}${sep}schema.md`, 'utf-8'); - - writeFileSync( - OUTPUT_PATH, - `--- + const schemaDoc = readFileSync(`${tempdir}${sep}schema.md`, 'utf-8') + .replace(/\n\n<\/summary>/g, '') + .replace(/# Git Proxy configuration file/g, '# Schema Reference'); // https://github.com/finos/git-proxy/pull/327#discussion_r1377343213 + const docString = `--- title: Schema Reference description: JSON schema reference documentation for Git Proxy --- ${schemaDoc} -`, - ); +`; + writeFileSync(OUTPUT_PATH, docString); console.log(`Wrote schema reference to ${OUTPUT_PATH}`); } catch (err) { console.error(err); diff --git a/website/docs/configuration/reference.mdx b/website/docs/configuration/reference.mdx index 38c5af65..d922ad8f 100644 --- a/website/docs/configuration/reference.mdx +++ b/website/docs/configuration/reference.mdx @@ -16,9 +16,7 @@ description: JSON schema reference documentation for Git Proxy **Description:** Configuration for customizing git-proxy
- 1. [Optional] Property Git Proxy configuration file > authorisedList - - + 1. [Optional] Property Git Proxy configuration file > authorisedList
| | | @@ -42,9 +40,7 @@ description: JSON schema reference documentation for Git Proxy | **Defined in** | #/definitions/authorisedRepo |
- 1.1.1. [Required] Property Git Proxy configuration file > authorisedList > authorisedList items > project - - + 1.1.1. [Required] Property Git Proxy configuration file > authorisedList > authorisedList items > project
| | | @@ -56,9 +52,7 @@ description: JSON schema reference documentation for Git Proxy
- 1.1.2. [Required] Property Git Proxy configuration file > authorisedList > authorisedList items > name - - + 1.1.2. [Required] Property Git Proxy configuration file > authorisedList > authorisedList items > name
| | | @@ -70,9 +64,7 @@ description: JSON schema reference documentation for Git Proxy
- 1.1.3. [Required] Property Git Proxy configuration file > authorisedList > authorisedList items > url - - + 1.1.3. [Required] Property Git Proxy configuration file > authorisedList > authorisedList items > url
| | | @@ -87,9 +79,7 @@ description: JSON schema reference documentation for Git Proxy
- 2. [Optional] Property Git Proxy configuration file > sink - - + 2. [Optional] Property Git Proxy configuration file > sink
| | | @@ -113,9 +103,7 @@ description: JSON schema reference documentation for Git Proxy | **Defined in** | #/definitions/database |
- 2.1.1. [Required] Property Git Proxy configuration file > sink > sink items > type - - + 2.1.1. [Required] Property Git Proxy configuration file > sink > sink items > type
| | | @@ -127,9 +115,7 @@ description: JSON schema reference documentation for Git Proxy
- 2.1.2. [Required] Property Git Proxy configuration file > sink > sink items > enabled - - + 2.1.2. [Required] Property Git Proxy configuration file > sink > sink items > enabled
| | | @@ -141,9 +127,7 @@ description: JSON schema reference documentation for Git Proxy
- 2.1.3. [Optional] Property Git Proxy configuration file > sink > sink items > connectionString - - + 2.1.3. [Optional] Property Git Proxy configuration file > sink > sink items > connectionString
| | | @@ -155,9 +139,7 @@ description: JSON schema reference documentation for Git Proxy
- 2.1.4. [Optional] Property Git Proxy configuration file > sink > sink items > options - - + 2.1.4. [Optional] Property Git Proxy configuration file > sink > sink items > options
| | | @@ -170,9 +152,7 @@ description: JSON schema reference documentation for Git Proxy
- 2.1.5. [Optional] Property Git Proxy configuration file > sink > sink items > params - - + 2.1.5. [Optional] Property Git Proxy configuration file > sink > sink items > params
| | | @@ -188,9 +168,7 @@ description: JSON schema reference documentation for Git Proxy
- 3. [Optional] Property Git Proxy configuration file > authentication - - + 3. [Optional] Property Git Proxy configuration file > authentication
| | | @@ -214,9 +192,7 @@ description: JSON schema reference documentation for Git Proxy | **Defined in** | #/definitions/authentication |
- 3.1.1. [Required] Property Git Proxy configuration file > authentication > authentication items > type - - + 3.1.1. [Required] Property Git Proxy configuration file > authentication > authentication items > type
| | | @@ -228,9 +204,7 @@ description: JSON schema reference documentation for Git Proxy
- 3.1.2. [Required] Property Git Proxy configuration file > authentication > authentication items > enabled - - + 3.1.2. [Required] Property Git Proxy configuration file > authentication > authentication items > enabled
| | | @@ -242,9 +216,7 @@ description: JSON schema reference documentation for Git Proxy
- 3.1.3. [Optional] Property Git Proxy configuration file > authentication > authentication items > options - - + 3.1.3. [Optional] Property Git Proxy configuration file > authentication > authentication items > options
| | | @@ -260,9 +232,7 @@ description: JSON schema reference documentation for Git Proxy
- 4. [Optional] Property Git Proxy configuration file > tempPassword - - + 4. [Optional] Property Git Proxy configuration file > tempPassword
| | | @@ -274,9 +244,7 @@ description: JSON schema reference documentation for Git Proxy **Description:** Toggle the generation of temporary password for git-proxy admin user
- 4.1. [Optional] Property Git Proxy configuration file > tempPassword > sendEmail - - + 4.1. [Optional] Property Git Proxy configuration file > tempPassword > sendEmail
| | | @@ -288,9 +256,7 @@ description: JSON schema reference documentation for Git Proxy
- 4.2. [Optional] Property Git Proxy configuration file > tempPassword > emailConfig - - + 4.2. [Optional] Property Git Proxy configuration file > tempPassword > emailConfig
| | | @@ -308,4 +274,4 @@ description: JSON schema reference documentation for Git Proxy
---------------------------------------------------------------------------------------------------------------------------- -Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2023-10-26 at 23:14:44 -0400 +Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2023-12-10 at 15:12:32 -0500 From f47d0cd693cc9d182de6c85368538b8ffb8d36f9 Mon Sep 17 00:00:00 2001 From: Thomas Cooper Date: Sun, 10 Dec 2023 15:43:08 -0500 Subject: [PATCH 12/12] re-gen doc to trigger deploy --- website/docs/configuration/reference.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/configuration/reference.mdx b/website/docs/configuration/reference.mdx index d922ad8f..495f872c 100644 --- a/website/docs/configuration/reference.mdx +++ b/website/docs/configuration/reference.mdx @@ -274,4 +274,4 @@ description: JSON schema reference documentation for Git Proxy
---------------------------------------------------------------------------------------------------------------------------- -Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2023-12-10 at 15:12:32 -0500 +Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2023-12-10 at 15:42:45 -0500