Skip to main content

Server configuration

As the Server is based on Spring framework, it follows its configuration standards. You can provide configuration properties as command line arguments when you run Tolgee with java -jar command or as environment variables.

server.port#

Port on which Tolgee exposes itself (default: 8080)

Data source settings#

Since Tolgee is built on Spring framework, to configure its database connection you have to edit following configuration props. These properties can be omitted when using postgres-autostart, which is enabled by default.

spring.datasource.url#

The url of the datasource in format jdbc:postgresql://<host>:<port>/<dbname>.

e.g. jdbc:postgresql://db:5432/postgres

spring.datasource.username#

Database username. e.g. postgres

spring.datasource.password#

Database password. e.g. postgres

Tolgee#

Configuration specific to Tolgee

tolgee.data-path#

Path to directory where Tolgee stores its files. (default: <user's home>/.tolgee/, with docker /data/)

Authentication#

Prefix: tolgee.authentication

enabled#

Whether authentication is enabled. If not, Tolgee will create implicit user on first startup and will automatically log you in. No login page shows, no permissions are managed. This is very useful, when you want to use Tolgee on your local machine, or you just want to test it. (default: false)

jwtSecret#

Secret used to sign JWT authentication tokens with. It will be generated automatically, if not provided. (default: null). You will be fine with 64 characters long random string.

jwtExpiration#

Expiration time of generated JWT tokens in milliseconds. (default 604800000 = 7 days)

nativeEnabled#

Whether user credentials are stored in Tolgee's database. If you would like to use LDAP, set this to false. (default true)

registrationsAllowed#

Enable/disable sign ups into Tolgee. (default: false)

createInitialUser#

If true, Tolgee creates initial user on first start-up. (default: true)

initialUsername#

Username of initial user. (default: false)

GitHub authentication properties#

Pefix: tolgee.authentication.github

If you want to allow your users to login using Github, set these configuration properties.

clientSecret#

Client secret obtained in GitHub administration. (default: null)

clientId#

Client id obtained in GitHub administration. (default: null) GitHub authentication can be used in combination with LDAP or native authentication.

Postgres autostart#

Prefix: tolgee.postgres-autostart

info

This feature was added in v2.

Defines, whether and how is PostgreSQL started on Tolgee startup.

enabled#

Is PostgreSQL run on startup? Defaults to true.

mode#

How is Tolgee running PostgreSQL.

Options:

  • DOCKER - Tolgee tries to run Postgres Docker container in your machine. This is default option when running Tolgee using Java. See Running with Java
  • EMBEDDED - Tolgee tries to run it's embedded PostgreSQL which is bundled in the tolgee/tolgee Docker image.

user#

Database user to bootstrap Postgres with. Defaults to postgres

password#

Database password to bootstrap Postgres with. Defaults to postgres

database-name#

The name of the database created to store Tolgee data. Defaults to postgres

port#

The port of Postgres to listen on host machine. This setting is applicable only for DOCKER mode. Defaults to 25432.

container-name#

This setting is applicable only for DOCKER mode. Defaults to tolgee-postgres.

SMTP properties#

To allow Tolgee to send emails to your users like password reset links or notifications, configure these properties. These properties are prefixed with tolgee.smtp.

For AWS SES it would look like this:

tolgee.smtp.host=email-smtp.eu-central-1.amazonaws.comtolgee.smtp.username=*****************tolgee.smtp.password=*****************tolgee.smtp.port=465tolgee.smtp.auth=truetolgee.smtp.sslEnabled=truetolgee.smtp.from=Tolgee <[email protected]>

host#

Smtp host

username#

The username for smtp authentication

password#

Password for smtp authentication

port#

auth#

Whether authentication is enabled. (default: false)

tlsEnabled#

Whether tls is enabled (default: false)

sslEnabled#

Whether ssl is enabled (default: false)

tlsRequired#

Whether ssl is required (default: false)

from#

The sender name and address in standard SMTP format.

LDAP authentication properties#

This feature is currently experimental! (prefix: tolgee.authentication.ldap)

  • enabled
  • port
  • urls
  • baseDn
  • securityPrincipal
  • principalPassword
  • userDnPattern

.env example#

Example .env file which you can start with:

JAVA_OPTS="-Xms128m -Xmx1024m"########## JWT #############tolgee.authentication.jwtSecret=...
########## Data source #############spring.datasource.url=jdbc:postgresql://db:5432/postgresspring.datasource.username=postgresspring.datasource.password=postgres
########## NATIVEtolgee.auth.allow-registrations=false
######### SMTP ###########tolgee.smtp.host=tolgee.smtp.username=tolgee.smtp.password=tolgee.smtp.port=tolgee.smtp.auth=tolgee.smtp.sslEnabled=tolgee.smtp.from=