Skip to content

Commit f8ba062

Browse files
committed
feat: updated documentation to include remote config
1 parent 832992d commit f8ba062

File tree

2 files changed

+203
-40
lines changed

2 files changed

+203
-40
lines changed

website/docs/configuration/overview.mdx

Lines changed: 69 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,71 @@ description: How to customise push protections and policies
77

88
On installation, GitProxy ships with an [out-of-the-box configuration](https://github.com/finos/git-proxy/blob/main/proxy.config.json). This is fine for
99
demonstration purposes but is likely not what you want to deploy into your environment.
10+
11+
### Configuration Sources
12+
13+
GitProxy supports dynamic configuration loading from multiple sources. This feature allows you to manage your configuration from external sources and update it without restarting the service. Configuration sources can be files, HTTP endpoints, or Git repositories.
14+
15+
To enable configuration sources, add the `configurationSources` section to your configuration:
16+
17+
```json
18+
{
19+
"configurationSources": {
20+
"enabled": true,
21+
"reloadIntervalSeconds": 60,
22+
"merge": false,
23+
"sources": [
24+
{
25+
"type": "file",
26+
"enabled": true,
27+
"path": "./external-config.json"
28+
},
29+
{
30+
"type": "http",
31+
"enabled": true,
32+
"url": "http://config-service/git-proxy-config",
33+
"headers": {},
34+
"auth": {
35+
"type": "bearer",
36+
"token": "your-token"
37+
}
38+
},
39+
{
40+
"type": "git",
41+
"enabled": true,
42+
"repository": "https://git-server.com/project/git-proxy-config",
43+
"branch": "main",
44+
"path": "git-proxy/config.json",
45+
"auth": {
46+
"type": "ssh",
47+
"privateKeyPath": "/path/to/.ssh/id_rsa"
48+
}
49+
}
50+
]
51+
}
52+
}
53+
```
54+
55+
The configuration options for `configurationSources` are:
56+
57+
- `enabled`: Enable/disable dynamic configuration loading
58+
- `reloadIntervalSeconds`: How often to check for configuration updates (in seconds)
59+
- `merge`: When true, merges configurations from all enabled sources. When false, uses the last successful configuration load. This can be used to upload only partial configuration to external source
60+
- `sources`: Array of configuration sources to load from
61+
62+
Each source can be one of three types:
63+
64+
1. `file`: Load from a local JSON file
65+
2. `http`: Load from an HTTP endpoint
66+
3. `git`: Load from a Git repository
67+
68+
When configuration changes are detected, GitProxy will:
69+
70+
1. Validate the new configuration
71+
2. Stop existing services
72+
3. Apply the new configuration
73+
4. Restart services with the updated configuration
74+
1075
### Customise configuration
1176

1277
To customise your GitProxy configuration, create a `proxy.config.json` in your current
@@ -44,8 +109,9 @@ npx -- @finos/git-proxy --config ./config.json
44109
```
45110

46111
### Set ports with ENV variables
112+
47113
By default, GitProxy uses port 8000 to expose the Git Server and 8080 for the frontend application.
48-
The ports can be changed by setting the `GIT_PROXY_SERVER_PORT`, `GIT_PROXY_HTTPS_SERVER_PORT` (optional) and `GIT_PROXY_UI_PORT`
114+
The ports can be changed by setting the `GIT_PROXY_SERVER_PORT`, `GIT_PROXY_HTTPS_SERVER_PORT` (optional) and `GIT_PROXY_UI_PORT`
49115
environment variables:
50116

51117
```
@@ -54,10 +120,10 @@ export GIT_PROXY_SERVER_PORT="9090"
54120
export GIT_PROXY_HTTPS_SERVER_PORT="9443"
55121
```
56122

57-
Note that `GIT_PROXY_UI_PORT` is needed for both server and UI Node processes,
123+
Note that `GIT_PROXY_UI_PORT` is needed for both server and UI Node processes,
58124
whereas `GIT_PROXY_SERVER_PORT` (and `GIT_PROXY_HTTPS_SERVER_PORT`) is only needed by the server process.
59125

60-
By default, GitProxy CLI connects to GitProxy running on localhost and default port. This can be
126+
By default, GitProxy CLI connects to GitProxy running on localhost and default port. This can be
61127
changed by setting the `GIT_PROXY_UI_HOST` and `GIT_PROXY_UI_PORT` environment variables:
62128

63129
```
@@ -78,6 +144,3 @@ To validate your configuration at a custom file location, run:
78144
```bash
79145
git-proxy --validate --config ./config.json
80146
```
81-
82-
83-

0 commit comments

Comments
 (0)