Skip to main content

Configuration

The API server can be configured via the following environment variables:

Environment variableDescriptionDefault value
NODE_ENVThe node runtime environmentdev
TR_PORTThe port on which the server will listen on8080
TR_SECRETThe application secret, used i.e. for signing and verifying the auth tokens, it is strongly recommended that you do not use the default onesecret
TR_VIRTUAL_HOSTThe virtual host tells the server under which domain you are hosting the webapp, used i.e. to correctly format URLs and links in emailshttp://localhost:8080
TR_DB_TYPEThe type of database to usemysql
TR_DB_HOSTThe DB host127.0.0.1
TR_DB_PORTThe DB port3306
TR_DB_DATABASEThe database name to connect totr_dev
TR_DB_USERThe user to connect withroot
TR_DB_PASSWORDThe password to connect with(empty)
TR_PUBLIC_DIRThe path at which the public server files are located./public
TR_TEMPLATES_DIRThe path at which the server templates are located./templates
TR_CORS_ENABLEDIf enabled, the server will allow CORS requestsfalse
TR_ACCESS_LOGS_ENABLEDIf enabled, the server will log all requests to STDOUTtrue
TR_AUTH_TOKEN_EXPIRESThe duration in seconds that the issued JWT tokens will be valid for86400
TR_SIGNUPS_ENABLEDIf enabled, users can sign in fortrue
TR_MAX_PROJECTS_PER_USERThe max number of projects that can be created per user100
TR_DEFAULT_PROJECT_PLANThe default project plan, by default set to open-source and is limited to 100,000 strings (you are free to change it)open-source
TR_DB_AUTOMIGRATEIf enabled, on startup the server will ensure that all DB migrations have been appliedtrue
TR_MAIL_DEBUGIf enabled, it log a preview email linkfalse
TR_MAIL_SENDERThe mail sendernot set
TR_MAIL_HOSTThe mail server hostnot set
TR_MAIL_PORTThe mail server port587
TR_MAIL_SECUREIf enabled, attempt to send mail securelyfalse
TR_MAIL_REJECT_SELF_SIGNEDIf enabled, reject self-signed or invalid certificates from the mail servertrue
TR_MAIL_USERThe auth user for the mail servernot set
TR_MAIL_PASSWORDThe auth password for the mail servernot set
TR_IMPORT_MAX_NESTED_LEVELSMax number of nested levels in terms allowed for import formats100
TR_AUTH_GOOGLE_ENABLEDSet to 'true' if you'd like to enable sign-in with Googlenot set
TR_AUTH_GOOGLE_CLIENT_IDYour Google OAuth client IDnot set
TR_AUTH_GOOGLE_CLIENT_SECRETYour Google OAuth client secretnot set
TR_AUTH_GOOGLE_REDIRECT_URLThe redirect url, should be 'https://$YOUR_TRADUORA_HOST/auth/callback' and also be set in the allowed redirect URI's in the Google API console when you created the OAuth integrationnot set