Skip to main content

Environment Variables and Settings

Environment Variables

As many other applications, Dawarich uses environment variables to configure its behavior. The following environment variables are supported:

Environment VariableDefault ValueDescription
RAILS_ENVdevelopmentApplication environment. development value makes sure all errors will be shown explicitly, making easier remote debugging
REDIS_URLredis://dawarich_redis:6379/0Redis URL
DATABASE_HOSTdawarich_dbDatabase host
DATABASE_USERNAMEpostgresDatabase username
DATABASE_PASSWORDpasswordDatabase password
DATABASE_NAMEdawarich_developmentDatabase name
MIN_MINUTES_SPENT_IN_CITY60Minimum minutes spent in a city
APPLICATION_HOSTSlocalhost,my.domain.comApplication hosts, provide multiple if you want your Dawarich instance to be available by multiple domains/ip addresses. Don't put protocols here, only host names.
APPLICATION_PROTOCOLhttpApplication protocol. Change to https if you want your Dawarich instance to be served via SSL
TIME_ZONEEurope/LondonTime zone. Full list of supported timezones available on Github
DISTANCE_UNITkmDistance unit. For miles, change to mi. All settings still should be provided in meters/kilometers
RAILS_MAX_THREADS5Connection pool size for the Dawarich database
BACKGROUND_PROCESSING_CONCURRENCY10Background processing concurrency. Should not be higher than RAILS_MAX_THREADS. More info on Sidekiq docs
PROMETHEUS_EXPORTER_ENABLEDfalsePrometheus exporter enabled
PROMETHEUS_EXPORTER_HOST0.0.0.0Prometheus exporter host
PROMETHEUS_EXPORTER_PORT9394Prometheus exporter port
DISABLE_TELEMETRYfalseDisable telemetry
PHOTON_API_USE_HTTPSnilUse HTTPS for Photon API requests
PHOTON_API_HOSTnilPhoton API host. Useful if you're self-hosting your own Photon instance
PHOTON_API_KEYnilPhoton API key. Useful if you're supporting Dawarich development on Patreon and want to use Photon API instance hosted by Freika without any limits
GEOAPIFY_API_KEYnilGeoapify API key. Provide your own key if you want to use Geoapify reverse geocoding service

Important note on Prometheus exporter: even if you want to use it, make sure you have PROMETHEUS_EXPORTER_ENABLED set to false in dawarich_sidekiq container. Otherwise, you'll end up with two exporters and will have to deal with duplicate metrics. The PROMETHEUS_EXPORTER_HOST for dawarich_sidekiq should be set to dawarich_app or your name of the container.