Configuring
note
The easiest way to get started with Swetrix is by using our cloud service. We do all the dirty work for you: hosting, maintenance, backups, worldwide CDN, etc. Using Cloud you still own the data, you can export it or delete it at any time you want. By using Swetrix Cloud you support maintenance and development of the product, which eventually makes it better.
The following environment variables are available for configuration:
Frontend (swetrix image)
Variable | Default | Description |
---|---|---|
API_URL | http://localhost:8080/ | URL of the self-hosted Swetrix API instance. Swetrix frontend will use this variable to connect to the API, so make sure it's correct. |
API (swetrix-api image)
Variable | Default | Description |
---|---|---|
EMAIL | Required | Email address to use for access to dashboard |
PASSWORD | Required | Password to use for access to dashboard |
JWT_ACCESS_TOKEN_SECRET | auto-generated by configure.sh | Secret for JWT access tokens |
JWT_REFRESH_TOKEN_SECRET | auto-generated by configure.sh | Secret for JWT refresh tokens |
API_KEY | An optional API key for accessing your stats via the API directly. If not set - direct API access is disabled. | |
CLOUDFLARE_PROXY_ENABLED | false | If set to true - Swetrix will get IP address information from cf-connecting-ip header provided by Cloudflare. |
IS_PRIMARY_NODE | true | You should not touch this variable unless you know what you are doing. It's used to spin off multiple API instances in a cluster, where only one of them will be primary. If changed to false , things like cron task manager will be disabled for this instance. |
Redis
Variable | Default | Description |
---|---|---|
REDIS_PASSWORD | password | Redis password |
REDIS_PORT | 6379 | Redis port |
REDIS_USER | default | Redis user |
Clickhouse
Variable | Default | Description |
---|---|---|
CLICKHOUSE_DATABASE | analytics | ClickHouse database |
CLICKHOUSE_USER | default | ClickHouse user |
CLICKHOUSE_PORT | 8123 | ClickHouse port |
CLICKHOUSE_PASSWORD | ClickHouse password |