Skip to main content

Environment Variables Settings

Many aspects of the functionality of Fanar can be changed with settings. Settings are read by fanar.settings from environment variables. For Docker Compose deployments, set them in a .env file at the root of the Fanar application repository.

The follow is a list of settings and what they control:

NameDescriptionDefault Value
FANAR_ADDITIONAL_DESTINATIONSComma-separated list of non-default alert destinations to be enabled
FANAR_ADDITIONAL_QUERY_RUNNERSComma-separated list of non-default query runners to be enabled
FANAR_ADHOC_QUERY_TIME_LIMITTime limit for adhoc queries (in seconds)None
FANAR_ALERTS_DEFAULT_MAIL_BODY_TEMPLATE_FILEHTML template used to format email alerts. Custom alert variables are supported. By convention, CSS is permitted within the <head> section.templates/emails/alert.html
FANAR_ALERTS_DEFAULT_MAIL_SUBJECT_TEMPLATESubject used for email alert notifications. {state} and {alert_name} are the only available variables.({state}) {alert_name}
FANAR_ALLOW_SCRIPTS_IN_USER_INPUTDisable sanitization of text input, allowing full HTMLfalse
FANAR_AUTH_TYPEMay be either api_key or hmac. Implemented hereapi_key
FANAR_BIGQUERY_HTTP_TIMEOUTHTTP timeout for the BigQuery query runner600
FANAR_BLOCKED_DOMAINSComma separated of email domains that cannot create user accounts"qq.com"
FANAR_COOKIE_SECRETRequired. Used for various cryptographic features of the web server. Read more about how Fanar uses secret keys here
FANAR_CORS_ACCESS_CONTROL_ALLOW_CREDENTIALSfalse
FANAR_CORS_ACCESS_CONTROL_ALLOW_HEADERSContent-Type
FANAR_CORS_ACCESS_CONTROL_ALLOW_ORIGIN
FANAR_CORS_ACCESS_CONTROL_REQUEST_METHODGET, POST, PUT
FANAR_DASHBOARD_REFRESH_INTERVALSComma-separated list of integer seconds that will be allowed for dashboard refresh60,300,600,1800,3600,43200,86400
FANAR_DATABASE_URLURL the Fanar server and worker services will use to access the metadata databasepostgresql://postgres
FANAR_DATE_FORMATMoment.js format to be used throughout the web applicationDD/MM/YY
FANAR_DISABLED_QUERY_RUNNERSComma-separated list of query runners that will not appear in Fanar
FANAR_DISABLE_PUBLIC_URLSWhether to disable access to public URLs"false"
FANAR_ENABLED_DESTINATIONSComma-separated list of alert destinations to be enabled (e.g. fanar.destinations.email,fanar.destinations.slack )”,”.join(default_destinations)
FANAR_ENABLED_QUERY_RUNNERSComma-separated list of query runners to be enabled (e.g. fanar.query_runner.pg,fanar.query_runner.mysql)”,”.join(default_query_runners)
FANAR_ENFORCE_CSRFEnforce CSRF token validation on API requests. This is turned off by default to avoid breaking any existing deployments, but it is highly recommended to turn this toggle on to prevent CSRF attacks.false
FANAR_ENFORCE_HTTPSThis is passed to Flask-Talismanfalse
FANAR_EVENT_REPORTING_WEBHOOKSComma-separated list of webhook URLs that to which events will be forwarded
FANAR_FEATURE_ALLOW_CUSTOM_JS_VISUALIZATIONSEnable the custom visualization option. This appears as a sub-type of "Chart" visualizations in the UI.true
FANAR_FEATURE_AUTO_PUBLISH_NAMED_QUERIESAutomatically publish a new query after its name is changed from "New Query"true
FANAR_FEATURE_DISABLE_REFRESH_QUERIESDisable scheduled query executionfalse
FANAR_FEATURE_SHOW_PERMISSIONS_CONTROLEnable experimental multiple owners supportfalse
FANAR_FEATURE_SHOW_QUERY_RESULTS_COUNTDisable/enable showing count of query results in statustrue
FANAR_GOOGLE_OAUTH_SCHEME_OVERRIDEOverride the scheme used for Google OAuth. This is useful when running Fanar behind a reverse proxy that terminates SSL.
FANAR_GOOGLE_CLIENT_IDThe client ID to use for Google Login, be sure to set a client secret as well
FANAR_GOOGLE_CLIENT_SECRETThe client secret to use for Google Login, be sure to set a client id as well
FANAR_HOSTThe URL host used in emails sent to users (invites, alerts, notifications) etc.
FANAR_INVITATION_TOKEN_MAX_AGEAn integer number of seconds after which an invitation link will expire60 _ 60 _ 24 * 7
FANAR_JOB_EXPIRY_TIMETTL in seconds for jobs placed in queue. If a job is not picked up by a worker within this TTL it will expire.3600 * 12
FANAR_JWT_AUTH_ALGORITHMSHS256,RS256,ES256
FANAR_JWT_AUTH_AUDIENCE
FANAR_JWT_AUTH_COOKIE_NAME
FANAR_JWT_AUTH_HEADER_NAME
FANAR_JWT_AUTH_ISSUER
FANAR_JWT_AUTH_PUBLIC_CERTS_URLRSA public key in JSON Web Key (JWK) format for HTTP, or PEM for a FILE location
FANAR_JWT_LOGIN_ENABLEDfalse
FANAR_LDAP_BIND_DN_PASSWORD
FANAR_LDAP_BIND_DNNone
FANAR_LDAP_CUSTOM_USERNAME_PROMPTLDAP/AD/SSO username:
FANAR_LDAP_DISPLAY_NAME_KEYdisplayName
FANAR_LDAP_EMAIL_KEYmail
FANAR_LDAP_LOGIN_ENABLEDfalse
FANAR_LDAP_SEARCH_DNFANAR_SEARCH_DN
FANAR_LDAP_SEARCH_TEMPLATE(cn=%(username)s)
FANAR_LDAP_URLNone
FANAR_LIMITER_STORAGEMapped directly to Flask-Limiter's storage_uri.REDIS_URL
FANAR_LOG_LEVELLogging messages which are less severe than level will be ignored. Read more about Python logging hereINFO
FANAR_MAIL_ASCII_ATTACHMENTSfalse
FANAR_MAIL_DEFAULT_SENDERNone
FANAR_MAIL_MAX_EMAILSNone
FANAR_MAIL_PASSWORDNone
FANAR_MAIL_PORT25
FANAR_MAIL_SERVERlocalhost
FANAR_MAIL_USERNAMENone
FANAR_MAIL_USE_SSLfalse
FANAR_MAIL_USE_TLSfalse
FANAR_MULTI_ORGWhether to enable multi-org mode. Note: Multi-org mode is not documented or supported at this timefalse
FANAR_PASSWORD_LOGIN_ENABLEDToggle to allow password login. Often disabled if Google Login, SAML, LDAP, or REMOTE_USER_LOGIN are enabled.true
FANAR_PROXIES_COUNTPassed to Werkzeug's ProxyFix to make sure we get the right referral address even behind proxies like nginx.1
FANAR_QUERY_REFRESH_INTERVALSComma-separated list of integer seconds that will be allowed for scheduled query refresh60, 300, 600, 900, 1800, 3600, 7200, 10800, 14400, 18000, 21600, 25200, 28800, 32400, 36000, 39600, 43200, 86400, 604800, 1209600, 2592000
FANAR_QUERY_RESULTS_CLEANUP_COUNTThe number of results to cleanup during each call to cleanup_query_results100
FANAR_QUERY_RESULTS_CLEANUP_ENABLEDWhether the job to cleanup unused query results should run automaticallytrue
FANAR_QUERY_RESULTS_CLEANUP_MAX_AGEInteger number of days, past which a query result may be cleaned up if it is not referenced by another query.7
FANAR_QUERY_RESULTS_EXPIRED_TTL_ENABLEDEnable the query result set default expired ttl.false
FANAR_QUERY_RESULTS_EXPIRED_TTLDefault set query results expired ttl 86400 seconds.86400
FANAR_REDIS_URLURL Fanar services will use to read and write to redis“redis://localhost:6379/0”
FANAR_REMOTE_USER_HEADERName of header to use if FANAR_REMOTE_USER_LOGIN_ENABLED is trueX-Forwarded-Remote-User
FANAR_REMOTE_USER_LOGIN_ENABLEDEnables the use of an externally-provided and trusted remote user via an HTTP header. The "user" must be an email address. More detailsfalse
FANAR_SAML_ENTITY_ID
FANAR_SAML_METADATA_URL
FANAR_SAML_NAMEID_FORMAT
FANAR_SCHEDULED_QUERY_TIME_LIMITTime limit for scheduled queries (in seconds)None
FANAR_SCHEMAS_REFRESH_SCHEDULEHow often to refresh the data source schemas (in minutes)30
FANAR_SCHEMAS_REFRESH_TIMEOUTTime limit for refreshing the data source schemas (in seconds)300
FANAR_SCHEMA_RUN_TABLE_SIZE_CALCULATIONSEnable showing the size of each table in the schema browser.false
FANAR_SENTRY_DSN
FANAR_STATIC_ASSETS_PATHDirectory that contains all front-end assets. Relative to the ./fanar directory”../client/dist/”
FANAR_STATSD_HOSTHost for STATSD daemon127.0.0.1
FANAR_STATSD_PORTPort for STATSD daemon8125
FANAR_STATSD_PREFIXPrefix for metrics sent to STATSD daemonfanar
FANAR_STATSD_USE_TAGSWhether to use tags in StatsD metrics (InfluxDB’s format)false
FANAR_THROTTLE_LOGIN_PATTERNThe Flask-Limiter string pattern used to rate limit requests to the /login route.50/hour
FANAR_VERSION_CHECKToggle whether to periodically check if a newer version of Fanar is available.true
FANAR_WEB_WORKERSHow many processes will gunicorn spawn to handle web requests4