Settings
Settings provide the ability to customize and control the Sourcegraph UI and user-specific features. They do not configure operational aspects of the instance (which are set in the site configuration).
Settings can be set at the global level (by site admins), the organization level (by organization members), and at the individual user level.
Editing global settings (for site admins)
Global settings are found in Site admin > Global settings while links to organization and user settings are found in the user dropdown menu.
After setting or changing certain values in Site admin > Global settings the frontend will restart automatically or you might be asked to restart the frontend for the changes to take effect. In case of a Kubernetes deployment this can be done as follows:
SHELLbash kubectl delete pods -l app=sourcegraph-frontend
Reference
Settings options and their default values are shown below.
admin/config/settings.schema.json
JSON{ ////////////////////////////////////////////////////////////// // General Configuration ////////////////////////////////////////////////////////////// // Disables observability-related site alert banners. "alerts.hideObservabilitySiteAlerts": true, // Whether to show alerts for major and minor version updates. Alerts for patch version updates will be shown if `alerts.showPatchUpdates` is true. "alerts.showMajorMinorUpdates": true, // Whether to show alerts for patch version updates. Alerts for major and minor version updates will be shown if `alerts.showMajorMinorUpdatess` is true. "alerts.showPatchUpdates": true, // Whether to run global searches over all repositories. On instances with many repositories, this can lead to issues such as: low quality results, slow response times, or significant load on the Sourcegraph instance. Defaults to true. "basicCodeIntel.globalSearchesEnabled": false, // Whether to include archived repositories in search results. "basicCodeIntel.includeArchives": false, // Whether to include forked repositories in search results. "basicCodeIntel.includeForks": false, // Whether to use only indexed requests to the search API. "basicCodeIntel.indexOnly": false, // The timeout (in milliseconds) for un-indexed search requests. "basicCodeIntel.unindexedSearchTimeout": 0, // Whether to fetch multiple precise definitions and references on hover. "codeIntel.disableRangeQueries": false, // Never fall back to search-based code intelligence. "codeIntel.disableSearchBased": false, // Whether to supplement precise references with search-based results. "codeIntel.mixPreciseAndSearchBasedReferences": false, // Whether to enable trace logging on the extension. "codeIntel.traceExtension": false, // Custom informational messages to display to users at Cody clients locations. // Usually this setting is used in global and organization settings. If set in user settings, the message will only be displayed to that single user. "cody.notices": null, // Experimental features and settings. "experimentalFeatures": { "batchChangesExecution": true, "boostRelevantRepositories": true, "clientSearchResultRanking": "by-zoekt-ranking", "codeInsightsCompute": false, "codeInsightsRepoUI": "single-search-query", "disableOrderBySimilarity": false, "enableLazyBlobSyntaxHighlighting": true, "enableLazyFileResultSyntaxHighlighting": true, "enableSearchFilePrefetch": true, "enableSidebarFilePrefetch": true, "fuzzyFinder": false, "fuzzyFinderActions": false, "fuzzyFinderAll": false, "fuzzyFinderCaseInsensitiveFileCountThreshold": 25000, "fuzzyFinderNavbar": false, "fuzzyFinderRepositories": false, "fuzzyFinderSymbols": false, "goCodeCheckerTemplates": false, "keywordSearch": true, "newSearchNavigationUI": false, "newSearchResultFiltersPanel": false, "newSearchResultsUI": true, "proactiveSearchResultsAggregations": true, "searchContextsQuery": false, "searchQueryInput": "v1", "searchResultsAggregations": false, "showCodeMonitoringLogs": false, "symbolKindTags": false }, // Whether the sidebar on the repo view should be open by default. "fileSidebarVisibleByDefault": true, // Custom page size for the history tab. If set, the history tab will populate that number of commits the first time the history tab is opened and then double the number of commits progressively. "history.defaultPageSize": 0, // Show absolute timestamps in the history panel and only show relative timestamps (e.g.: "5 days ago") in tooltip when hovering. "history.preferAbsoluteTimestamps": false, // The number of seconds to execute the aggregation for when running in extended timeout mode. This value should always be less than any proxy timeout if one exists. The maximum value is equal to searchLimits.maxTimeoutSeconds "insights.aggregations.extendedTimeout": 55, // DEPRECATED: Use `notices` instead. // An array (often with just one element) of messages to display at the top of all pages, including for unauthenticated users. Users may dismiss a message (and any message with the same string value will remain dismissed for the user). // Markdown formatting is supported. // Usually this setting is used in global and organization settings. If set in user settings, the message will only be displayed to that user. (This is useful for testing the correctness of the message's Markdown formatting.) // MOTD stands for "message of the day" (which is the conventional Unix name for this type of message). "motd": null, // Custom informational messages to display to users at specific locations in the Sourcegraph user interface. // Usually this setting is used in global and organization settings. If set in user settings, the message will only be displayed to that single user. "notices": null, // Group of settings related to opening files in an editor. "openInEditor": { "custom.urlPattern": null, "editorIds": null, "jetbrains.forceApi": null, "projectPaths.default": null, "projectPaths.linux": null, "projectPaths.mac": null, "projectPaths.windows": null, "replacements": null, "vscode.isProjectPathUNCPath": false, "vscode.remoteHostForSSH": null, "vscode.useInsiders": false, "vscode.useSSH": false }, // If enabled, all members of the org will be treated as admins (e.g. can edit, apply, delete) for all batch changes created in that org. "orgs.allMembersBatchChangesAdmin": false, // Key-value pairs of code host URLs to Swarm URLs. Keys should have no prefix and should not end with a slash, like "perforce.company.com:1666". Values should look like "https://swarm.company.com/", with a slash at the end. "perforce.codeHostToSwarmMap": {}, // DEPRECATED: This setting will be removed in a future version of Sourcegraph. "quicklinks": null, // The default number of lines to show as context below and above search results. Default is 1. "search.contextLines": 1, // Whether query patterns are treated case sensitively. Patterns are case insensitive by default. "search.defaultCaseSensitive": false, // DEPRECATED: this setting is no longer read when the default 'keyword' patterntype is enabled, which always uses the 'precise' mode. Smart search will be removed in a future release. "search.defaultMode": null, // The default pattern type that search queries will be interpreted as. "search.defaultPatternType": null, // The number of results we send down during a search. Note: this is different to the count: in the query. The search will continue once we hit displayLimit and updated filters and statistics will continue to stream down. Defaults to 1500. "search.displayLimit": 1500, // Disable search suggestions below the search bar when constructing queries. Defaults to false. "search.hideSuggestions": false, // Whether searches should include searching archived repositories. "search.includeArchived": false, // Whether searches should include searching forked repositories. "search.includeForks": false, // Predefined search snippets that can be appended to any search (also known as search scopes) "search.scopes": null, // Enables default site wide search context. Only admins can set this. Individual users can override with their own search context. "siteWideSearchContext": null }
Configuration Notes
Settings Hierarchy and Inheritance
Settings follow a cascade model where more specific settings override general ones:
- User settings - highest priority, affects individual users only
- Organization settings - medium priority, affects all organization members
- Global settings - lowest priority, affects all users on the instance
Frontend Restart Requirements
Some settings changes require a frontend restart to take effect:
- Changes to global settings may trigger automatic frontend restarts
- In Kubernetes deployments, manually restart frontend pods:
kubectl delete pods -l app=sourcegraph-frontend
Deprecated Settings
Several settings are deprecated and should be migrated:
motd
- Replace withnotices
for better functionality and styling optionsquicklinks
- Will be removed in future versionssearch.savedQueries
- Functionality integrated into search interface
Performance Impact Settings
search.displayLimit
affects initial search result loading - higher values increase memory usagebasicCodeIntel.globalSearchesEnabled
can impact performance on large instancesinsights.aggregations.extendedTimeout
extends query timeouts but may increase load
Security Considerations
User Privacy and Data Protection
- Global settings visibility - Global settings are visible to all users; avoid including sensitive information
- Notice content - Notices are displayed to all users; ensure content is appropriate for your organization
- Search behavior - Default search settings affect what users can discover across repositories
Access Control Configuration
orgs.allMembersBatchChangesAdmin
grants administrative privileges to all organization members - use carefullybasicCodeIntel.includeArchives
andbasicCodeIntel.includeForks
may expose archived or forked repositories users shouldn't access- Settings should align with repository permission policies to prevent unauthorized access
Code Intelligence Security
codeIntel.disableSearchBased
may expose code patterns through search-based fallbackscodeIntel.mixPreciseAndSearchBasedReferences
combines precise and search results - ensure both are appropriate- Trace logging (
codeIntel.traceExtension
) may expose code content in logs
Common Examples
Basic User Experience Configuration
JSON{ "fileSidebarVisibleByDefault": true, "search.defaultCaseSensitive": false, "search.defaultPatternType": "keyword", "search.displayLimit": 1500 }
Search Optimization
JSON{ "search.contextLines": 3, "search.includeArchived": false, "search.includeForks": false, "search.hideSuggestions": false, "basicCodeIntel.globalSearchesEnabled": true, "basicCodeIntel.unindexedSearchTimeout": 30000 }
Code Intelligence Configuration
JSON{ "codeIntel.disableRangeQueries": false, "codeIntel.disableSearchBased": false, "codeIntel.mixPreciseAndSearchBasedReferences": true, "basicCodeIntel.indexOnly": false }
Organization Batch Changes Setup
JSON{ "orgs.allMembersBatchChangesAdmin": false }
Notices and Alerts Configuration
JSON{ "notices": [ { "message": "📢 Scheduled maintenance window: **Saturday 2-4 PM UTC**", "location": "top", "dismissible": true, "variant": "warning" } ], "alerts.showMajorMinorUpdates": true, "alerts.showPatchUpdates": false, "alerts.hideObservabilitySiteAlerts": false }
History and Interface Preferences
JSON{ "history.defaultPageSize": 50, "history.preferAbsoluteTimestamps": false, "fileSidebarVisibleByDefault": true }
Code Insights Extended Configuration
JSON{ "insights.aggregations.extendedTimeout": 45 }
Best Practices
Settings Management Strategy
- Use global settings sparingly - Only configure settings that should apply to all users
- Leverage organization settings - Configure team-specific preferences at the organization level
- Document setting changes - Maintain records of why specific settings were configured
- Test setting changes - Verify settings work as expected before applying organization-wide
User Experience Optimization
- Configure sensible defaults - Set search and display preferences that work for most users
- Enable helpful features - Turn on code intelligence features unless they cause performance issues
- Minimize distractions - Use notices judiciously to avoid alert fatigue
- Respect user preferences - Allow users to override organization settings when appropriate
Performance Considerations
- Monitor search performance - Adjust
displayLimit
and timeout settings based on instance performance - Balance code intelligence features - Enable features that provide value without overwhelming the system
- Consider repository scale - Disable global searches on very large instances if needed
- Test timeout settings - Ensure Code Insights timeouts are appropriate for your query complexity
Maintenance and Updates
- Review deprecated settings - Regularly audit and migrate away from deprecated configurations
- Update alerting preferences - Configure update notifications based on your maintenance schedule
- Validate settings hierarchy - Ensure organization and global settings work together as intended
- Plan for setting changes - Coordinate setting updates with users when they affect user experience
Communication Best Practices
- Use clear notice messaging - Write notices that clearly communicate important information
- Choose appropriate notice styling - Use warning/danger variants for critical information
- Make notices actionable - Include links to relevant documentation or actions users should take
- Time-bound temporary notices - Remove notices when they're no longer relevant
Additional details on settings
Notices
Notices can be added in global, organization, or user settings. The notices
setting is a list of notice configurations with the following options:
message
: the markdown copy to be displayed in the bannerlocation
: where the banner will be shown. Either on the home page with"home"
or at the top of the page with"top"
dismissible (optional)
: boolean (true
orfalse
). If true, users will be able to close the notice and not see it again. If false, it will persist on the instance until the configuration is removed.variant (optional)
: one of"primary"
,"secondary"
,"success"
,"danger"
,"warning"
,"info"
,"note"
the style of the notice. Although specifics such as color depend on the theme in generaldanger
orprimary
will draw more attention thansecondary
ornote
. The default style depends on the location of the notice.styleOverrides (optional)
: a configuration object with the following elements:backgroundColor (optional)
: a hexadecimal color code for forcing a specific background color.textColor (optional)
: a hexadecimal color code for forcing a specific text color.textCentered (optional)
: boolean (true
orfalse
). If true, the text will be centered in the banner.
Example settings:
JSON"notices": [ { "message": "Your important message here! [Include a link for more information](http://example.com).", "location": "top", "dismissible": true, "variant": "danger", "styleOverrides": { "styleOverrides": { "backgroundColor": "#7f1d1d", "textColor": "#fecaca", "textCentered": true } } } ]