# environment variables
# this file is used for development on localhost
# this file is loaded by module @nestjs/config


# ----- protocol: HTTP/HTTPS
# for HTTPS key + certificate must be saved in /etc/node/ssl/live/<domain>/
X_PROTOCOL=HTTP

# ----- domain (e.g. car-demo.chilibase.org) - used for access to ssl certificate, used only if X_PROTOCOL=HTTPS
#X_DOMAIN=

# ----- port for backend nodejs
X_PORT=8081
# env variable PORT is used e.g. on heroku (app will process the value [process.env.PORT])
#X_PORT=[process.env.PORT]

# ----- authentication type - options (only AUTH0 works at this moment):
# OFF - authentication turned off
# LOCAL - standard Username-Password authentication, username/password are saved in DB in table x_user (password is encrypted)
# AUTH0 - authentication using auth0.com (field x_user.password is not used)
# MS_ENTRA_ID - authentication using Microsoft Entra ID (former Microsoft Azure AD)  (field x_user.password is not used)
X_AUTH=LOCAL

# secret for creating/decrypting jwt access token by local authentication
# keep this value confident, for better security use storage like AWS Secrets Manager, Azure Key Vault, or HashiCorp Vault
X_AUTH_LOCAL_JWT_SECRET=***change-me***

# ----- settings for AUTH0 authentication
# auth0 domain (tenant in auth0, e.g. car-demo.eu.auth0.com)
#X_AUTH0_DOMAIN=
# auth0 - backend API Audience (id of backend API)
# remark: backend API has its representation in auth0 dashboard (in menu item Applications -> APIs) and audience is id of this representation
# (audience does not have to be url, it's just id, e.g. car-demo-backend-api)
#X_AUTH0_AUDIENCE=

# ----- settings for MS_ENTRA_ID authentication
#X_MS_ENTRA_ID_TENANT_ID=
# backend API Audience - client id of the backend API application (it's not the client id of the frontend application!)
#X_MS_ENTRA_ID_AUDIENCE=

# ----- database url
X_DATABASE_URL=postgres://postgres:<password>@localhost:5432/{{dbName}}?schema={{schemaName}}

# ----- if true, search for user filter (filter in *Browse.tsx) will be accent insensitive (AI) and case insensitive (CI)
# works only for postgres (for mysql must be false, AI/CI can be achieved by using proprietary default collation, e.g. utf8mb4_0900_ai_ci)
X_STRING_DB_SEARCH_AI_CI=true

# ----- log sql to console (true for development, false for production)
X_LOG_SQL=true

# ----- default time zone
# Time in DB is saved without timezone. If TZ is not set, then - during reading time from DB - the time is interpreted as Z-time (zero London time)
# and as a result uncorrect time is showed in forms of application
TZ=Europe/Bratislava
