Prepare your project
Domain name system (DNS)
Qodana Self-Hosted exposes different HTTP endpoints as base URLs. Make sure to allocate a top-level domain like qodana.local. The majority of Qodana Self-Hosted components require dedicated base URLs, for example:
Component | URL |
|---|---|
Frontend |
|
Backend |
|
Linter API |
|
Built-in file storage |
|
Built-in SSO provider |
|
Built-in ingress controller (optional) |
|
These hostnames enable interaction of Qodana components and access to essential services. services. The IP can be of your server or a load balancer, depending on your deployment architecture.
In production environments, you should use a domain that aligns with your naming conventions like qodana.mycompany.com, files.qodana.mycompany.com and others.
If you intend to use Qodana only internally, configure DNS records in your internal DNS server. For external access, ensure that public DNS records point to appropriate IP addresses of your server or load balancer.
PostgreSQL
Databases
Qodana Self-Hosted operates multiple services with each service requiring their own database:
Database | Description | Variable |
|---|---|---|
API Database | Stores data related to Qodana’s API |
|
Git Database | Manages repositories and version control data |
|
Audit Database | Handles audit logs and compliance data |
|
Keycloak Database | Optional. Used for authentication and authorization services like Keycloak |
|
Users and roles
Each service requires a dedicated PostgreSQL user for having access to its corresponding database. These users are assigned specific permissions to ensure security and proper data isolation:
Database | Description | Variable |
|---|---|---|
API User | Read/write permissions for the API database |
|
Linters API User | Read-only permissions for certain tables |
|
Report Processor User | Read/write permissions for processing reports |
|
Git User | Full permissions for Git-related data |
|
Audit User | Full permissions for audit logs |
|
Keycloak User | Optional. Full ownership and permissions for the Keycloak database |
|
Permissions
The following permission rules are applied to ensure proper access control:
Users are granted access only to their respective databases.
Default privileges are configured so that users automatically receive permissions on newly created objects like tables, sequences, and functions.
Sensitive databases like an audit database are strictly controlled to prevent unauthorized access.
Database organization
Each Qodana service (API, Git, Audit, Keycloak) should have its own database. This prevents data corruption, unauthorized access between services, and lets you tune each database better to your needs.
Databases can be hosted on a single server or on different servers. A shared server is suitable for small-scale deployments with low traffic and minimal resource requirements. Separate servers are best suited for large-scale deployments or when handling highly sensitive data like audit logs or authentication.
Security and compliance
Use strong, randomly generated passwords for all database users. Store credentials securely, such as in an environment variable manager or secret storage like HashiCorp Vault and others.
Restrict permissions to ensure users can only access their assigned databases. Avoid granting superuser or unnecessary privileges.
Enable logging for database activity to monitor access and changes, especially for the audit database.
Backup and recovery
Implement a robust backup and recovery plan:
Schedule regular automated backups for all databases.
Test restoration processes regularly to ensure reliability.
For critical data like audit logs and Keycloak, use frequent point-in-time recovery backups.
Monitoring and maintenance
Use PostgreSQL monitoring tools like pgAdmin, Prometheus, or other to track database performance and health.
Periodically review database usage and clean up unused objects. Apply security updates and patches for PostgreSQL.
Example SQL script for a single database server setup
This snippet contains an example script that documents the instructions for configuring a single database server for Qodana Self-Hosted. The script references environment variables instead of hard coded values. The Keycloak database and user permissions configuration are optional. They are documented in the script if you plan to use Keycloak as an identity provider.
RabbitMQ
RabbitMQ acts as a message broker for various Qodana services facilitating communication and task processing.
Virtual hosts
Each Qodana instance requires a dedicated virtual host to isolate messaging operations from other applications. Define a virtual host using the environment variable: ${RABBITMQ_VHOST}. Example: /qodana
Users
A dedicated RabbitMQ user is required by Qodana for authenticating and performing operations on a virtual host. Create a user with the following parameters:
Parameter | Description |
|---|---|
Username |
|
Password |
|
Tags | Assign the administrator tag to grant full access |
Example:
Queues
Qodana requires several durable queues for handling messaging related to reports, Git operations, and triggers. Create the following queues within the ${RABBITMQ_VHOST} variable:
Description | Name | Example |
|---|---|---|
Report queue |
|
|
Git contributor request queue |
|
|
Git contributor response queue |
|
|
Trigger queue |
|
|
All queues must be durable to ensure message persistence in case of RabbitMQ restarts.
Permissions
Define access permissions for the Qodana user to operate within the vhost. Grant the following permissions to the ${RABBITMQ_APPLICATION_USERNAME} variable for the ${RABBITMQ_VHOST} variable:
Permission | Configuration | Description |
|---|---|---|
Configure |
| Enables configuration of all resources |
Write |
| Enables publishing to all queues |
Read |
| Enables consuming from all queues |
This is an example configuration in JSON:
Example definition in JSON
This is and example RabbitMQ configuration. For more details, see visit the RabbitMQ website.
MinIO
Qodana Self-Hosted supports MinIO for object storage. Qodana requires pre-signed URLs, which lets Qodana clients connect directly to a storage and upload artifacts for asynchronous processing or storage purposes.
Qodana Self-Hosted requires the MINIO_RESULTS_BUCKET and MINIO_BASELINES_BUCKET buckets, and they should be hosted on the same storage service.
OIDC provider
Qodana Self-Hosted does not provide a built-in user management module, so users should authenticate using an OIDC provider. Qodana Self-Hosted authorizes their actions according to permissions given to a specific user by an administrator.
To get assistance with configuring an OIDC provider, please contact our support at qodana-support@jetbrains.com.