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
Copy file name to clipboardExpand all lines: docs/admin/code_hosts/aws_codecommit.mdx
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,6 +87,24 @@ To add CodeCommit repositories in Docker Container:
87
87
1. Follow the rest of the steps detailed in the [AWS SSH setup guide](https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-ssh-unixes.html) to make sure you can connect to the code host locally.
88
88
1. Confirm you have the connection by running the following ssh command locally: `ssh git-codecommit.us-west-1.amazonaws.com` (Update link with your server region)
89
89
1. Confirm you can clone the repository locally.
90
+
91
+
### Configuring SSH credentials in the Web UI
92
+
93
+
```json
94
+
{
95
+
"gitURLType": "ssh",
96
+
"gitSSHKeyID": "<SSH key ID>",
97
+
"gitSSHCredential": {
98
+
// make sure the key is base64 encoded
99
+
// $ cat ~/.ssh/id_rsa | base64
100
+
"privateKey": "<base64 encoded of the SSH private key>",
101
+
"passphrase": "<passphrase if applicable, omit if none is needed>"
102
+
}
103
+
}
104
+
```
105
+
106
+
### Mounting SSH keys into the container
107
+
90
108
1. Copy all the files at your `$HOME/.ssh directory` to `$HOME/.sourcegraph/config/ssh` directory. See [docs](/admin/deploy/docker-single-container/#ssh-authentication-config-keys-knownhosts) for more information about our ssh file system.
91
109
1. Read our [guide here](/admin/deploy/docker-compose/#git-ssh-configuration) for Docker Compose deployments
92
110
1. Read our [guide here](/admin/deploy/kubernetes/configure#ssh-for-cloning) for Kubernetes deployments
Copy file name to clipboardExpand all lines: docs/admin/repo/auth.mdx
+34-3Lines changed: 34 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,16 +4,47 @@ If authentication (HTTP(S) or SSH) is required to `git clone` a repository then
4
4
5
5
First, ensure your **Site admin > Manage code hosts** code host configuration is configured to use SSH. For example, by setting the `gitURLType` field to "ssh". Alternatively, you may use the "Generic Git host" code host type, which allows you to directly specify Git repository URLs for cloning.
6
6
7
-
Then, follow the directions below depending on your deployment type:
7
+
Then, you need to supply the SSH keys and passphrase to Sourcegraph if applicable. You have two options:
8
+
9
+
-**Option 1**: Configure the SSH credentials in code host configuration in the Web UI. (Recommended)
10
+
-**Option 2**: Mount the SSH keys into the container.
11
+
12
+
## Configuring SSH credentials in the Web UI (Recommended)
13
+
14
+
In supported code hosts configuration, you can provide the credentials in the JSON configuration. For example:
15
+
16
+
```json
17
+
{
18
+
"url": "https://github.com",
19
+
"token": "<personal access token>",
20
+
"gitURLType": "ssh",
21
+
"gitSSHCredential": {
22
+
// make sure the key is base64 encoded
23
+
// $ cat ~/.ssh/id_rsa | base64
24
+
"privateKey": "<base64 encoded of the SSH private key>",
25
+
"passphrase": "<passphrase if applicable, omit if none is needed>"
26
+
}
27
+
}
28
+
```
29
+
30
+
Some providers may require additional configuration, consult the [code host specific documentation](../code_hosts/index.mdx) for more information.
31
+
32
+
## Mounting SSH keys into the container
8
33
9
34
-[Sourcegraph with Docker Compose](/admin/deploy/docker-compose/): See [the Docker Compose git configuration guide](/admin/deploy/docker-compose/#git-configuration).
10
35
-[Sourcegraph with Kubernetes](/admin/deploy/kubernetes/): See [Configure repository cloning via SSH](/admin/deploy/kubernetes/configure#ssh-for-cloning).
11
36
-[Single-container Sourcegraph](/admin/deploy/docker-single-container/): See [the single-container git configuration guide](/admin/deploy/docker-single-container/#git-configuration-and-authentication).
12
37
13
-
>NOTE: Repository access over SSH is not yet supported on [Sourcegraph Cloud](/cloud/).
14
-
15
38
## Troubleshooting
16
39
40
+
### Error: `illegal base64 data at input byte 0`
41
+
42
+
This error indicates that the provided private key is not base64-encoded. Ensure that the private key is base64-encoded before providing it to Sourcegraph.
43
+
44
+
```bash
45
+
cat ~/.ssh/id_rsa | base64
46
+
```
47
+
17
48
### What should be included in my config file?
18
49
19
50
We recommend adding the `StrictHostKeyChecking no` and `AddKeysToAgent yes` flags to prevent the need to give permission interactively when cloning from a new host.
0 commit comments