Environment Variables

Default environment variables:

Database

VariableDescriptionExample

DB_HOST

The address of your mongodb database.

127.0.0.1

DB_PORT

The port of your mongodb database. When using docker set this to 27017.

27017

DB_USER

Your mongodb database username.

admin

DB_PASSWORD

Your mongodb password. Generate a secure one using a tool like 1password.

Security

VariableDescriptionExample

JWT_KEY

The key used to verify and sign login-sessions. Use a site like 1password to generate a 32 character password.

USE_HTTPS

If your Lynx installation will be at https://mydomain.com - this does not provide an SSL certificate, it only changes how cookies are handled.

true

CORS

Your allowed CORS origin(s), * for any (default).

*

VariableDescriptionExample

URL_LENGTH

The length of your automatically generated slugs.

8

URL_SET

The type of characters your automatically generated slug will use.

standard

URL_ONLY_UNIQUE

Wether each new url has to be unique, e.g. if a link already redirects to https://example.com new links created cannot link to the same destination.

false

Umami

Lynx comes with full support for Umami, both standard tracking and events.

VariableDescriptionExample

UMAMI_SITEID

Your umami site ID, blank to disable.

224d86da-1209-4b8b-ad98-b24d300efa55

UMAMI_URL

The URL to your umami instance.

For Umami to track links being used, FORCE_FRONTEND_REDIRECT will need to be set to true. This may slightly increase redirect times.

Backups

VariableDescriptionExample

BACKUP

Wether to create backups or not. They will be in ./backups or /app/backups for Docker

true

BACKUP_SCHEDULE

When to create backups. Use crontab.guru to create

0 * * * *

BACKUP_COUNT

How many backups to keep. 1 will make a backup file called backup.json, -1 will keep every backup.

5

Other

VariableDescriptionExample

NODE_ENV

What node environment to use, use production for any production use and/or when using in docker.

production

FORCE_FRONTEND_REDIRECT

Use the frontend to redirect instead of express, useful for hiding embeds on discord for all your rickrolling needs

false

ENABLE_REGISTRATION

Whether or not to allow registration. If not accounts exist you will be allowed to register either way. This first account will also be an admin account.

false

DOMAIN

Your Lynx installation domain

DEMO

Whether or not to enable the demo mode. In this mode features will be limited and links will be deleted after 10 minutes.

false

EXPRESS_PORT

The port to use internally for the backend.

3000

URL_REGEX

The URL_REGEX to use, I recommend using a custom one, like in the example (which adds support for twitter://user?screen_name=jackba_ links).

https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)|twitter:\/\/user\?screen_name=[a-zA-Z0-9_]+

Last updated