Note Mark
  • Support The Project
  • 02 - Configuration

    Configuration of the backend is done through environment variables. See the below options:

    KeyDescriptionDefaultDocker Default
    BIND__HOSTWhat ip to listen on127.0.0.10.0.0.0
    BIND__PORTPort to bind to80008000
    DB__TYPEType of DB (sqlite or postgres)sqlite
    DB__URIURI (or file path if using SQLite)/data/db.sqlite
    JWT_SECRETbase64 encoded secret
    TOKEN_EXPIRYseconds until a token expires259200259200
    DATA_PATHWhere to store app data/data
    STATIC_PATHHost static files
    CORS_ORIGINSComma separated values of allowed origins
    ALLOW_SIGNUPWhether to enable new accountstruetrue
    NOTE_SIZE_LIMITMax file size for note1M1M
    ASSET_SIZE_LIMITMax file size for uploaded assets12M12M

    TIP A secret can be generated using: openssl rand -base64 32

    Database URI

    These have been copied from the ORM docs, more info found on gorm.io.

    sqlite:

    /path/to/db.sqlite
    

    postgres:

    host=localhost user=user password=pass dbname=notemark port=5432 sslmode=disable TimeZone=Europe/London
    

    CORS

    For most people this should be set to your front-end URL. For example if you access your front-end via https://example.com:8000 then you should enter that. You can also set the config to allow all origins via *, multiple origins can also be specified by providing a comma separated values. Learn more about CORS on Wikipedia.