Services Configuration
Ptolemy's configuration is split into two main components: the API service and the Query Engine. Each component requires specific configuration to ensure proper operation and security. Below you'll find detailed configuration tables along with explanations for each section.
API Configuration
The API component handles all external requests and manages authentication. Its configuration is divided into three main sections: general settings, Postgres database configuration, and Redis caching configuration.
General Configuration
These settings control core API behaviors, including authentication and auditing. The sysadmin credentials are particularly important as they provide initial system access. The JWT secret is used for secure token generation and should be a strong, randomly generated value.
Name | Description | Default Value | Required |
---|---|---|---|
PTOLEMY_USER |
Sysadmin username | True | |
PTOLEMY_PASS |
Sysadmin password | True | |
JWT_SECRET |
Secret to generate JWTs. Must be base64 encoded. | True | |
ENABLE_AUDITING |
Enable auditing | false |
False |
SHUTDOWN_TIMEOUT |
Timeout for graceful shutdown (seconds) | 10 |
False |
Postgres Configuration
Ptolemy uses Postgres as its primary datastore. These settings define how the API connects to your Postgres instance. While default values are provided for most settings, in production environments you should explicitly configure all parameters to ensure security and reliability.
Name | Description | Default Value | Required |
---|---|---|---|
POSTGRES_USER |
Postgres username | True | |
POSTGRES_PASSWORD |
Postgres password | True | |
POSTGRES_HOST |
Postgres host | localhost |
False |
POSTGRES_PORT |
Postgres port | 5432 |
False |
POSTGRES_DATABASE |
Postgres database | ptolemy |
False |
Redis Configuration
Redis is used for as a message broker between services These settings configure the Redis connection. While Redis authentication is optional, it's recommended in production environments.
Name | Description | Default Value | Required |
---|---|---|---|
REDIS_HOST |
Redis host | localhost |
False |
REDIS_PORT |
Redis port | 6379 |
False |
REDIS_PASSWORD |
Redis password | False | |
REDIS_DB |
Redis database | 0 |
False |
Security Considerations
When deploying Ptolemy, pay special attention to security configuration:
- Always use strong, unique passwords for all required credentials
- Generate a secure random string for the JWT secret
- Consider enabling auditing in production environments
- Use appropriate network security measures to protect database and Redis instances
- Review and customize default values for your specific environment
The configuration options below provide flexibility for both development and production deployments while maintaining security best practices.
Query Engine Configuration
The Query Engine processes analysis requests asynchronously using Redis streams. Its configuration mirrors the API configuration in many ways, but includes additional settings for stream processing.
General Configuration
These settings control how the Query Engine processes requests. The stream and group names define how analysis jobs are organized and processed in Redis.
Name | Description | Default Value | Required |
---|---|---|---|
STREAM_NAME |
Redis stream name. | ptolemy:query |
False |
GROUP_NAME |
Redis group name. | ptolemy:query |
False |
Postgres Configuration
The Query Engine needs its own connection to Postgres to read and write analysis results. These settings match the API's Postgres configuration format.
Name | Description | Default Value | Required |
---|---|---|---|
POSTGRES_USER |
Postgres username | True | |
POSTGRES_PASSWORD |
Postgres password | True | |
POSTGRES_HOST |
Postgres host | localhost |
False |
POSTGRES_PORT |
Postgres port | 5432 |
False |
POSTGRES_DATABASE |
Postgres database | ptolemy |
False |
Redis Configuration
Like the API, the Query Engine needs Redis access for job management and caching. These settings match the API's Redis configuration.
Name | Description | Default Value | Required |
---|---|---|---|
REDIS_HOST |
Redis host | localhost |
False |
REDIS_PORT |
Redis port | 6379 |
False |
REDIS_PASSWORD |
Redis password | False | |
REDIS_DB |
Redis database | 0 |
False |