Docs
Config Options

Config Options

Config Files

Environment Variables are used for all settings within the Collections project.

.env

Collections attempts to read the .env file setting as an environment Variable. It has the following structure.

DB_CLIENT="sqlite3"
DB_FILENAME="./data.db"

General

VariableDescriptionDefault Value
PUBLIC_SERVER_URLExpress Server URLhttp://localhost:4000
SERVER_HOSTExpress Server Hosthttp://localhost
SERVER_PORTApp Server Port4000
ADMIN_PORTApp Admin Port4001

Storage

VariableDescriptionDefault Value
STORAGE_DRIVERDriver name of destination storage(local, aws-s3)local
STORAGE_LOCAL_ROOTLocal storage destination directoryuploads
STORAGE_KEYCloud Storage Access Key--
STORAGE_SECRETCloud Storage Secrets--
STORAGE_BUCKETCloud Storage Bucket--
STORAGE_REGIONCloud Storage Region--

Database

VariableDescriptionDefault Value
DB_CLIENTDatabase Client--
DB_FILENAMEPath to Database file(SQLite)--
DB_USERDatabase Database User Information--
DB_PASSWORDDatabase Password--
DB_DATABASEDatabase Database name--
DB_HOSTDatabase Host--
DB_PORTDatabase POrt--
DB_SSLDatabase SSL(PostgreSQL / true, false)--

Express

VariableDescriptionDefault Value
REQ_LIMITMaximum size of request body4mb

Hash

VariableDescriptionDefault Value
HASH_MEMORY_COSTSpecifies the amount of memory used to generate the hash in KiB.4096 (4 MiB)
HASH_HASH_LENGTHSpecifies the length of the hash function output in bytes.32
HASH_TIME_COSTThe number of passes (iterations) used by the hash function. The hash strength can be increased at the expense of the time required for the computation.3
HASH_PARALLELISMNumber of threads to compute hashes. Each thread has a memory pool of size HASH_MEMORY_COST.1 (single thread)
HASH_TYPEType of hash function (0: argon2d, 1: argon2i, or 2: argon2id).2 (argon2id)
HASH_ASSOCIATED_DATAAdditional optional non-confidential value. This value is included in the parameter portion of the digest in Base64 encoded form.--

Session

VariableDescriptionDefault Value
ACCESS_TOKEN_TTLThe validity period of the access token.15m
REFRESH_TOKEN_TTLRefresh token validity period; must be longer than ACCESS_TOKEN_TTL.24h

Cookie

VariableDescriptionDefault Value
COOKIE_SECUREAttribute value for sending cookies; if true, they are sent only when an HTTPS request is made.false
COOKIE_SAME_SITEYou can control the sending of cookies during site-to-site requests. (lax, strict, none)lax
COOKIE_DOMAINSpecify hosts that can receive cookies.--
COOKIE_PREFIXSpecifies the cookie name prefix.collections

Security

VariableDescriptionDefault Value
SECRETPrivate key for JWT token generationrandom

CORS

VariableDescriptionDefault Value
CORS_ENABLEDSet to true to enable the entire CORS configuration.false
CORS_ORIGINAccess-Control-Allow-Origin Can be specified as a string or regular expression. You can specify false to disable CORS.false
CORS_METHODSAccess-Control-Allow-Methods Pass a comma-separated string of methods to allow.GET,POST,PATCH,DELETE
CORS_ALLOWED_HEADERSAccess-Control-Allow-Headers If not specified, reflects the headers specified in the Access-Control-Request-Headers header of the request.Content-Type,Authorization
CORS_EXPOSED_HEADERSAccess-Control-Expose-Headers If not specified, custom headers are not exposed.Content-Range
CORS_CREDENTIALSAccess-Control-Allow-Credentials Set to true to enable.true
CORS_MAX_AGESpecify an integer value when passing the Access-Control-Max-Age header.1800

Log

VariableDescriptionDefault Value
PUBLIC_LOG_LEVELLog output level (fatal, error, warn, info, debug, trace, silent)info
PUBLIC_LOG_HIDE_OBJECTDon't display detailed request/response information output by pinotrue

Email

VariableDescriptionDefault Value
EMAIL_TRANSPORTEmail Sending Providersendgrid
EMAIL_FROMEmail Source Email Address--
EMAIL_SENDGRID_API_KEYAPI key for sendgrid--