From bcb856d37ac54714d99371fa6714472feec3dfdd Mon Sep 17 00:00:00 2001 From: Maedah Batool Date: Wed, 25 Sep 2024 09:43:14 -0700 Subject: [PATCH 1/3] Docs working branch for the October 2024 release --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d3ae06bfb..f505ed9ef 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Sourcegraph Docs - + Welcome to the Sourcegraph documentation! We're excited to have you contribute to our docs. We've recently rearchitectured our docs tech stack — powered by Next.js, TailwindCSS and deployed on Vercel. This guide will walk you through the process of contributing to our documentation using the new tech stack. From 78045d4ab774ce8df43bc55521db5a1c80a2865e Mon Sep 17 00:00:00 2001 From: Michael Lin Date: Wed, 25 Sep 2024 10:36:06 -0700 Subject: [PATCH 2/3] Update ssh repo clone docs (#669) ## Pull Request approval Although pull request approval is not enforced for this repository in order to reduce friction, merging without a review will generate a ticket for the docs team to review your changes. So if possible, have your pull request approved before merging. --- docs/admin/code_hosts/aws_codecommit.mdx | 18 ++++++++++++ docs/admin/repo/auth.mdx | 37 ++++++++++++++++++++++-- 2 files changed, 52 insertions(+), 3 deletions(-) diff --git a/docs/admin/code_hosts/aws_codecommit.mdx b/docs/admin/code_hosts/aws_codecommit.mdx index cc1fff525..5875fb8b1 100644 --- a/docs/admin/code_hosts/aws_codecommit.mdx +++ b/docs/admin/code_hosts/aws_codecommit.mdx @@ -87,6 +87,24 @@ To add CodeCommit repositories in Docker Container: 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. 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) 1. Confirm you can clone the repository locally. + +### Configuring SSH credentials in the Web UI + +```json +{ + "gitURLType": "ssh", + "gitSSHKeyID": "", + "gitSSHCredential": { + // make sure the key is base64 encoded + // $ cat ~/.ssh/id_rsa | base64 + "privateKey": "", + "passphrase": "" + } +} +``` + +### Mounting SSH keys into the container + 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. 1. Read our [guide here](/admin/deploy/docker-compose/#git-ssh-configuration) for Docker Compose deployments 1. Read our [guide here](/admin/deploy/kubernetes/configure#ssh-for-cloning) for Kubernetes deployments diff --git a/docs/admin/repo/auth.mdx b/docs/admin/repo/auth.mdx index 1c0d77e9e..a3b293bc2 100644 --- a/docs/admin/repo/auth.mdx +++ b/docs/admin/repo/auth.mdx @@ -4,16 +4,47 @@ If authentication (HTTP(S) or SSH) is required to `git clone` a repository then 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. -Then, follow the directions below depending on your deployment type: +Then, you need to supply the SSH keys and passphrase to Sourcegraph if applicable. You have two options: + +- **Option 1**: Configure the SSH credentials in code host configuration in the Web UI. (Recommended) +- **Option 2**: Mount the SSH keys into the container. + +## Configuring SSH credentials in the Web UI (Recommended) + +In supported code hosts configuration, you can provide the credentials in the JSON configuration. For example: + +```json +{ + "url": "https://github.com", + "token": "", + "gitURLType": "ssh", + "gitSSHCredential": { + // make sure the key is base64 encoded + // $ cat ~/.ssh/id_rsa | base64 + "privateKey": "", + "passphrase": "" + } +} +``` + +Some providers may require additional configuration, consult the [code host specific documentation](/admin/code_hosts/) for more information. + +## Mounting SSH keys into the container - [Sourcegraph with Docker Compose](/admin/deploy/docker-compose/): See [the Docker Compose git configuration guide](/admin/deploy/docker-compose/#git-configuration). - [Sourcegraph with Kubernetes](/admin/deploy/kubernetes/): See [Configure repository cloning via SSH](/admin/deploy/kubernetes/configure#ssh-for-cloning). - [Single-container Sourcegraph](/admin/deploy/docker-single-container/): See [the single-container git configuration guide](/admin/deploy/docker-single-container/#git-configuration-and-authentication). ->NOTE: Repository access over SSH is not yet supported on [Sourcegraph Cloud](/cloud/). - ## Troubleshooting +### Error: `illegal base64 data at input byte 0` + +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. + +```bash +cat ~/.ssh/id_rsa | base64 +``` + ### What should be included in my config file? We recommend adding the `StrictHostKeyChecking no` and `AddKeysToAgent yes` flags to prevent the need to give permission interactively when cloning from a new host. From 7b754fa1ad1cf6b18180315d506f7747db344fa6 Mon Sep 17 00:00:00 2001 From: Maedah Batool Date: Fri, 4 Oct 2024 12:07:53 -0700 Subject: [PATCH 3/3] Revise docs to latest versions --- docs.config.js | 2 +- docs/legacy.mdx | 1 + src/data/versions.ts | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs.config.js b/docs.config.js index 4b6be7634..ec0b4301b 100644 --- a/docs.config.js +++ b/docs.config.js @@ -1,5 +1,5 @@ const config = { - DOCS_LATEST_VERSION: '5.7' + DOCS_LATEST_VERSION: '5.8' }; module.exports = config; diff --git a/docs/legacy.mdx b/docs/legacy.mdx index 44947fcff..6cb69756c 100644 --- a/docs/legacy.mdx +++ b/docs/legacy.mdx @@ -4,6 +4,7 @@ + - [5.7](https://5.7.sourcegraph.com/) - [5.6](https://5.6.sourcegraph.com/) - [5.5](https://5.5.sourcegraph.com/) - [5.4](https://5.4.sourcegraph.com/docs) diff --git a/src/data/versions.ts b/src/data/versions.ts index a2a94ff8b..8068294bd 100644 --- a/src/data/versions.ts +++ b/src/data/versions.ts @@ -15,8 +15,8 @@ export const versions: VersionI[] = [ url: '/', }, { - name: 'v5.6', - url: 'https://5.6.sourcegraph.com/' + name: 'v5.7', + url: 'https://5.7.sourcegraph.com/' }, ];