Phrase On-Premise Environment Variables
Phrase On-Premise Environment Variables
All configuration is done via the setting of environment variables inside the phraseapp.env file. An example file with arbitrary values could look similar to this purely illustrative file. 192.168.99.100 should be replaced by your actually used host names or IPs reachable from the Docker container running Phrase On-Premise. Also, make sure to replace the secrets at the end of the file according to the section about SECRETs at the end of this document:
DATABASE_URL=mysql2://root@192.168.99.100:3306/phraseapp?collation=utf8mb4_unicode_ci&encoding=utf8mb4
ELASTICSEARCH_URL=http://192.168.99.100:9200
REDIS_URL=redis://192.168.99.100:6379
RABBITMQ_URL=amqp://user:password@192.168.99.100:5672
RABBITMQ_HTTP_PORT=15672
BASE_URL=http://192.168.99.100:8080
CUSTOM_ASSET_HOST=http://192.168.99.100:8080
MAIL_RAISE_DELIVERY_ERRORS=0
MAIL_ADDRESS=192.168.99.100
MAIL_PORT=1025
MAIL_ENABLE_STARTTLS_AUTO=0
MAIL_USER_NAME=
MAIL_PASSWORD=
MAIL_AUTHENTICATION=plain
MAIL_DEFAULT_SENDER_ADDRESS=phraseapp@mycompany.tld
MAIL_DOMAIN=mycompany.tld
SIGNUPS_DISABLED=0
SESSION_COOKIE_NAME=_translate_session_sec
SESSION_COOKIE_SECURE_FLAG=false
RAILS_APP_OAUTH_ACCESS_TOKEN_SECRET=uo7peejia8peceeng4iete[...]
RAILS_APP_SECRET_TOKEN=ePeiPhai1hie9mahxil5ushie6cua1ahkae[...]
RAILS_APP_SECRET_KEY_BASE=rei5ohXocu2Biesiew4oFoTi1elohthi[...]
DEVISE_SECRET_KEY=Doh1iekeeshu0uzah8so8Iethohzaiv1ohvauze3[...]
DB_ENCRYPTION_SECRET=yei3Iey0eith5iep0Shohthech9mahNaip0Ph[...]
This file may not contain double-quotes “ - do not enclose string values with any quotes. See docker documentation for more on Environment variable settings.
Environment Variables
Database
DATABASE_URL
The Database URL to connect to, e.g. mysql2://user:pass@db-host:port/db?local_infile=true . You must set the scheme to the pseudo-scheme mysql2 for the Ruby application of Phrase On-Premise to be able to connect to your MySQL server. User and pass must be url-encoded with the Percent-encoding.
Elasticsearch
ELASTICSEARCH_URL
The URL of the Elasticsearch cluster to connect to, e.g. http://es-host:9200
Redis
REDIS_URL
The URL of the Redis host to connect to, e.g. redis://redis-host:6379
RabbitMQ (optional, requires Phrase On-Premise 3.6.1 or higher)
RABBITMQ_URL
The URL of the RabbitMQ host to connect to, e.g. amqp://rabbitmq-host:5672
RABBITMQ_HTTP_PORT
In order to utilize asynchronous / background processing you have to setup a RabbitMQ Server and point the Phrase On-Premise configuration to that server. Phrase On-Premise will use the RabbitMQ HTTP API (port 15672) to validate that the Service is available and enable background processing. If the service is not available, it will fall back to synchronous processing (slower).
Domain settings
BASE_URL
Hostname used for links in emails e.g. https://phraseapp.mycompany.com
CUSTOM_ASSET_HOST
Hostname used for CSS/JavaScript assets e.g. https://phrase-assets.mycompany.com
SMTP mail settings
Available SMTP mail server settings are explained in the smtp_settings section of the Ruby on Rails guides on mailer configuration.
MAIL_ADDRESS
Hostname of the SMTP server, e.g. smtp.mycompany.com
MAIL_PORT
SMTP port, e.g. 25
MAIL_USER_NAME
SMTP Username
MAIL_PASSWORD
SMTP Username
MAIL_ENABLE_STARTTLS_AUTO
Flag whether STARTTLS detection is enabled
MAIL_AUTHENTICATION
Authentication type, can be login , plain or cram_md5
MAIL_DOMAIN
SMTP Domain, necessary for certain SMTP relay configurations also called HELO domain, e.g. mycompany.com
MAIL_DEFAULT_SENDER_ADDRESS
Sender address for outgoing emails, e.g. phraseapp@yourcompany.com
MAIL_RAISE_DELIVERY_ERRORS
Set to 1 if you want the server to raise exceptions when mails cannot be send or to 0 if you want to ignore email delivery failures. We suggest setting this to 1 especially if
you're in the process of testing the SMTP server connection.
Signup Disabling
SIGNUPS_DISABLED
Disable the registration form to create new accounts for your system. This should be set to 0 for the first installation. If set to 0 anyone with access to Phrase On-Premise web interface can create new accounts. If set to 1 no one can create new accounts on the Phrase On-Premise installation.
Session Cookies
SESSION_COOKIE_NAME
Defines the cookie name for the user session.
Note: This has changed from version 3.4.0 to 3.5.0 and will force a logout of all users.
If you want to prevent this you have to set this to _translate_session_sec.
SESSION_COOKIE_SECURE_FLAG
This flag has to be set to true when you are serving the application through https.
Disable Rate Limiting
DISABLE_RATE_LIMIT
Setting this flag to true disables rate limiting for both concurrent number of requests and requests per time window for rate limited endpoints. By default only 4 concurrent requests and 1000 requests per 5 minutes per user are allowed.
SECRETs
There are several secret tokens that are used to encrypt data in Phrase On-Premise, such as the content of cookies and user passwords. Please make sure to use alphanumeric strings with at least 64 characters for all variables with names containing “SECRET”.
You must store these tokens in a safe location or your encrypted data such as user passwords will not work after you install updates or reinstall the system!