Licensing
Sourcegraph requires a valid license key to enable many of its more prominent features.
License keys should not be shared across instances of Sourcegraph. If an additional license key is required for something like a dev environment, please contact customer support for an additional license key.
FAQ
What happens if our Sourcegraph license expires?
After Sourcegraph 5.3
Sourcegraph will continue to function as normal, but all users will be signed out of Sourcegraph. Only site administrators will be able to sign into Sourcegraph so that they can enter a new license key.
Before Sourcegraph 5.3
Sourcegraph will revert to a free license, and any features that require an enterprise license will stop functioning. This could lead to data loss if some of these features were in use, so be sure to renew your license in advance!
How can we update our license key?
Any current Site Admin can update your license key by going to Site Admin -> Site configuration
These settings live in the JSON object, and you will need to navigate to the licenseKey section of that object.
Update the value of this with your new license key and click Save to apply your changes.
Example:
SHELL"licenseKey": "<your_key_here>",
We have set up a new Sourcegraph instance by replicating an existing instance, how can we generate a new site ID to ensure the instances are unique?
The site ID of a Sourcegraph instance can be updated by running the following SQL query against the database:
SQLUPDATE global_state SET site_id = gen_random_uuid();
You will still require a unique license key for each site ID.
How does Sourcegraph calculate user licenses?
Sourcegraph calculates user license numbers using several key values:
-
currentUserCount
: Which represents the total number of users currently on the Sourcegraph. -
license.userCount
: Which is the total number of user licenses allowed by the current subscription. -
actualUserCount
: Which represents the maximum number of users that have ever been active on the Sourcegraph instance for the current license.
The component displays these numbers in the following format:
SHELL"{currentUserCount} currently used / {license.userCount - currentUserCount} remaining ({actualUserCount} maximum ever used)"
These values are fetched from the GraphQL API using the queryProductLicenseInfo
function, which queries the site's product subscription information and user count.
The component also checks if the number of users exceeds the licensed amount (license.userCount - actualUserCount < 0)
and displays a warning if this is the case.
This approach allows Sourcegraph to provide clear information about license usage and encourage upgrades and scaling licenses when necessary.