Polarity v4 Admin Guide
Polarity v5 Admin Guide
  • Sever Requirements
    • Deployment Methods
      • Deploying Polarity Server on AWS with RDS and Elasticache
      • Deploying Polarity Server Virtual Machine on Azure
      • Deploying via OVA
      • Deploying via RPM
      • Polarity Server BYOL AMI
  • Guides
    • Installing License
    • Authentication
      • SAML
        • Azure ADFS
        • Okta
        • SAML Troublshooting
      • LDAP Troubleshooting
    • Installing Private Certificate Authority
    • Installing SSL Certificate
      • Installing LetsEncrypt SSL Certificate on Polarity Server
    • Configuring a Proxy
    • Migrating Polarity Servers
      • Upgrade PostgreSQL to v13
    • Enabling SMTP
    • Server Environment Variables
    • File System Layout
    • Configuring a FQDN
    • Enabling Source Analytics
      • Elasticsearch
        • Configuring Source Analytics on Elasticsearch
        • Source Analytics Integration with Elasticsearch
    • v5 Server Pre-Flight Upgrade Check
  • Integrations
    • Auto Subscribe CLI Tool
    • Installation
    • Install Multiple Copies of an Integration
    • Modifying Integration Name & Acronym
    • Add Custom Entity Types
Powered by GitBook
On this page
  1. Guides

Server Environment Variables

Server environment variables can be configured by modifying the .env file located at /app/polarity-server/.env.

Modifications to the .env file will require a restart of the polarity daemon systemctl restart polarityd

Variables

##################################
# The following environment variables are automatically loaded by the Polarity Server when it starts
# This file should be placed in the server's root directory /app/polarity-server
##################################

# Location of the Polarity Server's configuration file
# Default: /app/polarity-server/config/config.js
POLARITY_SERVER_CONF_FILE=/app/polarity-server/config/config.js

# The public GPG key used to verify the server's license
# Default: /app/polarity-server/.gpg/GPG-KEY-polarityio-primary
POLARITY_PUBLIC_LICENSE_KEY=/app/polarity-server/.gpg/GPG-KEY-polarityio-primary

# The path to the Polarity license file
# Default: /app/polarity-server/license/polarity.lic
POLARITY_LICENSE=/app/polarity-server/license/polarity.lic

# If set to true, Polarity will collect metrics on which users have viewed annotated entities.
# Valid values: true, false
# Default: true
POLARITY_USER_METRICS_COLLECTION=true

# The mode that the server should be running in.
# Valid values: production,development
# Default: production
NODE_ENV=production

# When set, the well known "root" CAs (like VeriSign) will be extended with the extra certificates in the
# specified file. The file should consist of one or more trusted certificates in PEM format. A message will be
# emitted (once) with process.emitWarning() if the file is missing or malformed, but any errors are otherwise ignored.
# This environment variable is most commonly set to allow Polarity to trust third party systems with SSL certificates
# signed by an internal Certificate Authority (e.g., if connecting to an internal server via an integration).
#
# This environment variable is ignored when node runs as setuid root or has Linux file capabilities set.
# NODE_EXTRA_CA_CERTS=/path/to/ca.pem


#####################################
# Logging Variables
#####################################

# The location where the Polarity Server log file will be written out to
# Default: /app/polarity-server/logs/polarity-server.log
POLARITY_LOG_FILE=/app/polarity-server/logs/polarity-server.log

# The default Polarity Server logging level
# Valid Values: error, warn, info, debug, trace
# Default: info
POLARITY_LOG_LEVEL=info

# If set to true, Polarity will log all HTTP Requests to the server.
# Valid values: true, false
# Default: true
POLARITY_LOG_REQUESTS=true

# If set to true, Polarity will log user session information as part of the request logging.
# The `POLARITY_LOG_REQUESTS` property must also be set to true for this property to have an effect
# Valid values: true, false
# Default: false
POLARITY_LOG_REQUEST_SESSION=false

# If set to true, Polarity will log all HTTP Request body (i.e., payload) information.
# Note that setting this value to true will log entities on users' screens and will greatly increase
# the size of the log files collected.
# The `POLARITY_LOG_REQUESTS` property must also be set to true for this property to have an effect
# Valid values: true, false
# Default: false
POLARITY_LOG_REQUEST_BODY=false

# If set to true, Polarity will log all integration errors to the Polarity server log files.  Regardless of this
# setting, Integration errors may still be logged by individual integrations into the integration specific logs
# depending upon how the integration was developed.  Please note that integration errors typically log responses from
# 3rd party REST APIs and services which may contain sensitive information depending upon what data the 3rd party is
# returning.
# Valid values: true, false
# Default: false
POLARITY_LOG_INTEGRATION_ERRORS=false

# If enabled, the Polarity Server will log integration lookup information to provide usage telemetry. The level
# of logging can be set to `off`, `minimal`, `info`, or `verbose`.  If an invalid value is provided, nothing
# will be logged.  Logging levels are additive (e.g., the `info` level will log fields from `minimal` and `info`).
# Valid values: off, minimal, info, verbose
# Default: off
#
# level: off
# No fields logged
#
# level: minimal
# timestamp, msgType, integrationId, hasResult, isFromCache, isOnDemand
#
# level: info
# primaryEntityType, entityTypes, process
#
# level: verbose
# entityValue, windowTitle, userId
POLARITY_LOG_INTEGRATION_LOOKUPS=off

# Valid values: true, false
# Default: false
POLARITY_LOG_ENABLE_SYSLOG=false

# Valid values: true, false
# Default: false
POLARITY_LOG_ENABLE_STDOUT=false

# Valid values: true, false
# Default: true
POLARITY_LOG_ENABLE_FILE=true

# If enabled, the server will output LDAP related debugging information to the log file specified by
# POLARITY_LDAP_CLIENT_DEBUG_LOG_FILE.  The LDAP debug logging includes sensitive LDAP information so
# this variable should only be set to `true` for configuration purposes.
# Valid values: true, false
# Default: false
POLARITY_ENABLE_LDAP_CLIENT_DEBUG_LOGGING=false

# When LDAP debugging is enabled via the POLARITY_ENABLE_LDAP_CLIENT_DEBUG_LOGGING environment variable
# the LDAP logging will be output to this file.
# Default: /app/polarity-server/logs/ldap-debug.log
POLARITY_LDAP_CLIENT_DEBUG_LOG_FILE=/app/polarity-server/logs/ldap-debug.log

#####################################
# PostgreSQL Variables
#####################################
POLARITY_DB_DATABASE
POLARITY_DB_PORT
POLARITY_DB_HOST
POLARITY_DB_USER
POLARITY_DB_PASSWORD
POLARITY_DB_SCHEMA
POLARITY_DB_CONNECTION_POOL_SIZE
POLARITY_DB_SUPERUSER_USER
POLARITY_DB_SUPERUSER_PASSWORD

# Used to force or disable SSL connections to the PostgreSQL database.  In the default mode,
# Polarity will attempt to connect via SSL if possible but will fall back on non-SSL connections when
# SSL is not enabled on the PostgreSQL database.
# If deploying via RDS with SSL forced via `force_ssl=1` then you should set `PGSSLMODE=require`
# Note that if you are enabling SSL then you will likely need to add the Root Cert (CA) to
# the NODE_EXTRA_CA_CERTS environment variable.
# Default: prefer
# (uncomment the below line to force SSL connections and abort if the connection cannot be made)
# PGSSLMODE=require

#####################################
# Global Cache Variables
# The following environment variables affect all configured caches (session, pg, metrics, integration)
#####################################

# If set to true, Polarity will automatically configure Redis based cache
# services. This variable should be set to 'false' if you are running Polarity
# against Amazon Elasticache for Redis as Elasticache does not support the Redis `config` command.
# Default: true
POLARITY_INITIALIZE_REDIS_CONFIGS_ON_START=true

# If set to true, Polarity will enforce transport encryption (TLS) on connections to any of the Redis
# based caches.  Note that if you are using AWS Elasticache for Redis and have enabled Redis AUTH, you must
# also enable transport encryption in AWS and on the Polarity server using this environment variable.
# Valid Values: true, false
# Default: false
POLARITY_ENABLE_REDIS_TRANSPORT_ENCRYPTION=false

#####################################
# Session Cache Variables
#####################################

POLARITY_SESSION_CACHE_HOST
POLARITY_SESSION_CACHE_PORT
POLARITY_SESSION_CACHE_DB

# The number of seconds sessions are valid for.  This value must be specified.
# Valid Values: Integer value in seconds
# Default: 2592000
POLARITY_SESSION_CACHE_TTL=2592000

# If specified, the Polarity server will use the provided password to
# authenticate with the Polarity Session Cache.
# This value should be set to the password specified in your Redis instance config
# via the `requirepass` parameter.  If you do not have authentication enabled
# you should leave this variable commented out.
# Default: no authentication
# POLARITY_SESSION_CACHE_PASSWORD=password

#####################################
# Integration Cache Variables
#####################################

POLARITY_INTEGRATION_CACHE_HOST
POLARITY_INTEGRATION_CACHE_PORT
POLARITY_INTEGRATION_CACHE_DB

# If specified, the Polarity server will use the provided password to
# authenticate with the Polarity Integration Cache.
# This value should be set the password specified in your Redis instance config
# via the `requirepass` parameter.  If you do not have authentication enabled
# you should leave this variable commented out.
# Default: no authentication
# POLARITY_INTEGRATION_CACHE_PASSWORD=password

#####################################
# Metrics Cache Variables
#####################################

POLARITY_METRICS_REDIS_HOST
POLARITY_METRICS_REDIS_PORT
POLARITY_METRICS_REDIS_DB

# If specified, the Polarity server will use the provided password to
# authenticate with the Polarity Metrics Cache.
# This value should be set the password specified in your Redis instance config
# via the `requirepass` parameter.  If you do not have authentication enabled
# you should leave this variable commented out.
# Default: no authentication
# POLARITY_METRICS_CACHE_PASSWORD=password

# The percentage of system memory that should be used by the Metrics cache
# The percentage is represented in decimal format between 0 (0%) and 1 (100%).
# For example, the default value of 0.1 means up to 10% of system memory can be
# used by the cache.  If the max memory is reached, Redis will begin evicting the oldest
# keys.
# Default: 0.1
POLARITY_METRICS_CACHE_MAX_MEMORY=0.1

#####################################
# PG Cache Variables
#####################################

POLARITY_PG_CACHE_HOST=127.0.0.1
POLARITY_PG_CACHE_PORT=9379
POLARITY_PG_CACHE_DB=0

# If specified, the Polarity server will use the provided password to
# authenticate with the Polarity Postgres Cache.
# This value should be set the password specified in your Redis instance config
# via the `requirepass` parameter.  If you do not have authentication enabled
# you should leave this variable commented out.
# Default: no authentication
# POLARITY_PG_CACHE_PASSWORD=password

#####################################
# Inactive User Notification Variables
#####################################

# Valid values: true, false
# Default: true
POLARITY_EMAIL_INACTIVE_USERS=true

# The number of days a user has to be inactive before they are sent an inactive user email
# welcoming them to come back to the platform.
# Value values: <integer value greater than 0>
# Default: 10
POLARITY_NUMBER_OF_DAYS_BEFORE_USER_IS_INACTIVE=10

#####################################
# Feature Flag Variables
#
# !! Feature flag variables should not be modified by Polarity Enterprise customers
#####################################

# The Highlights Mode is ‘on’ when PolarityX connects to a server for the first time.
# Valid values: true, false
# Default: false
POLARITY_WEB_MODE_HUD_ENABLED_BY_DEFAULT=false

# PolarityX will not be set to OnDemand-only mode on first launch.
# Valid values: true, false
# Default: true
POLARITY_WEB_MODE_ONDEMAND_ENABLED_BY_DEFAULT=true

# The 'Stream' mode is 'on' when PolarityX connects to a server for the first time.
# Valid values: true, false
# Default: false
POLARITY_WEB_MODE_STREAM_ENABLED_BY_DEFAULT=false

# Users can use 'Highlight' mode. (affects PX and Web)
# Valid values: true, false
# Default: true
POLARITY_PLATFORM_MODE_HUD_ENABLED=true

# Users can use 'Stream' mode. (affects PX and Web)
# Valid values: true, false
# Default: true
POLARITY_PLATFORM_MODE_STREAM_ENABLED=true

# Users have access to Polarity annotations.
# Valid values: true, false
# Default: true
POLARITY_PLATFORM_ANNOTATIONS_ENABLED=true

# The main window can be used to configure Polarity.
# Valid values: true, false
# Default: true
POLARITY_PLATFORM_MAIN_WINDOW_ENABLED=true
PreviousEnabling SMTPNextFile System Layout

Last updated 2 years ago