From f1ac4a4f3b3fb0db50abdd9096ec6e5ec6fab989 Mon Sep 17 00:00:00 2001 From: Dan Barr Date: Fri, 31 Jan 2025 22:43:48 -0500 Subject: [PATCH 1/2] Update cert instructions for Linux --- docs/integrations/copilot.mdx | 38 +++++++++++++++-------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/docs/integrations/copilot.mdx b/docs/integrations/copilot.mdx index d4dc294..fe7feb1 100644 --- a/docs/integrations/copilot.mdx +++ b/docs/integrations/copilot.mdx @@ -132,15 +132,14 @@ and prevent resource exhaustion. -### Install certificate from the UI +### Install certificate from the dashboard -The easiest way to retrieve and install the CodeGate certificate is from the -CodeGate web dashboard. Open the CodeGate dashboard in your browser: -http://localhost:9090 +You can download the CodeGate CA certificate file from the CodeGate dashboard. +Open the dashboard in your browser: http://localhost:9090 -From the **Certificates** menu choose **Download**, then click the **Download -Certificate** button. Follow the OS-specific instructions on the page to import -the certificate to your trust store. +From the **Certificates** menu choose **Download certificates**, then click the +**Download certificate** button. Follow the OS-specific instructions on the page +to import the certificate to your trust store. ### Install certificate from the CLI @@ -157,9 +156,11 @@ logs for errors. +Run the following from a terminal: + ```bash docker cp codegate:/app/codegate_volume/certs/ca.crt ./codegate.crt -security add-trusted-cert -r trustRoot -k ~/Library/Keychains/login.keychain ./codegate.crt +security add-trusted-cert -r trustRoot -p ssl -p basic -k ~/Library/Keychains/login.keychain ./codegate.crt ``` Enter your password when prompted. @@ -175,30 +176,23 @@ Import-Certificate -FilePath ".\codegate.crt" -CertStoreLocation Cert:\CurrentUs -Run the following commands from a terminal, depending on your distribution. - -Ubuntu/Debian based distributions: - -```bash -docker cp codegate:/app/codegate_volume/certs/ca.crt ./codegate.crt -sudo cp ./codegate.crt /usr/local/share/ca-certificates/codegate.crt -sudo update-ca-certificates -``` +Prerequisite: the `certutil` tool must be available on your system. +- Ubuntu/Debian: `sudo apt install libnss3-tools` +- RHEL/Fedora: `sudo dnf install nss-tools` -RHEL/Fedora and other Enterprise Linux distributions: +Run the following from a terminal: ```bash docker cp codegate:/app/codegate_volume/certs/ca.crt ./codegate.crt -sudo cp ./codegate.crt /etc/pki/ca-trust/source/anchors/codegate.pem -sudo update-ca-trust +certutil -d sql:$HOME/.pki/nssdb -A -t "C,," -n CodeGate-CA -i ./codegate.crt ``` -## Configure your IDE to proxy traffic through CodeGate +## Configure VS Code -Finally, configure your IDE to use CodeGate as an HTTP proxy. +Finally, configure VS Code to use CodeGate as an HTTP proxy. From da27f1d60565474f62e0a6fc1df9147407652a1b Mon Sep 17 00:00:00 2001 From: Dan Barr Date: Fri, 31 Jan 2025 22:44:30 -0500 Subject: [PATCH 2/2] Clarify state of JetBrains support for Copilot --- docs/index.md | 1 - docs/integrations/copilot.mdx | 21 +++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/index.md b/docs/index.md index f570db5..1ca1bc8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -38,7 +38,6 @@ CodeGate supports several development environments and AI providers. AI coding assistants / IDEs: - **[GitHub Copilot](./integrations/copilot.mdx)** with Visual Studio Code - (JetBrains coming soon!) - **[Continue](./integrations/continue.mdx)** with Visual Studio Code and JetBrains IDEs diff --git a/docs/integrations/copilot.mdx b/docs/integrations/copilot.mdx index fe7feb1..240073a 100644 --- a/docs/integrations/copilot.mdx +++ b/docs/integrations/copilot.mdx @@ -12,11 +12,20 @@ import ThemedImage from '@theme/ThemedImage'; [GitHub Copilot](https://github.com/features/copilot) is an AI coding assistant developed by GitHub and OpenAI. The Copilot plugin works with Visual Studio Code -(VS Code). Support for JetBrains is -[coming soon](https://github.com/stacklok/codegate/issues/383). +(VS Code) and JetBrains IDEs. :::note +Currently, CodeGate only works with Copilot in VS Code. JetBrains IDEs do not +support HTTPS proxy configurations. If you would like to use CodeGate with +Copilot in JetBrains IDEs, please add a :+1: to +[this issue](https://github.com/stacklok/codegate/issues/383) or let us know on +[Discord](https://discord.gg/stacklok). + +::: + +:::info + This guide assumes you have an active subscription to GitHub Copilot and have installed the IDE extension. @@ -194,8 +203,6 @@ certutil -d sql:$HOME/.pki/nssdb -A -t "C,," -n CodeGate-CA -i ./codegate.crt Finally, configure VS Code to use CodeGate as an HTTP proxy. - - In VS Code, open the Command Palette (+Shift+P on macOS or Ctrl+Shift+P on Windows/Linux) and search for the **Preferences: Open User Settings (JSON)** command. @@ -221,12 +228,6 @@ Append the following settings to your configuration: } ``` - - -Support for JetBrains is [coming soon](https://github.com/stacklok/codegate/issues/383). - - - ## Verify configuration To verify that you've successfully connected Copilot to CodeGate, open the