Environment Variables
Default environment variables:
Database
Variable | Description | Example |
---|---|---|
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 |
DB_USER | Your mongodb database username. | admin |
DB_PASSWORD | Your mongodb password. Generate a secure one using a tool like 1password. |
Security
Variable | Description | Example |
---|---|---|
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), | * |
Link Creation
Variable | Description | Example |
---|---|---|
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 | false |
Umami
Lynx comes with full support for Umami, both standard tracking and events.
Variable | Description | Example |
---|---|---|
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
Variable | Description | Example |
---|---|---|
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
Variable | Description | Example |
---|---|---|
NODE_ENV | What node environment to use, use | 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 |
|
Last updated