LooonaDocslooona.com ↗

Self-host & build › Self-hosting › Server settings

Server settings

The environment variables a self-hosted Looona reads, and what it does without them.

A few settings live on the server, not in Settings. Looona reads them from its environment when it starts.

Where to set them

They go in the .env file, in Looona's folder, one per line. For example, on a server set up with the install guide:

  1. Open the file

    It already holds Looona's secret keys: leave their lines as they are.

    Terminal
    sudo nano /opt/looona/.env
    
  2. Add a line at the end

    One setting per line, with no spaces around =.

    File
    LOOONA_FORM_RATE_LIMIT=50
    
  3. Save and close

    Press Ctrl+O, then Enter, then Ctrl+X.

  4. Restart Looona

    It reads the file when it starts.

    Terminal
    sudo systemctl restart looona
    

On a Mac or Windows, the .env file is in Looona's folder too: open it with any text editor, then start Looona again.

They can also go in the service file, as Environment= lines under [Service]. LOOONA_DATA_DIR must go there: the .env file lives in that folder. See Run it as a service.

The settings

VariableWhat it doesWhen it's not set
LOOONA_DATA_DIRThe folder for the database, the backups, the logs and .env.The folder Looona starts in.
LOOONA_TRUST_PROXYtrue when a proxy stands in front. Looona reads each visitor's address from X-Forwarded-For, to count limits per visitor.Every visitor seems to come from the proxy.
LOOONA_CLIENT_IP_HEADERWith LOOONA_TRUST_PROXY, a header the proxy always writes itself, read in place of X-Forwarded-For. Behind Cloudflare: cf-connecting-ip.X-Forwarded-For is read.
LOOONA_FORM_RATE_LIMITHow many responses one visitor can send to one form, per 10 minutes. Uploads get twice as many.60.
LOOONA_FILE_QUOTA_MBHow many megabytes of files sent with responses Looona keeps, e.g. 2048. Past it, new files are refused, responses never. See Files and screenshots.No limit but the disk.
LOOONA_LOGS_MAX_ENTRIESHow many warnings and errors Server logs keeps. The oldest go first.10,000.
LOOONA_ALLOWED_ORIGINSOther sites whose pages may call Looona's API while signed in, separated by commas, e.g. https://app.example.com.Only Looona's own pages.
LOOONA_SERVICE_URLWhere Looona reaches the service that connects Slack, Discord, Jira, Linear, GitHub and GitLab.https://services.looona.fr.

Set LOOONA_TRUST_PROXY only when the proxy is the only way to reach Looona. Otherwise anyone can write their own address and get past the limits.

Hosted forms and the embed script work on any site without LOOONA_ALLOWED_ORIGINS. See Share or embed a form.

Secret keys

At the first start, Looona writes three keys in .env: LOOONA_ENCRYPTION_KEY, LOOONA_SECRET_ACCESS_KEY and LOOONA_ENCRYPTION_FILE_TOKEN_KEY. Keep them, and share them with no one.

If one is missing, Looona makes a new one at start. A new LOOONA_SECRET_ACCESS_KEY signs everyone out.

The LOOONA_WEBHOOK_ variables call your own server before or after each change. See Webhooks.