fepli
Hostingenterprise

Configuration

fepli is configured with environment variables, and only with them. The same set goes to all three containers that run the image, the web, the worker and the cron.

Give the web, worker and cron containers exactly the same variables. The worker writes the e-mails and the cron sends the reminders: a worker with a different database or mail server than the web container sends the wrong mail, or none. An env file shared by all three, as in the examples, is the simplest way.

Required

Without these, fepli doesn't start, or starts with defaults that are wrong for you.

  • Name
    APP_SECRET
    Type
    string
    Description

    Signs sessions, login links and form tokens. The image carries a placeholder, so always set your own: openssl rand -hex 32. Changing it later signs everyone out and invalidates the links in e-mails already sent.

  • Name
    INTEGRATIONS_ENCRYPTION_KEY
    Type
    string
    Description

    Encrypts the credentials admins store in the admin, such as a payment provider's access data. Generate it once with openssl rand -base64 32 and never change it: credentials stored with the old key can't be read anymore.

  • Name
    DATABASE_URL
    Type
    URL
    Description

    The MariaDB database, e.g. mysql://fepli:secret@mariadb:3306/fepli. URL-encode special characters in the password (@ becomes %40).

  • Name
    DATABASE_SERVER_VERSION
    Type
    string
    Description

    The version of your MariaDB server, e.g. mariadb-12.3.0. It has to match the server you run, or the database layer generates SQL for the wrong version. The default is mariadb-11.2.4.

  • Name
    TRUSTED_HOSTS
    Type
    regex
    Description

    Every host fepli answers on, as one regular expression, e.g. ^(www\.)?ferienpass-musterstadt\.de$. With several tenants, join their hosts with |, and add the platform console. Empty means every host is accepted, which lets anyone forge the links in fepli's e-mails: never leave it empty in production.

  • Name
    APP_BASE_URL
    Type
    URL
    Description

    Scheme and fallback host for links the worker and the cron put into e-mails, e.g. https://ferienpass-musterstadt.de. The worker replaces the host with the domain of the tenant the e-mail is for, so on a multi-tenant installation any of your domains will do.

  • Name
    MAILER_DSN
    Type
    DSN
    Description

    The outgoing mail server, e.g. smtp://user:password@smtp.example.org:587. Use smtps:// for port 465. The image has no local mail server, so the default doesn't work.

  • Name
    ADMIN_EMAIL
    Type
    email
    Description

    The envelope sender of every e-mail, which is where bounces go, and the address of the CMS, e.g. ferienpass@musterstadt.de. Your mail server has to be allowed to send for its domain (SPF, DKIM). The default is fepli's own address. Each tenant sets the sender name and reply address its families see in its own admin.

Services

How fepli reaches Redis and, if you run it, Varnish. Redis is used for four things, each in a database index of its own. The values below assume the services are called redis and varnish, as in the examples.

VariableExampleWhat it is for
REDIS_URLredis://redis:6379/1the cache of the tenants' settings
LOCK_DSNredis://redis:6379/2locks, e.g. so two families can't book the last place at the same moment. The default, flock, only works within one container.
SESSION_DSNredis://redis:6379/3the sessions of everyone signed in. Required: fepli refuses to start a session without it.
MESSENGER_TRANSPORT_DSNredis://redis:6379/messagesthe queue of background jobs, read by the worker. The database index goes into the query string (?dbindex=0), not into the path.
VARNISH_HOSTvarnish:80where fepli sends purge requests when data changes. Set it empty to run without Varnish: fepli then sends none. The default is varnish:80, so leaving it out is not the same as setting it empty.
VARNISH_BASE_URLhttp://varnishthe base URL of those requests. This is the default. Without Varnish it doesn't matter.

Redis must keep its data on disk and must never evict keys: an evicted job is an e-mail that never goes out, an evicted session is someone signed out in the middle of an application. Start it with --appendonly yes --maxmemory-policy noeviction.

Multi-tenant installations

  • Name
    FERIENPASS_PLATFORM_HOST
    Type
    host
    Description

    The domain of the platform console, e.g. platform.ferienpass-musterland.de. Leave it unset on a single-tenant installation. Add the domain to TRUSTED_HOSTS as well.

Optional

Features that are off until you set their variable. Keys set here apply to every tenant; for several of them, admins can also store their own in the admin, per tenant, under Einstellungen → Integrationen. A key set here wins over the one in the admin.

VariableSwitches on
MAPBOX_TOKENmaps: the meeting point on an offer's page, the location picker in the admin
PMPAYMENT_AGS, PMPAYMENT_PROCEDURE, PMPAYMENT_SALTonline payment through pmPayment, with one account for the whole installation
BREVO_API_KEY, BREVO_DSNtext messages through Brevo
OPENAI_API_KEYthe AI features of the admin, such as generating offer images
DEEPL_API_KEYmachine translation through DeepL
CORS_ALLOW_ORIGINcalls to the REST API from other websites' browsers, as a regular expression of their origins. By default only localhost may.
STATUS_HEARTBEAT_URLan hourly request from the cron to this URL, for an uptime monitor that raises an alarm when the cron stops
SENTRY_DSNerror reports to your own Sentry. The image reports to fepli's Sentry project by default; set this to your own DSN, or set it empty to send no reports at all.

Tuning

VariableDefaultWhat it does
FRANKENPHP_MAX_THREADS6how many requests one web container handles at the same time. Each can take up to 512 MB of memory.
PORT80the port the web container listens on
MIGRATE_ON_START1whether the web container migrates the database when it starts. Set 0 to run app:migrate yourself.
RELYING_PARTY_NAMEFerienpassthe name browsers show when an admin creates a passkey

Set by the image

Leave these as the image sets them. They select how the image boots, and fepli's own hosting uses other values:

  • APP_ENV=prod and APP_DEBUG=0. Debug mode shows internals to every visitor.
  • APP_ID, APP_SHARED_BUILD and APP_IS_SINGLE_TENANT.

The worker gets one variable more than the others: IS_WORKER=1.

A complete example

fepli.env

# openssl rand -hex 32
APP_SECRET=9f1c…
# openssl rand -base64 32, and never change it
INTEGRATIONS_ENCRYPTION_KEY=Qm3v…

DATABASE_URL=mysql://fepli:secret@mariadb:3306/fepli
DATABASE_SERVER_VERSION=mariadb-12.3.0

REDIS_URL=redis://redis:6379/1
LOCK_DSN=redis://redis:6379/2
SESSION_DSN=redis://redis:6379/3
MESSENGER_TRANSPORT_DSN=redis://redis:6379/messages

# With Varnish. Without it: VARNISH_HOST=
VARNISH_HOST=varnish:80
VARNISH_BASE_URL=http://varnish

TRUSTED_HOSTS='^(www\.)?ferienpass-musterstadt\.de$'
APP_BASE_URL=https://ferienpass-musterstadt.de

MAILER_DSN=smtp://ferienpass%40musterstadt.de:secret@smtp.musterstadt.de:587
ADMIN_EMAIL=ferienpass@musterstadt.de

SENTRY_DSN=

Docker Compose reads such a file with env_file:. Put regular expressions in single quotes, so that Compose leaves the $ and the backslashes in them alone. The file holds the secrets: make it readable only for yourself (chmod 600).

Was this page helpful?