diff --git a/docs/features/workspaces.mdx b/docs/features/workspaces.mdx index 7e256b7..a70e94e 100644 --- a/docs/features/workspaces.mdx +++ b/docs/features/workspaces.mdx @@ -95,7 +95,7 @@ by name to quickly find the desired workspace. alt='The workspace drop-down menu in the CodeGate dashboard' sources={{ light: useBaseUrl('/img/features/workspace-menu-light.webp'), - dark: useBaseUrl('/img/quickstart/workspace-menu-dark.webp'), + dark: useBaseUrl('/img/features/workspace-menu-dark.webp'), }} title='Workspace menu' width={'800px'} diff --git a/docs/how-to/configure.md b/docs/how-to/configure.md index 296b6eb..1b708b7 100644 --- a/docs/how-to/configure.md +++ b/docs/how-to/configure.md @@ -33,7 +33,7 @@ CodeGate supports the following parameters: | `CODEGATE_VLLM_URL` | `http://localhost:8000` | Specifies the URL of the vLLM server to use. | | `DASHBOARD_BASE_API_URL` | `http://localhost:8989` | Overrides the base URL of the CodeGate API referenced by the dashboard UI (see [run CodeGate on a remote host](#run-on-remote-host)). | -## Example: Use CodeGate with a remote Ollama server +### Example: Use CodeGate with a remote Ollama server Set the Ollama server's URL when you launch CodeGate: @@ -44,7 +44,7 @@ docker run --name codegate -d -p 8989:8989 -p 9090:9090 \ --restart unless-stopped ghcr.io/stacklok/codegate ``` -## Example: run CodeGate on a remote host {#run-on-remote-host} +### Example: run CodeGate on a remote host {#run-on-remote-host} :::warning @@ -69,3 +69,51 @@ docker run --name codegate -d -p 8989:8989 -p 9090:9090 \ Replace `` with the IP or DNS name of your remote CodeGate host as reachable from your client / web browser. + +## Back up and restore the database + +CodeGate stores workspace configurations and event data in a SQLite database +file located in the `/app/codegate_volume/db` directory inside the container. +This database file is mounted to the persistent Docker volume on your host +system. This means that the database file is not lost when you stop or remove +the container, but it is still a good idea to back up the database file +regularly. You might also want to copy or move your configuration to a different +system. + +:::note + +The CodeGate container must be running to use these commands. + +::: + +### Back up + +To back up the database, you can use the `docker cp` command to copy the +database file from the container to your host system. For example, if you want +to back up the database to your current working directory, you can run the +following command: + +```bash +# Copy the database file from the container to your host system +docker cp codegate:/app/codegate_volume/db/codegate.db ./codegate.db +``` + +This copies the database file from the container to your current working +directory. You can then copy it to a safe location. + +### Restore + +You can also use this command to restore the database from a backup. For +example, if you have a backup of the database file in your current working +directory, you can restore it to the container by running: + +```bash +# Copy the backup file to the container +docker cp ./codegate.db codegate:/app/codegate_volume/db/codegate.db + +# Reset file ownership +docker exec -u root codegate sh -c "chown codegate:codegate /app/codegate_volume/db/codegate.db" + +# Restart CodeGate +docker restart codegate +``` diff --git a/docs/how-to/install.mdx b/docs/how-to/install.mdx index 96df2cc..bef40bc 100644 --- a/docs/how-to/install.mdx +++ b/docs/how-to/install.mdx @@ -96,7 +96,12 @@ need to [modify your configuration](./configure.md). ::: -### Networking +### Next steps + +Now that CodeGate is running, proceed to +[configure your AI assistant/agent](../integrations/index.mdx). + +## Networking CodeGate listens on several network ports: @@ -179,11 +184,6 @@ originally. Use standard `docker`/`podman` commands to manage the CodeGate container and persistent volume. -## Next steps - -Now that CodeGate is running, proceed to -[configure your AI assistant/agent](../integrations/index.mdx). - ## Uninstall If you decide to stop using CodeGate, undo the configuration changes you made to diff --git a/package-lock.json b/package-lock.json index dfe8a23..83b8120 100644 --- a/package-lock.json +++ b/package-lock.json @@ -654,25 +654,25 @@ } }, "node_modules/@babel/helpers": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz", - "integrity": "sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==", + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.10.tgz", + "integrity": "sha512-UPYc3SauzZ3JGgj87GgZ89JVdC5dj0AoetR5Bw6wj4niittNyFh6+eOGonYvJ1ao6B8lEa3Q3klS7ADZ53bc5g==", "license": "MIT", "dependencies": { - "@babel/template": "^7.25.9", - "@babel/types": "^7.26.0" + "@babel/template": "^7.26.9", + "@babel/types": "^7.26.10" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz", - "integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==", + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.10.tgz", + "integrity": "sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==", "license": "MIT", "dependencies": { - "@babel/types": "^7.26.0" + "@babel/types": "^7.26.10" }, "bin": { "parser": "bin/babel-parser.js" @@ -1928,9 +1928,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz", - "integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==", + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.10.tgz", + "integrity": "sha512-2WJMeRQPHKSPemqk/awGrAiuFfzBmOIPXKizAsVhWH9YJqLZ0H+HS4c8loHGgW6utJ3E/ejXQUsiGaQy2NZ9Fw==", "license": "MIT", "dependencies": { "regenerator-runtime": "^0.14.0" @@ -1940,9 +1940,10 @@ } }, "node_modules/@babel/runtime-corejs3": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.26.0.tgz", - "integrity": "sha512-YXHu5lN8kJCb1LOb9PgV6pvak43X2h4HvRApcN5SdWeaItQOzfn1hgP6jasD6KWQyJDBxrVmA9o9OivlnNJK/w==", + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.26.10.tgz", + "integrity": "sha512-uITFQYO68pMEYR46AHgQoyBg7KPPJDAbGn4jUTIRgCFJIp88MIBUianVOplhZDEec07bp9zIyr4Kp0FCyQzmWg==", + "license": "MIT", "dependencies": { "core-js-pure": "^3.30.2", "regenerator-runtime": "^0.14.0" @@ -1952,14 +1953,14 @@ } }, "node_modules/@babel/template": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", - "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz", + "integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==", "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.9", - "@babel/parser": "^7.25.9", - "@babel/types": "^7.25.9" + "@babel/code-frame": "^7.26.2", + "@babel/parser": "^7.26.9", + "@babel/types": "^7.26.9" }, "engines": { "node": ">=6.9.0" @@ -1993,9 +1994,9 @@ } }, "node_modules/@babel/types": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", - "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.10.tgz", + "integrity": "sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==", "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.25.9",