Documentation for collab-auth
Enviornment Variables

Program Configuration

The program configuration variables are assigned default values in the JavaScript file "server/config/index.js". Changes to configuration may be done by editing the file or using UNIX environment variables to override the defaults. Most of the variable names are self explanatory. Further explanation may be available in the Deployment tab. The program uses npm dotenv so a ".env" file located in the repository base folder is supported. If a .env file use used, remove public file permissions to protect credentials stored in the file.

Boolean values should be a string value, entered as:

SERVER_TLS=true
Enviornment VariableDefaultComment
SITE_VHOST*Disabled = *
SITE_AUTH_URLhttp://127.0.0.1:3500
SITE_OWN_HOST127.0.0.1:3500
SITE_SECURITY_CONTACTsecurity@example.comDisabled unless set
SITE_SECURITY_EXPIRES"Fri, 1 Apr 2022 08:00:00 -0600"Disabled unless set
SERVER_TLS_KEY../../data/token-certs/privatekey.pem
SERVER_TLS_CERT../../data/token-certs/certificate.pem
SERVER_TLSfalse
SERVER_PORT3500
SERVER_LOG_ROTATE_INTERVALExamples: 5m, 2h, 7d
SERVER_LOG_ROTATE_SIZEExamples: 100K, 1M
SERVER_LOG_FILTERValues: "error"
SERVER_PID_FILENAMEDisabled unless set
SESSION_SET_ROLLING_COOKIEfalse
SESSION_EXPIRE_SEC3600(1 hour)
SESSION_PRUNE_INTERVAL_SEC3600(1 hour)
SESSION_SECRETA Secret That Should Be Changed
SESSION_ENABLE_POSTGRESfalse
DATABASE_ENABLE_POSTGRESfalse
DATABASE_DISABLE_WEB_ADMIN_PANELfalse
LIMITS_PASSWORD_RATE_LIMIT_COUNT10Includes successful
LIMITS_PASSWORD_RATE_LIMIT_MS3600000
LIMITS_TOKEN_RATE_LIMIT_COUNT1000Includes successful
LIMITS_TOKEN_RATE_LIMIT_MS3600000
LIMITS_WEB_RATE_LIMIT_COUNT1000Includes successful
LIMITS_WEB_RATE_LIMIT_MS3600000
OAUTH_CLIENT_SECRET_AES_KEYA Secret That Should Be Changed
OAUTH2_DISABLE_TOKEN_GRANTfalse
OAUTH2_DISABLE_CODE_GRANTfalse
OAUTH2_DISABLE_CLIENT_GRANTfalse
OAUTH2_DISABLE_PASSWORD_GRANTfalse
OAUTH2_DISABLE_REFRESH_TOKEN_GRANTfalse
OAUTH2_EDITOR_SHOW_CLIENT_SECRETfalse
OAUTH2_AUTH_CODE_EXPIRES_IN_SECONDS10
OAUTH2_TOKEN_EXPIRES_IN_SECONDS86400(24 hours)
OAUTH2_REFRESH_TOKEN_EXPIRES_IN_SECONDS2592000(30 days)
OAUTH2_CLIENT_TOKEN_EXPIRES_IN_SECONDS86400(24 hours)
PostgreSQL

The PostgreSQL client, npm package pg, will use these enviornment variables directly. They may be entered into a .env or assigned before the program is started. You may refer to the npm pg package documentation for more info.

Enviornment VariableComment
PGUSER
PGPASSWORD
PGHOSTADDR
PGPORT
PGDATABASEUse: "collabauth"
PGSSLMODE
Debug Variables

The following enviornment variables are not supported in the .env file. They may be prepended to the command line when starting the program during debugging.

Enviornment VariableComment
NODE_ENV"production" or "development"
NODE_DEBUG_LOGUse: NODE_DEBUG_LOG=1 to view logs in terminal