diff --git a/package-lock.json b/package-lock.json index 90f92288..62d6845c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,6 +38,7 @@ }, "devDependencies": { "@eslint/js": "^9.15.0", + "@tailwindcss/typography": "^0.5.15", "@types/node": "^22.10.1", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", @@ -1994,6 +1995,36 @@ "@swc/counter": "^0.1.3" } }, + "node_modules/@tailwindcss/typography": { + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.15.tgz", + "integrity": "sha512-AqhlCXl+8grUz8uqExv5OTtgpjuVIwFTSXTrh8y9/pw6q2ek7fJ+Y8ZEVw7EB2DCcuCOtEjf9w3+J3rzts01uA==", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash.castarray": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.merge": "^4.6.2", + "postcss-selector-parser": "6.0.10" + }, + "peerDependencies": { + "tailwindcss": ">=3.0.0 || insiders || >=4.0.0-alpha.20" + } + }, + "node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser": { + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz", + "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@types/cookie": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", @@ -4192,6 +4223,20 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "license": "MIT" }, + "node_modules/lodash.castarray": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz", + "integrity": "sha512-aVx8ztPv7/2ULbArGJ2Y42bG1mEQ5mGjpdvrbJcJFU3TbYybe+QlLS4pst9zV52ymy2in1KpFPiZnAOATxD4+Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "dev": true, + "license": "MIT" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", diff --git a/package.json b/package.json index 4818e0be..c88933af 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ }, "devDependencies": { "@eslint/js": "^9.15.0", + "@tailwindcss/typography": "^0.5.15", "@types/node": "^22.10.1", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", @@ -56,4 +57,4 @@ "typescript-eslint": "^8.15.0", "vite": "^6.0.1" } -} \ No newline at end of file +} diff --git a/public/help/continue-setup.md b/public/help/continue-setup.md index f3029ba5..6986242a 100644 --- a/public/help/continue-setup.md +++ b/public/help/continue-setup.md @@ -1,103 +1,132 @@ -# Continue Setup Guide +# Quick setup - Continue with VS Code -First off all, you will need to install the Continue Extension. +For complete documentation, see: -You can do this by running the following command: +- [Quickstart guide - Continue](https://docs.codegate.ai/quickstart-continue) +- [Use CodeGate with Continue](https://docs.codegate.ai/how-to/use-with-continue) -```bash -code --install-extension continue.continue -``` +## Prerequisites -Alternatively, you can install the extension from the [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=Continue.continue). +- Visual Studio Code +- Access to a supported AI model provider: + - Anthropic API + - OpenAI API + - A vLLM server in OpenAI-compatible mode + - Ollama running locally +## Install the Continue extension -Once you have installed the extension, you should be able to see the Continue icon in the Activity Bar. +The Continue extension is available in the +[Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=Continue.continue). - +Install the extension using the **Install** link on the Marketplace page or search +for "Continue" in the Extensions panel within VS Code. -## Steps to Complete Setup +You can also install from the CLI: -### 1. Configure Continue +```bash +code --install-extension Continue.continue +``` -Within VSCode open the command palette and run the `Continue: New Sesstion` +Once you have installed the extension, you should be able to see the Continue +icon in the Activity Bar. -This will bring up the Continue chat window. + -Select the cog icon in the top right corner to open the settings. +## Configure Continue to use CodeGate -Configure your LLM provider as per normal with Continue, but change the `apiBase` -value as follows: +To configure Continue to send requests through CodeGate: -```json -{ - "apiBase": "http://localhost:8989/openai", - } -} -``` +1. Configure the [chat](https://docs.continue.dev/chat/model-setup) and [autocomplete](https://docs.continue.dev/autocomplete/model-setup) settings in Continue for your desired AI model(s). -For example, to configure the Anthropic provider, you would use the following configuration: +2. Open the Continue [configuration file](https://docs.continue.dev/reference), "~/.continue/config.json". You can edit this file directly or access it from the gear icon ("Configure Continue") in the Continue chat interface.  -```json -{ - "title": "anthropic claude-3-5-sonnet", - "provider": "anthropic", - "model": "claude-3-5-sonnet-20241022", - "apiKey": "yourkey", - "apiBase": "http://localhost:8989/anthropic" -}, -``` +3. Add the "apiBase" property to the "models" entry (chat) and + "tabAutocompleteModel" (autocomplete) sections of the configuration file. + This tells Continue to use the CodeGate CodeGate container running locally on + your system as the base URL for your LLM API, instead of the default. + + ```json + "apiBase": "http://127.0.0.1:8989/PROVIDER" + ``` + + Replace /PROVIDER with one of: /anthropic, /ollama, /openai, or /vllm to + match your LLM provider. + +4. Save the configuration file. + +### Examples -The same follows for OpenAI, Ollama, vLLM and any other provider you wish to use. +Example Continue chat configurations for Anthropic, OpenAI, Ollama, and vLLM: ```json "models": [ { - "title": "vllm-qwen2.5-coder-14b-instruct", - "provider": "vllm", - "model": "Qwen/Qwen2.5-Coder-14B-Instruct", - "apiKey": "key", - "apiBase": "http://localhost:8989/vllm" - }, - { - "title": "openai", - "provider": "openrouter", - "model": "gpt-4o-2024-11-20", - "apiBase": "http://localhost:8989/openai", - "apiKey": "key" - }, - { - "title": "anthropic claude-3-5-sonnet", + "title": "CodeGate-Anthropic", "provider": "anthropic", - "model": "claude-3-5-sonnet-20241022", - "apiKey": "key", + "model": "claude-3-5-sonnet-latest", + "apiKey": "YOUR_API_KEY", "apiBase": "http://localhost:8989/anthropic" }, { - "title": "ollama qwen2.5-coder-7b-instruct", + "title": "CodeGate-OpenAI", + "provider": "openai", + "model": "gpt-4o", + "apiKey": "YOUR_API_KEY", + "apiBase": "http://localhost:8989/openai" + }, + { + "title": "CodeGate-Ollama", "provider": "ollama", - "model": "sammcj/qwen2.5-coder-7b-instruct:q8_0", + "model": "codellama:7b-instruct", "apiBase": "http://localhost:8989/ollama" + }, + { + "title": "CodeGate-vLLM", + "provider": "vllm", + "model": "Qwen/Qwen2.5-Coder-14B-Instruct", + "apiKey": "YOUR_API_KEY", + "apiBase": "http://localhost:8989/vllm" } ], ``` -For auto completion, you can add the following to your settings.json file: +For auto completion, add your model config to the tabAutoCompleteModel section +of the config.json file. Example for Anthropic: ```json "tabAutocompleteModel": { - "title": "ollama", - "provider": "ollama", - "model": "codellama:7b-code", - "apiBase": "http://127.0.0.1:8989/ollama" + "title": "CodeGate-Anthropic", + "provider": "anthropic", + "model": "claude-3-5-sonnet-latest", + "apiKey": "YOUR_API_KEY", + "apiBase": "http://localhost:8989/anthropic" }, ``` -You can now start using Continue as before, but with the added benefit -extra privacy and control over your data. +For more details, refer to the full +[CodeGate how-to guide for Continue](https://docs.codegate.ai/how-to/use-with-continue#configure-continue-to-use-codegate). - +## Verify configuration -## Support +To verify that you've successfully connected Continue to CodeGate, open the +Continue chat and type "codegate-version". You should receive a response like +"CodeGate version 0.1.0". + +You can now start using Continue as before, but with the added benefit extra +privacy and control over your data. -Any issuess , please ask for support on the Continue [CodeGate Discussions](https://github.com/stacklok/codegate/discussions/categories/continue) page. + + +## Next steps + +Explore the full [CodeGate docs](https://docs.codegate.ai), join the +[community Discord server](https://discord.gg/stacklok) to chat about the +project, and get involved on the +[GitHub repo](https://github.com/stacklok/codegate)! + +## Support +If you need help, please ask for support on the Continue section of +[CodeGate discussions](https://github.com/stacklok/codegate/discussions/categories/continue) +or in the #codegate channel on [Discord](https://discord.gg/stacklok). diff --git a/public/help/copilot-setup.md b/public/help/copilot-setup.md index e88e142e..ea073968 100644 --- a/public/help/copilot-setup.md +++ b/public/help/copilot-setup.md @@ -1,57 +1,101 @@ -# 🤖 CoPilot Setup Guide +# Quick setup - GitHub Copilot with VS Code -Welcome to the setup guide for configuring CoPilot integration with **CodeGate**. +For complete documentation, see: ---- +- [Quickstart guide - GitHub Copilot](https://docs.codegate.ai/quickstart) +- [Use CodeGate with GitHub Copilot](https://docs.codegate.ai/how-to/use-with-copilot) -## 📋 Prerequisites +## Prerequisites -Before you begin, make sure you have the following: -- ✅ An active GitHub account -- ✅ A GitHub CoPilot subscription -- ✅ A CodeGate account +- An active GitHub account with a Copilot subscription +- Visual Studio Code with the Copilot extension installed ---- +CodeGate works as an HTTP proxy to intercept and modify traffic between GitHub +Copilot and your IDE. You must run the CodeGate container with port 8990 mapped +and a persistent volume. If you did not launch it this way, stop and re-start +with the required settings: -## 🛠️ Setup Instructions +```bash +docker stop codegate && docker rm codegate -### Install the CodeGate CA +docker run --name codegate -d -p 8989:8989 -p 9090:80 -p 8990:8990 --mount type=volume,src=codegate_volume,dst=/app/codegate_volume ghcr.io/stacklok/codegate:latest +``` + +## Trust the CodeGate CA certificate + +To establish a secure end-to-end connection between your IDE and CodeGate, you +need to install CodeGate's generated CA certificate to your trust store. +Decrypted traffic stays on your local machine and never leaves the CodeGate +container unencrypted. + +See the [Certificates page](/certificates) for full details and installation +instructions. -To enable CodeGate, you’ll need to install its Certificate Authority (CA) into your operating system’s trust store. +### Configure VS Code to proxy traffic through CodeGate -See the [Certificates Page](/certificates) for a full details. +Update your VS Code configuration to use CodeGate as a proxy. -### Configure CoPilot Settings to Use CodeGate +In VS Code, open the Command Palette (Cmd+Shift+P on macOS or Ctrl+Shift+P on +Windows) and search for the **Preferences: Open User Settings (JSON)** command. -Update your CoPilot configuration to use CodeGate as a proxy. Add the following -settings (Ctrl+Shift+P) + "Preferences: Open User Settings (JSON)": +Append the following settings to your configuration file (settings.json): ```json { + // ... Existing settings ... // + + // Note: you may need to add a comma after the last line of your existing settings if not already present + "http.proxy": "https://localhost:8990", "http.proxyStrictSSL": true, "http.proxySupport": "on", + "http.systemCertificates": true, "github.copilot.advanced": { "debug.useNodeFetcher": true, "debug.useElectronFetcher": true, "debug.testOverrideProxyUrl": "https://localhost:8990", - "debug.overrideProxyUrl": "https://localhost:8990", + "debug.overrideProxyUrl": "https://localhost:8990" } } ``` -> **_NOTE:_** CoPilot may need a refresh after creating the proxy config. Restart VS-Code or open the command palate (Ctrl+Shift+P) and select "Developer: Reload Window". +> **Note:** Restart VS Code or open the Command Palette (Ctrl+Shift+P) and +> select **Developer: Reload Window**. + +## Verify configuration -### Verify it works +In the bottom right section of VS Code you will see a small Copilot avatar: -In the bottom right section of VScode you will see a small CoPilot avatar. It -should look like the following: + + +If there is an error, an exclamation icon appears over the avatar: + + + +If you encounter an error, click on the Copilot avatar and select "Show +Diagnostics". Post the text to the Copilot section of +[CodeGate discussions](https://github.com/stacklok/codegate/discussions/categories/copilot) + +To verify that CodeGate is receiving Copilot traffic as expected, open the +Copilot chat and type "What do you know about CodeGate?". You should receive a +response that starts like this: + +```plain title="Copilot chat" +CodeGate is a security-focused AI assistant designed to help with software +security, package analysis, and providing guidance on secure coding practices. + +... +``` - +## Next steps -If there is any sort of failure, you will see the following: +Explore the full [CodeGate docs](https://docs.codegate.ai), join the +[community Discord server](https://discord.gg/stacklok) to chat about the +project, and get involved on the +[GitHub repo](https://github.com/stacklok/codegate)! - +## Support -If you experience a failure, click on the CoPilot avatar and select "Show Diagnostics" -, copy the text and post it to the CoPilot [CodeGate Discussions](https://github.com/stacklok/codegate/discussions/categories/copilot) +If you need help, please ask for support on the Copilot section of +[CodeGate discussions](https://github.com/stacklok/codegate/discussions/categories/copilot) +or in the #codegate channel on [Discord](https://discord.gg/stacklok). diff --git a/public/help/images/continue-two.png b/public/help/images/continue-chat.png similarity index 100% rename from public/help/images/continue-two.png rename to public/help/images/continue-chat.png diff --git a/public/help/images/continue-config-light.webp b/public/help/images/continue-config-light.webp new file mode 100644 index 00000000..d8202048 Binary files /dev/null and b/public/help/images/continue-config-light.webp differ diff --git a/public/help/images/continue-extension-light.webp b/public/help/images/continue-extension-light.webp new file mode 100644 index 00000000..2084f64e Binary files /dev/null and b/public/help/images/continue-extension-light.webp differ diff --git a/public/help/images/continue.png b/public/help/images/continue.png deleted file mode 100644 index b2432721..00000000 Binary files a/public/help/images/continue.png and /dev/null differ diff --git a/src/components/CertificateSecurity.tsx b/src/components/CertificateSecurity.tsx index 0468a3c0..2f97ff03 100644 --- a/src/components/CertificateSecurity.tsx +++ b/src/components/CertificateSecurity.tsx @@ -71,13 +71,13 @@ export function CertificateSecurity() { Robust Certificate Security
- Security is a top priority for us. We have designed CodeGates local + Security is a top priority for us. We have designed CodeGate's local certificate management with security in mind, balanced against ease of use.
- We will always seek to improve and balance security, privacy and - usability as best as we can + We always seek to improve and balance security, privacy, and + usability.
@@ -85,15 +85,15 @@ export function CertificateSecurity() {- Instead of using wildcard certificates, CodeGate generates - unique certificates for each domain. This approach minimizes + Instead of using wildcard certificates, CodeGate generates a + unique certificate for each domain. This approach minimizes security risks by limiting the impact of any single certificate compromise.
@@ -101,38 +101,38 @@ export function CertificateSecurity() {- CodeGate utilizes 4096-bit RSA keys for Certificate Authority - operations, providing enhanced security compared to the standard + CodeGate utilizes 4096-bit RSA keys for certificate authority + operations, providing enhanced security compared to standard 2048-bit keys. The increased key length significantly reduces the risk of brute-force attacks, ensuring long-term protection - for your data. We use 2048 for the server certs to balance in - performance. + for your data. To balance performance, 2048-bit keys are used + for server certificates.
- Our SSL context is configured to enforce the latest security - standards, including strong cipher suites and disabling outdated - protocols. This ensures secure and efficient encrypted + CodeGate's SSL context is configured to enforce the latest + security standards, including strong cipher suites and disabling + outdated protocols. This ensures secure and efficient encrypted communications.
Certificates are cached efficiently to optimize performance without compromising security. Additionally, mechanisms are in - place to manage certificate lifecycles and prevent resource + place to manage certificate lifecycle and prevent resource exhaustion.
@@ -163,7 +163,7 @@ export function CertificateSecurity() { improvement, please reach out to us at{" "} security@stacklok.com @@ -176,12 +176,12 @@ export function CertificateSecurity() { href="https://github.com/stacklok/codegate" target="_blank" rel="noopener noreferrer" - className="text-blue-600 hover:text-blue-700 underline" + className="text-blue-600 hover:text-blue-800 underline" > GitHub {" "} - and join our community in making CodeGate secure and reliable for - everyone. + and join our community to help ensure CodeGate is secure and + reliable for everyone.
- This certificate allows CodeGate to act as a proxy for certain - software such as CoPilot. + This certificate allows CodeGate to act as a secure proxy for + integrations such as GitHub Copilot.
- Local Only: CodeGate runs entirely on your + Local-only: CodeGate runs entirely on your machine within an isolated container, ensuring all data processing stays local without any external transmissions.
@@ -186,8 +186,8 @@ export function Certificates() {- Secure Certificate Handling: This custom CA is - locally generated and managed, the developers of CodeGate have no + Secure certificate handling: this custom CA is + locally generated and managed. CodeGate developers have no access to it.
- No External Communications: CodeGate is designed + No external communications: CodeGate is designed with no capability to call home or communicate with external servers, outside of those requested by the IDE or Agent.
@@ -206,7 +206,7 @@ export function Certificates() { to="/certificates/security" className="inline-flex items-center px-4 py-2 bg-teal-50 text-teal-700 hover:bg-teal-100 rounded-md transition-colors border border-teal-200 shadow-sm" > - Learn More + Learn more@@ -139,14 +107,10 @@ export function Markdown({ children, fontSize, className = "" }: Props) {
); }, - ul({ children }) { - return ( -