ForgeDocumentation
en

Documentation

Configuration keys of Total.js 5

Total.js 5 · total5@0.0.19 referenceconfigsettings Executed against Total.js 5

The config file holds one key : value setting per line and the values are available in the global CONF object (see the configuration recipe for the file format). The keys below are defined by total5 0.0.19 with these defaults; a key that is not here and not in the second table is yours. Keys that start with $ are settings of the framework and secret_ keys hold secrets.

Set application values in the config file and read them through CONF. The table gives the defaults and the purpose of each setting.

KeyDefaultNote
name'Total.js'The name of the application. In a view, @{'%name'} prints it.
version'1.0.0'Application version used in startup output, statistics and the default HTTP ETag suffix (index.js).
author''Application author displayed by startup imprint when nonempty (index.js).
secretF.syshashSet the application secret explicitly in configuration.
secret_encryption''Key read by encrypted WebSocket routes; this is distinct from an action encrypt metadata option (websocket.js).
secret_totalapi''Fallback token sent by the built-in TotalAPI driver (api.js); keep server-side.
secret_csrf''The secret of the CSRF tokens. Empty: the check always passes.
secret_tms''The token that TMS clients must send in the header x-token.
$root''URL prefix applied to route and asset paths; also adjusts the default API endpoint (routing.js, index.js).
$cors''Hostnames separated by comma.
$api'/api/'A default API endpoint.
$sourcemaptrueLoader metadata setting; LOAD sets it from the final DEBUG mode or disables it for selective resource loads (index.js).
$httpreqlimit0Request limit per ip.
$httpcompresstrueEnables negotiated gzip for eligible responses; the dynamic response path checks a 256-byte threshold (controller.js).
$httpetag''Suffix for framework-generated ETags; when empty, configuration derives it from the app version (index.js, controller.js).
$httpmaxsize256KB.
$httprangebuffer51205 MB.
$httptimeout55 seconds.
$httpfilesan objectThe file extensions that are served as static files, as an object { extension: true }.
$httpchecktypestrueFor multipart data only.
$httpmaxage60In seconds.
$httpmaxkeys33Maximum parsed query-string key count (utils.js); not a JSON-body field limit.
$httpmaxkey25Maximum query-string key length used by the query parser (utils.js).
$httpcacheoffset''E.g. 1 minute.
$blacklist''HTTP/WebSocket request handling tests whether the configured value contains the client IP (http.js, websocket.js). Not a CIDR parser.
$xpoweredby'Total.js'Value of the generated X-Powered-By response header; empty suppresses it in the inspected response paths (controller.js).
$minifyjstrueMinify the JavaScript files that are served.
$minifycsstrueMinify the CSS files that are served.
$minifyhtmltrueMinify the HTML that is sent.
$port'auto'HTTP listen port; auto is resolved at startup, and Total.run options can override it (index.js).
$ip'0.0.0.0'HTTP listen address; Total.run options can override it (index.js).
$unixsocket''Alternative Unix socket listen path (index.js). Socket permissions and reverse proxy setup are deployment concerns.
$timezone'utc'The time zone of the process (it is set in process.env.TZ).
$insecurefalseConfiguration sets the process TLS verification environment from this flag (index.js). Keep false for authenticated TLS connections.
$performancefalseAdjusts HTTP agent maximum sockets and socket tuning (index.js); it is not evidence of an application speedup.
$filtererrorstrueSuppresses matching runtime error patterns in the framework error logger (index.js).
$cleartemptrueControls startup removal of selected generated/temp file extensions by the clear routine (index.js).
$customtitlesfalseWhen false, the view metadata generator appends the application name to a non-home page title (viewengine.js).
$clearcache10Service-counter interval for resetting internal lookup/view/template/query-builder caches (index.js). Not a database deletion schedule.
$imageconverter'gm'The program that Image calls: gm, im or magick.
$imagememory0Disabled because e.g. GM v1.3.32 throws some error about the memory.
$statstrueControls statistics output/update branch; selective LOAD can disable it (index.js).
$npmcache'/var/www/.npm'Npm cache location passed by NPMINSTALL for the uid-33 execution branch (index.js).
$python'python3'Interpreter command used by Python execution and pip helpers (index.js); install Python separately.
$wsmaxsize256KB.
$wscompresstrueEnables negotiation of WebSocket permessage-deflate on server connections (websocket.js).
$wsencodedecodefalseInitial WebSocket server encode/decode setting (websocket.js); verify required wire format before changing it.
$wsmaxlatency2000Ping-latency threshold in milliseconds used by WebSocket connection checks (websocket.js).
$proxytimeout55 seconds.
$cookiesamesite'Lax'Default SameSite cookie policy when a cookie does not specify one (controller.js).
$cookiesecurefalseDefault Secure cookie attribute when no per-cookie override is supplied (controller.js).
$csrfexpiration'30 minutes'How long a CSRF token is valid.
$tapitrueEnables the built-in TotalAPI service driver; the special check operation bypasses this local gate (api.js).
$tapiurl'eu'Regional hostname prefix used by the TotalAPI driver (api.js).
$tapimailfalseSelects the TotalAPI mail path when the TotalAPI feature is enabled (mail.js).
$tapiloggerfalseEnables the TotalAPI logger path when service access and its secret are configured (index.js).
$imprinttrueEnables the startup banner (index.js).
$tmsfalseTurns on the TMS WebSocket endpoint.
$tmsmaxsize256The maximum size of a TMS message, in kB.
$tmsurl'/$tms/'The URL of the TMS endpoint.
$tmsclearblocked60In minutes.
$total5set at startThe folder of the total5 package (the framework reads its own files from it).
$nodemodulesset at startThe folder where NPMINSTALL() installs packages.
secret_uidset at startSecret input used by the short encrypted-identifier utility; initialized from the system hash (index.js, utils.js).
$cryptoivset at startInitialization-vector buffer used by framework encryption helpers; initialized at startup (index.js, utils.js).
$httpexpireset at startFuture UTC HTTP expiry date initialized and periodically refreshed by the framework (index.js, controller.js).

These keys have no default. They configure the email sending and are used by MAIL() and HTMLMAIL() (see the email recipe):

KeyMeaning
mail_smtpThe address of the SMTP server.
mail_smtp_optionsAn object with the rest of the connection settings: port, user, password, secure...
mail_fromThe address of the sender.
mail_from_nameThe name of the sender.
mail_replyThe address that gets the replies, added to every message.
mail_ccA copy address, added to every message.
mail_bccA hidden copy address, added to every message.
controllers/config.js
exports.install = function() {
	ROUTE('GET /config/', config);
};

function config($) {
	$.json({ conf: CONF });
}