Environment Variables

Docker Compose

VariableDescriptionDefault
AFFINE_REVISIONThe AFFiNE revision to deploy, available values: stable, beta, canarystable
DB_DATA_LOCATIONposition of the Postgres data to persist
UPLOAD_LOCATIONposition of the uploaded blobs(images, files, etc.) to persist
CONFIG_LOCATIONposition of user custom configuration files to persist

Server

VariableDescriptionDefault
AFFINE_PRIVATE_KEYThe private key for used by the crypto module to create signed tokens or encrypt data. If not provided, AFFiNE will autogenerated one under CONFIG_LOCATION at first start.
AFFINE_SERVER_HTTPSWhether the server is hosted on a ssl enabled domainfalse
AFFINE_SERVER_HOSTWhere the server get deployed(FQDN)localhost
AFFINE_SERVER_PORTWhich port the server will listen on(in container)3010
AFFINE_SERVER_SUB_PATHSubpath where the server get deployed, if there is
AFFINE_SERVER_EXTERNAL_URLBase url of AFFiNE server, used for generating external urls.
Default to be [server.protocol]://[server.host][:server.port] if not specified.

Database(Postgres)

VariableDescriptionDefault
DATABASE_URLDatabase URL passed to server if you are not using docker compose.
DB_USERNAMEdatabase useraffine
DB_PASSWORDdatabase password
For docker compose users, you must set a password to initialize the Postgres, otherwise, set POSTGRES_HOST_AUTH_METHOD=trust to tell Postgres stop compaining about weak safety.
DB_DATABASEdatabase nameaffine

Redis

VariableDescriptionDefault
REDIS_SERVER_HOSTredis hostlocalhost
REDIS_SERVER_PORTredis port6379
REDIS_SERVER_USERNAMEredis username
REDIS_SERVER_PASSWORDredis password
REDIS_SERVER_DATABASEThe database index of redis server to be used. if n set as REDIS_SERVER_DATABASE, AFFiNE will use database from n to n+4 for different purpose.0

Email

VariableDescriptionDefault
MAILER_HOSTHost of the email server (e.g. smtp.gmail.com)
MAILER_PORTPort of the email server (they commonly are 25, 465 or 587)465
MAILER_USERUsername used to authenticate the email server
MAILER_PASSWORDPassword used to authenticate the email server
MAILER_SENDERSender of all the emails (e.g. "AFFiNE Team <[email protected]>")
MAILER_IGNORE_TLSWhether ignore email server's TSL certification verification. Enable it for self-signed certificates