Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 1 addition & 26 deletions docs/admin/audit_log.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,33 +98,8 @@ There are two easy approaches to filtering the audit logs:
- Message-based: we recommend going the JSON route, but if there's no easy way of parsing JSON using your SIEM or data processing stack, you can filter based on the following string: `auditId`.

### Cloud
[Cloud](/cloud/#audit-logs)


Audit Logs are a default feature for Cloud instances, with a standard retention policy of 30 days. Should you wish to
extend this period, please be aware that additional charges will apply. To request an extension, please contact
your assigned Customer Engineer (CE) or send an email to Sourcegraph Support at support@sourcegraph.com.

#### Access Cloud intance audit logs

##### Download audit logs ocassionally

For requesting audit logs, please contact your assigned Sourcegraph representative or our support team.

##### Instant audit logs access (experimental)

Sourcegraph LogPush service is streaming audit logs to customer provided destination.

Features:
- single tenant, dedicated per customer
- streaming only newly created logs
- streaming on schedule, every 1h

Supported destinations:
- Google Cloud Storage

If you are interested to use this feature or to stream to a different destination, please contact your assigned Sourcegraph representative or our support team.

For Sourcegraph Cloud customers, please refer to Cloud [documentations](/cloud/#audit-logs).

## Developing

Expand Down
84 changes: 0 additions & 84 deletions docs/admin/code_hosts/go.mdx

This file was deleted.

6 changes: 0 additions & 6 deletions docs/admin/code_hosts/rate_limits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,3 @@ Sourcegraph supports internal rate limit configuration for the following connect
- [Bitbucket Cloud](/admin/code_hosts/bitbucket_cloud#rateLimit)
- [Bitbucket Server](/admin/code_hosts/bitbucket_server#rateLimit)
- [Perforce](/admin/repo/perforce#rateLimit)
- [Go Modules](/admin/code_hosts/go#rateLimit)
- [JVM Packages](/admin/code_hosts/jvm#rateLimit)
- [NPM Packages](/admin/code_hosts/npm#rateLimit)
- [Python Packages](/admin/code_hosts/python#rateLimit)
- [Ruby Packages](/admin/code_hosts/ruby#rateLimit)
- [Rust Packages](/admin/code_hosts/rust#rateLimit)
55 changes: 45 additions & 10 deletions docs/admin/deploy/docker-single-container/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,34 @@ SELECT * FROM users;

## Upgrade

### Postgresql 16
> Warning: The 5.11 release updates the database container images from Postgres 12 to Postgres 16. Customers are advised to have a database backup before upgrading! See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice!

From sourcegraph version 5.11 onwards, the Sourcegraph single container Docker image uses Postgresql 16. Upgrading from Postgresql 12 to Postgresql 16 is a manual process, that is similar to the one outlined below for multi-version upgrades, but migrator has been merged into the container, allowing for a simpler upgrade.

> NOTE: It is highly recommended to **take an up-to-date snapshot of your databases** prior to starting a multi-version upgrade. The upgrade process aggressively mutates the shape and contents of your database, and undiscovered errors in the migration process or unexpected environmental differences may cause an unusable instance or data loss.
>
> Single-container *does not* support auto migration to postgres 16. If you are planning to upgrade to 5.11.0 and beyond on single-container, you will need to dump the postgres databases and restore them after the upgrade.
> In this event, we highly recommend you migrate to a production supported deployment method, or switch to our cloud offering.
> We recommend performing the entire upgrade procedure on an idle clone of the production instance and switch traffic over on success, if possible. This may be low-effort for installations with a canary environment or a blue/green deployment strategy.
>
> **If you do not feel confident running this process solo**, contact customer support team to help guide you thorough the process.

**Before performing a multi-version upgrade**:

- Read our [update policy](/admin/updates/#update-policy) to learn about Sourcegraph updates.
- Find the entries that apply to the version range you're passing through in the [update notes for Sourcegraph with Docker Single Container](/admin/updates/server#multi-version-upgrade-procedure).

0. You must first shutdown the container instance via `docker stop [CONTAINER]`.
1. Start a temporary Postgres container on top of the Postgres data directory used by the old `sourcegraph/server` image. You must use the *new* postgresql-16-codeinsights image, which is based on the new Postgresql 16 image, and provides an automatic upgrade script to move from Postgresql 12 to Postgresql 16.

`docker run --rm -it -v ~/.sourcegraph/data/postgresql:/data/pgdata-12 -e POSTGRES_USER=postgres -p 5432:5432 sourcegraph/postgresql-16-codeinsights:{CURRENT_VERSION_NO_V}`

2. Once that temporary container marks that Postgresql has started, the migration is complete and you can stop the temporary container.
3. Start the new `sourcegraph/server` container.

`docker run --publish 7080:7080 --publish 127.0.0.1:3370:3370 --rm --volume ~/.sourcegraph/config:/etc/sourcegraph --volume ~/.sourcegraph/data:/var/opt/sourcegraph sourcegraph/server:{CURRENT_VERSION_NO_V}`

You now have a single server Sourcegraph container image running on Postgresql 16.


### Standard upgrades

Expand All @@ -156,6 +180,16 @@ To update, just use the newer `sourcegraph/server:N.N.N` Docker image (where `N.

### Multi-version upgrades

> NOTE: It is no longer necessary to run Migrator outside of the single instance container. Migrator is now built into the container, and will be run via the `sourcegraph/server` image.
>
> We **still** recommend performing the entire upgrade procedure on an idle clone of the production instance and switch traffic over on success, if possible. This may be low-effort for installations with a canary environment or a blue/green deployment strategy.
>
> The below docs are kept for posterity for users on older versions of Sourcegraph that are looking to upgrade or run the migrator tool.

To update, just use the newer `sourcegraph/server:N.N.N` Docker image in place of the older one, using the same Docker volumes. Your server's data will be migrated automatically if needed. You can always find the version number details of the latest release via the [technical changelog](/technical-changelog).

### (Legacy) Multi-version upgrades

A [multi-version upgrade](/admin/updates/#multi-version-upgrades) is a downtime-incurring upgrade from version 3.20 or later to any future version. Multi-version upgrades will run both schema and data migrations to ensure the data available from the instance remains available post-upgrade.

> NOTE: It is highly recommended to **take an up-to-date snapshot of your databases** prior to starting a multi-version upgrade. The upgrade process aggressively mutates the shape and contents of your database, and undiscovered errors in the migration process or unexpected environmental differences may cause an unusable instance or data loss.
Expand Down Expand Up @@ -218,21 +252,22 @@ For example, `${PATH}` is `~/.sourcegraph/data` in `-v ~/.sourcegraph/data:/var/

```sh
$ docker run --rm -it \
-v ${PATH}/postgresql:/data/pgdata-${PG_VERSION} \
-v ${PATH}/postgresql:/data/pgdata-12 \
-u 70 \
-p 5432:5432 \
--entrypoint bash \
sourcegraph/postgres-${PG_VERSION_TAG}:${SG_VERSION} \
-c 'echo "host all all 0.0.0.0/0 trust" >> /data/pgdata-${PG_VERSION}/pg_hba.conf && postgres -c l listen_addresses="*" -D /data/pgdata-${PG_VERSION}'
sourcegraph/${PG_VERSION_TAG}:${SG_VERSION} \
-c 'echo "host all all 0.0.0.0/0 trust" >> /data/pgdata-12/pg_hba.conf && postgres -c l listen_addresses="*" -D /data/pgdata-12'
```

The version of this Postgres container is dependent on the version of the instance prior to upgrade.

| `${SG_VERSION}` | `${PG_VERSION}` | `${PG_VERSION_TAG}` |
| ------------------- | --------------- | ------------------- |
| `3.20.X` - `3.29.X` | `12` | `12.6` |
| `3.30.X` - `3.37.X` | `12` | `12.6-alpine` |
| `3.38.X` - | `12` | `12-alpine` |
| `${SG_VERSION}` | `${PG_VERSION_TAG}` |
| ------------------- | ------------------- |
| `3.20.X` - `3.29.X` | `postgres-12.6` |
| `3.30.X` - `3.37.X` | `postgres-12.6-alpine`|
| `3.38.X` - `5.9.X` | `postgres-12-alpine` |
| `5.10.X` - | `postgresql-16` |

## Troubleshooting

Expand Down
22 changes: 18 additions & 4 deletions docs/cloud/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,24 @@ To opt out of managed SMTP, please let your Sourcegraph Account team know when r

To learn more about how the Sourcegraph team operates managed SMTP internally, refer to [our handbook](https://handbook.sourcegraph.com/departments/cloud/technical-docs/managed-smtp/).

### Audit Logs

Our Cloud instances provide [audit logs](/admin/audit_log#cloud) to help you monitor and investigate actions taken by users and the system. These logs are available to download by request and are also sent to a [centralized logging service](https://about.sourcegraph.com/security#logging) for 30 day retention. Should you wish to
extend this period, please be aware that additional charges will apply.
To request an extension, please contact your assigned Customer Engineer (CE) or send an email to Sourcegraph Support at support@sourcegraph.com.

#### Download audit logs

For requesting audit logs, please contact your our support team.

#### Deliver audit logs to customer-managed destination (LogPush)

Sourcegraph LogPush is an optional add-on to deliver audit logs to a customer provided destination. To enable this feature, please contact your assigned Customer Engineer (CE) or support team.

Supported destinations:

- Google Cloud Storage (GCS)

## Requirements

### Business
Expand Down Expand Up @@ -190,10 +208,6 @@ Only essential Sourcegraph personnel will have access to the instance, server, c

All Sourcegraph Cloud instances have Sourcegraph management access enabled by default, and customers may request to disable by contacting your Sourcegraph contact.

### Audit Logs

Our Cloud instances provide [audit logs](/admin/audit_log#cloud) to help you monitor and investigate actions taken by users and the system. These logs are available to download by request and are also sent to a [centralized logging service](https://about.sourcegraph.com/security#logging) for 30 day retention (configurable for greater periods by request).

## Accommodating special requirements

We may be able to support special requests (network access policies, infrastructure requirements, custom version control systems, etc.) with additional time, support, and fees. [Contact us](https://about.sourcegraph.com/contact/sales) to discuss any special requirements you may have.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ The following repositories have precise code navigation enabled:
## More resources

<QuickLinks>
<QuickLink href="/code-search/code-navigation/writing_an_indexer" icon="installation" imgAlt="Code Navigation" title="Writing a SCIP indexer" description="Learn how you can write an indexer to emit SCIP with Sourcegraph." />
<QuickLink href="/code-search/code-navigation/writing_an_indexer" icon="installation" imgAlt="Code Navigation" title="Writing a SCIP indexer" description="Learn how you can write an indexer to emit SCIP for code navigation in Sourcegraph." />
<QuickLink href="/code-search/code-navigation/how-to/adding_lsif_to_workflows" icon="lightbulb" imgAlt="Code Navigation" title="Adding precise code navigation to CI/CD workflows" description="Learn how to add precise code navigation to CI/CD workflows to Sourcegraph." />
</QuickLinks>
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Click the **New prompt** button from the **Prompt Library** page.
- Select the **Owner** and **Prompt Name**
- Write a prompt description
- Next, fill out the **Prompt template** box with all your prompt instructions
- You can also add dynamic context that will allow your prompt to use content from different sources like current selection and current file
- You can also `@` mention [specific and dynamic context](#specific-and-dynamic-context) that will allow your prompt to use content from different sources like current selection and current file
- Select the visibility of the prompt, either **Public** or **Private**
- You can mark your prompt as **draft**. Draft prompts are not visible to other users until you publish it
- Choose the mode of the prompt, whether it will be **Chat only** or can **Edit code**
Expand Down Expand Up @@ -90,6 +90,24 @@ Once site admins create tags, other users in your organization can assign tags t

You can assign multiple tags to a prompt and group them based on their functionality, category, or any other criteria for your organization. In addition, with tags assigned to prompts, you can filter prompts by tags in the Prompt Library.

## Specific and dynamic context (beta)

<Callout type="info">Sourcegraph 6.0 adds beta support for the `@` mention menu in the prompt library.</Callout>

When writing prompts, you can leverage both specific and dynamic context through the `@` mention system.

![A dropdown appears after typing `@` in the prompt editor.](https://storage.googleapis.com/sourcegraph-assets/Docs/at-mentions-dropdown.png)

Type `@` to open a dropdown menu that lets you reference specific context like symbols, directories, files, repositories and web URLs.

When selecting a web URL, type out the domain, including the `https://` prefix, for example, https://sourcegraph.com.

For dynamic context that adapts based on what the user is working on, the prompt editor provides special mentions for the current selection, current file, current repository, current directory, and open tabs.
When a user runs a prompt template containing dynamic context mentions, they are automatically resolved to the appropriate specific context based on the user's current workspace state.
To add dynamic context, click on one of the buttons below the prompt editor. We will soon move the buttons into the `@` mention menu as well.

This powerful combination allows prompt authors to create templates that can intelligently access both explicitly defined context and contextually relevant information at runtime.

## Run prompts

You can run prompts via:
Expand Down
16 changes: 16 additions & 0 deletions docs/cody/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,22 @@ cody chat --model '$name_of_the_model' -m 'Hi Cody!'

For example, to use Claude 3.5 Sonnet, you'd pass the following command in your terminal, `cody chat --model 'claude-3.5-sonnet' -m 'Hi Cody!'

### Sign-in dialog gets stuck with Kaspersky Antivirus

**Problem:** When attempting to sign in, users may encounter a perpetual `"Signing in to Sourcegraph..."` dialog that never completes. This issue persists across different VS Code extension versions (e.g. 1.40-1.48) and browsers (Chrome, Edge, Firefox). In the browser console at `accounts.sourcegraph.com/sign-in`, you might see an error: `"Uncaught ApolloError: value.toString is not a function"`.

**Solution:** This issue is typically caused by Kaspersky Antivirus interfering with the authentication process. To resolve:

- Locate the Kaspersky icon in your system tray
- Right-click on the Kaspersky icon
- Select "Stop Protection"
- Right-click the icon again
- Select "Exit"

<Callout type="warning">
Once you are signed in make sure to re-enable protection.
</Callout>

## OpenAI o1

### What are OpenAI o1 best practices?
Expand Down
Loading
Loading