Skip to main content

Environment Setup

Environment variable reference for TMA Cloud.

Application Configuration

VariableRequiredDefaultDescription
NODE_ENVNodevelopmentEnvironment mode
BPORTNo3000Backend server port
BACKEND_URLYes (OnlyOffice)-Public backend URL

Database Configuration

VariableRequiredDefaultDescription
DB_HOSTNolocalhostPostgreSQL host
DB_PORTNo5432PostgreSQL port
DB_USERNopostgresDatabase username
DB_PASSWORDYes-Database password
DB_NAMENotma_cloud_storageDatabase name
DB_SSLMODENodisableSSL mode

Redis Configuration

VariableRequiredDefaultDescription
REDIS_HOSTNolocalhostRedis host
REDIS_PORTNo6379Redis port
REDIS_PASSWORDNo-Redis password (recommended)
REDIS_DBNo0Redis database number

Note: Redis is optional. App works without it but caching is disabled.

Authentication

VariableRequiredDefaultDescription
JWT_SECRETYes-Secret key for JWT tokens
SESSION_BINDINGNotrueEnable session binding (browser fingerprint)

Google OAuth (Optional)

VariableRequiredDescription
GOOGLE_CLIENT_IDNoGoogle OAuth Client ID
GOOGLE_CLIENT_SECRETNoGoogle OAuth Client Secret
GOOGLE_REDIRECT_URINoRedirect URI (must match Google Console)

Note: All three must be set to enable Google OAuth.

File Storage

VariableRequiredDefaultDescription
STORAGE_DRIVERNolocallocal or s3
UPLOAD_DIRNo./uploadsUpload directory (local only)
FILE_ENCRYPTION_KEYNo-Encryption key (see reference)

Note: Storage limits are configured per-user in Settings (admin only). For S3-compatible storage, see Environment Variables.

Logging Configuration

VariableRequiredDefaultDescription
LOG_LEVELNoinfo (prod), debug (dev)Log level (fatal, error, warn, info, debug, trace)
LOG_FORMATNojson (prod), pretty (dev)Log format (json, pretty)
METRICS_ALLOWED_IPSNo127.0.0.1,::1IPs allowed to access /metrics

Audit Logging Configuration

VariableRequiredDefaultDescription
AUDIT_WORKER_CONCURRENCYNo5Concurrent audit events processed
AUDIT_JOB_TTL_SECONDSNo82800 (23h)Job TTL (must be < 24h)

Frontend Environment Variables

No frontend environment variables required!

Single-Origin Architecture means frontend uses relative URLs and is served from the same origin as the backend.

Next Steps