You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update Gerrit docs to remove admin requirement and SSH limitation (#961)
Gerrit does not require admin credentials, only credentials of a user
that can access the required repositories.
Gerrit connections also support cloning via SSH using `gitSSHCredential`
like other code hosts.
Copy file name to clipboardExpand all lines: docs/admin/code_hosts/gerrit.mdx
+23-4Lines changed: 23 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,8 +21,8 @@ A Gerrit instance can be connected to Sourcegraph as follows:
21
21
```json
22
22
{
23
23
"url": "https://gerrit.example.com/", // Be sure to add a trailing slash
24
-
"username": "<admin username>",
25
-
"password": "<admin password>",
24
+
"username": "<username>",
25
+
"password": "<password>",
26
26
"projects": [ // If not set, all projects on the Gerrit instance will be mirrored
27
27
"docs",
28
28
"kubernetes/kubernetes"
@@ -33,15 +33,34 @@ A Gerrit instance can be connected to Sourcegraph as follows:
33
33
"authorization": {} // Marks all repositories as private. Users will be required to present valid Gerrit HTTP credentials in order to view repositories
34
34
}
35
35
```
36
-
4. The provided `username` and `password` must be the HTTP credentials of an admin account on Gerrit. See [the Gerrit HTTP documentation](https://gerrit-documentation.storage.googleapis.com/Documentation/2.14.2/user-upload.html#http) for details on how to generate HTTP credentials.
37
-
<Callouttype="note">The Gerrit instance has to have HTTPS clones enabled (the default). [`download.scheme=http`](https://gerrit-review.googlesource.com/Documentation/config-gerrit.html#download). Sourcegraph cannot clone Gerrit repos via SSH.</Callout>
36
+
4. The provided `username` and `password` must be the HTTP credentials of an account on Gerrit that has access to all the repositories that need to be cloned. See [the Gerrit HTTP documentation](https://gerrit-documentation.storage.googleapis.com/Documentation/2.14.2/user-upload.html#http) for details on how to generate HTTP credentials.
38
37
5. Select **Add Repositories** to create the connection. Sourcegraph will start mirroring the specified projects.
39
38
40
39
If you added the `"authorization": {}` option to the configuration, and this is the first Gerrit code host connection you have created for this Gerrit instance, you might see a warning like this:
41
40

42
41
43
42
Simply follow the steps in the next section to configure a Gerrit authentication provider.
44
43
44
+
### Clone using SSH
45
+
46
+
To clone using SSH, provide `"gitSSHCredential"` in the configuration:
47
+
48
+
```json
49
+
{
50
+
"url": "https://gerrit.example.com/",
51
+
"username": "<username>",
52
+
"password": "<password>",
53
+
"projects": [
54
+
"docs",
55
+
"kubernetes/kubernetes"
56
+
],
57
+
"gitSSHCredential": {
58
+
"privateKey": "..."// base64 encoded private key that will be used for cloning
59
+
},
60
+
"authorization": {}
61
+
}
62
+
```
63
+
45
64
## Add Gerrit as an authentication provider
46
65
47
66
If the `"authorization": {}` option has been set on a Gerrit code host connection, a Gerrit authentication provider will be required so that authroized users are able to search for and browse the code mirrored by that code host connection.
0 commit comments