Skip to main content

Configuration

This page contains important configuration options you should consider when self-hosting solidtime in production. Please read them carefully and adjust them to your needs. If you are looking for a guide to get a simple setup up and running, you can find it here.

The configuration contains placeholders (your-domain.com, your-bucket-name, ***) that you need to replace with your own values.

General

The configuration example below is for a production environment using HTTPS. You can adjust the values to your needs, in any case you will have to change APP_URL to the URL of your solidtime instance.

APP_ENV="production"
APP_DEBUG="false"
APP_URL="https://your-domain.com"
APP_FORCE_HTTPS="true"
APP_ENABLE_REGISTRATION="true"
TRUSTED_PROXIES="0.0.0.0/0,2000:0:0:0:0:0:0:0/3"
Env variable nameDescription
APP_URLBase URL (f.e. https://your-domain.com for a production setup or something like http://localhost:8000 for a local HTTP-only setup)
APP_FORCE_HTTPSIf enabled, the application will threat all request as if they were HTTPS. This is useful if the app is behind a reverse proxy and the reverse proxy is HTTPS-only but the communication between reverse proxy and app is HTTP.
APP_ENABLE_REGISTRATIONIf enabled, users can register an account. If disabled, only users with an account can log in, but it is still possible to create users in the super admin panel and via the CLI.
TRUSTED_PROXIESComma-seperated list of CIDR IP ranges that are considered trusted. The app will trust headers like the X-Forwarded-For requests from those IPs. The example above (0.0.0.0/0,2000:0:0:0:0:0:0:0/3) is a wildcard for all IP addresses. This is only safe, if it's not possible to bypass the reverse proxy and the reverse proxy is correctly configured.
TRUSTED_HOSTSComma-seperated list of additional hostnames that the application accepts requests on. By default, requests are only accepted if their Host header matches the hostname of APP_URL or a subdomain of it. Requests on any other hostname are rejected to prevent Host header poisoning of generated links (f.e. password reset links). Set this variable if your instance is reachable under more than one hostname, f.e. TRUSTED_HOSTS="solidtime.internal,*.your-tailnet.ts.net". An entry like *.example.com matches all subdomains of example.com, but not example.com itself.

Authentication

You can run docker run --rm solidtime/solidtime:main php artisan self-host:generate-keys to obtain APP_KEY, PASSPORT_PRIVATE_KEY and PASSPORT_PUBLIC_KEY

APP_KEY=""
PASSPORT_PRIVATE_KEY=""
PASSPORT_PUBLIC_KEY=""
SUPER_ADMINS=""
Env variable nameDescription
APP_KEYThe application key is mainly used to encrypt the session cookies.
PASSPORT_PRIVATE_KEYPrivate key for the OAuth server
PASSPORT_PUBLIC_KEYPublic key for the OAuth server
SUPER_ADMINSArray of email addresses that have access to the super admin panel, seperated by a comma ,

Logging

You can read more about the logging configuration in the Laravel documentation.

Store logs in files under storage/logs with one log file per day:

LOG_CHANNEL="daily"
LOG_LEVEL="debug"

Output logs via stderr:

LOG_CHANNEL="stderr"
LOG_LEVEL="debug"

Output logs via stderr and store the in daily log files:

LOG_CHANNEL="stderr_daily"
LOG_LEVEL="debug"

Database

You can read more about the database configuration in the Laravel documentation. Please remember that solidtime only supports PostgreSQL.

DB_HOST="your-database-host-or-ip"
DB_PORT="5432"
DB_SSLMODE="require"
DB_DATABASE="***"
DB_USERNAME="***"
DB_PASSWORD="***"

PDF rendering

If you want to use solidtime features that create PDFs, like exporting a report as PDF, you need to configure a PDF rendering server. solidtime uses Gotenberg to render PDFs. The application needs to be able to send requests to the Gotenberg server. The self-hosting guide already includes a Gotenberg container. The environment variable GOTENBERG_URL is used to configure the URL of the Gotenberg server.

GOTENBERG_URL=http://gotenberg:3000

Email

Configure the email settings for sending emails. Solidtime supports every (transactional) mail service that offers an SMTP integration.

Example using Scaleway TEM via SMTP

MAIL_MAILER="smtp"
MAIL_HOST="smtp.tem.scw.cloud"
MAIL_PORT="465"
MAIL_ENCRYPTION="tls"
MAIL_FROM_ADDRESS="no-reply@your-domain.com"
MAIL_FROM_NAME="your-company-name"
MAIL_USERNAME="**"
MAIL_PASSWORD="**"

Test via Log

If you want to test f.e. the registration before setting up a transactional email service, you can use the log mailer. This logs outgoing emails to the log file. If you want to copy the link for the email verification, use the one from the textual, non-HTML version of the email in the log file.

MAIL_MAILER="log"

Queue

You can read more about the queue configuration in the Laravel documentation.

Sync

You can use this option if you don't want to use a separate Queue Worker (f.e. a worker container, see Container Mode) that handles queued jobs asynchronously. It will dispatch jobs synchronously. We do not recommend using this option in production.

QUEUE_CONNECTION="sync"

Database

Please keep in mind that you need a separate Queue Worker (f.e. a worker container, see Container Mode) that handles queued jobs asynchronously to use this configuration option.

QUEUE_CONNECTION="database"

File Storage

You can read more about the file storage configuration in the Laravel documentation.

Env variable nameDescription
FILESYSTEM_DISKFilesystem disk for private files
PUBLIC_FILESYSTEM_DISKFilesystem disk for public files (f.e. profile pictures)

Local Disk

FILESYSTEM_DISK="local"
PUBLIC_FILESYSTEM_DISK="public"

Scaleway Object Storage

FILESYSTEM_DISK="s3"
PUBLIC_FILESYSTEM_DISK="s3"
S3_REGION="fr-par" # fr-par, nl-ams, pl-waw
S3_BUCKET="your-bucket-name"
S3_ENDPOINT="https://s3.fr-par.scw.cloud" # Replace fr-par with your region
S3_ACCESS_KEY_ID="***"
S3_SECRET_ACCESS_KEY="***"

API Rate Limiting

The API is rate limited to protect the application against excessive use. Authenticated requests are counted per user, guest requests are counted per IP address. If you hit the limits, f.e. because of integrations that make a lot of API requests, you can increase them via the following environment variables. Note that the web app also uses the API and requests via the web app count towards the API Rate Limits. The rate limits are only enforced if APP_ENV is set to production.

API_RATE_LIMIT_AUTH_PER_MINUTE="200"
API_RATE_LIMIT_GUEST_PER_MINUTE="60"
Env variable nameDescription
API_RATE_LIMIT_AUTH_PER_MINUTENumber of API requests per minute that an authenticated user can make (default: 200)
API_RATE_LIMIT_GUEST_PER_MINUTENumber of API requests per minute that a guest can make, counted per IP address (default: 60)