Node Engine — Configuration
The engine reads its configuration from .env in its install directory. Only
LICENSE is required; everything else has a working default.
Settings
| Key | Default | What it does |
|---|---|---|
LICENSE |
required | The server’s licence key, bound to its IP address. Written on first run. |
LF_DIR |
working directory | Where locally-stored encrypted builds are kept, as lfapp-<project>_<env>.lfb. |
LF_FORWARD_MAX_BODY |
— | Ceiling on a forwarded request body. Exceeding it returns 413. |
LF_RESPONSE_GUARD_MS |
— | How long a dispatched request may run before the guard fires. |
fs reads of the engine’s own
.env always return ENOENT, so the licence is not
reachable from application code.
Your application’s own .env
Separate, and easy to confuse with the above. Your application’s .env travels
inside the encrypted artifact. The runtime parses it and injects the values before your code runs, so
require('dotenv').config() and require('dotenv/config')
both work and return what you expect — they just do not read from disk.
Applications get a deliberately small OS baseline — NODE_ENV,
PATH, HOME, TZ,
LANG, LC_ALL, TMPDIR
— plus their own values on top. The engine’s environment is never passed through, so no licence or
platform credential can leak into an application.
NODE_ENV defaults to production if you do not set it.
The shared package set
Bare require() calls resolve against node_modules in the
engine’s directory, shared by every application on the host. Install there and restart to add a dependency
fleet-wide — see
Node runtime limitations for the
trade-off against bundling.
Ports
The Node engine listens on 3000 and expects a web server in front of it on port 80. That is fixed — change the proxy target in nginx rather than the engine.
Applying changes
sudo systemctl restart lf-engine # or, under PM2: sudo env "PATH=$PATH" pm2 restart lockflare