Configuration

There are few ways to configure your AFFiNE.

Admin Panel

In Admin Panel (<your-affine.domain>/admin/settings), you will be provided a GUI to a available configuration, and each of them is well documented.

NOTE

Any configuration modified in Admin Panel will take effect immediately after they got saved. No restart.

Config File

Baside the Admin Panel, we also provide a way to import your configuration through command line. In case you lost the access to Admin Panel, but you still have the right to access your host(docke container), this is the approach to be taken.

1. Create a JSON config file

JSON Schema

If you are editing the config JSON file in editor like vscode, which has intergrated JSON lsp, you will have fully commented fields to help to write the config file correctly.

config.json
{
  "$schema": "https://github.com/toeverything/affine/releases/latest/download/config.schema.json",
  "server": {
    "name": "My Magical AFFiNE Server"
  }
}

qZVdyOauJB7FfP4wwzsq2aiJIfc7zkEhlTRElNe28hU=

2. Put the config file to your host

For those who follow the official Docker Compose setup, you can simple put this config file to {CONFIG_LOCATION}/config.json. Now restart your deployment by docke compose up -d and the config file will be applied automatically.


Users who deploy in customized way, you might need to ftp or mount this config file to your instance and go forward

3. Optional - Import the config

ssh into your host and execute the following command at the directory

# make sure you are at the directory of affine compiled assets
# pwd => it should output something like `/root/app`
node --import ./scripts/register.js ./dist/data/index.js import-config ./path/to/config.json

Now, restart your instance after importing to let the config file take effect.