Skip to content

Configuration

Sebastian Stehle edited this page Jan 15, 2022 · 5 revisions

Configuration model

We use the ASP.NET Core Configuration model for all settings.

You can configure notifo using the following ways:

  1. The appsettings.json file.
  2. The appsettings.Production.json file.
  3. Environment variables.
  4. Command line arguments.

The ordering is important. Command line arguments override other settings, environment variables override the json files and so on. Using a combination of all these options can be very helpful.

Read the comments of the appsettings.json file to understand all configuration settings.

In this example we want to override the following setting from the configuration file:

{
  "assetStore": {
    "folder": {
      "path": "MyAssets"
    }
  }
}

If you combine all keys from the json root to the setting you get the full key of this setting.

Aggregate the keys by two underscores to get the name of the environment variable:

ASSETSTORE__FOLDER__PATH="MyAssets"

Aggregate the keys by colon and you get the name of the command line argument

assetstore:folder:path="MyAssets"

Casing does not matter.

Important Configuration

We assume that you use environment variables to store the settings. Therefore we use the notation with the two underscores.

Settings

These are the most important settings:

  • URLS__BASEURL: The base URL under which notifo is running. It is used to generate hyperlinks and to make redirects with the correct host name. In some environments, notifo is running behind several proxies, e.g. cloudflare, google load balancer and so on. In these cases the original host name might get lost. Therefore we introduced this configuration value.
  • IDENTITY__ADMINEMAIL: The email address of the admin user. You can also set the admin email with the initial setup screen.
  • IDENTITY__ADMINPASWORD: The password of the admin user (Must contain lowercase, uppercase letter, number and special character). You can also set the admin password with the initial setup screen.

Set

  • IDENTITY__GOOGLECLIENT
  • IDENTITY__GITHUBCLIENT
  • IDENTITY__MICROSOFTCLIENT

to empty to disable authentication with third party providers.

Health Checks

Many systems support health checks to determinate the health of a service. For example load balancers periodically call an endpoint of the service to remove dead nodes from the list of available nodes and to stop serving HTTP requests to these nodes.

Notifo provides the following health checks:

  • /healthz (e.g. https://app.notifo.io/healthz): An endpoint to check if notifo can serve HTTP requests. Recommended health check for liveness, startup and readiness probes.

Troubleshooting

Please check the logs to see detailed error messages.

Login screen shows 'Operation failed' message.

Typically the login fails, because the URLS__BASEURL setting has an invalid value. Ensure that the domain that is used by your users is configured here. notifo might run behind several other servers like Cloudflare, load balancers and reverse proxies and does not know the original domain. Therefore we must configure the URL.

I see the login screen but I cannot login.

Ensure that you have configured a strong password if you use IDENTITY__ADMINPASSWORD.

You will see the following entry in your logs:

{
  "logLevel": "Error",
  "action": "createAdmin",
  "status": "failed",
  "exception": {
    ...
    "message": "Cannot create user:...",
    ...
  }
}`

The password requirements are:

  1. Passwords must be at least 6 characters.
  2. Passwords must have at least one non alphanumeric character.
  3. Passwords must have at least one digit ('0'-'9').
  4. Passwords must have at least one lowercase ('a'-'z').

In case you have forgotten your admin password you can use the following environment variable to update the admin account with the password from the configuration with each start of a notifo instance:

IDENTITY__ADMINRECREATE=true

Clone this wiki locally