Skip to content

Installation

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

Notifo is provided as container image and can be installed in kubernetes, docker, docker-swarm and every platform that supports containers.

Requirements

Strict Requirements

Notifo has the following requirements:

MongoDb

At the moment only MongoDB is supported as a database. For high available requirements it is recommended to setup a replica set with at least 3 members or to use Mongo Atlas.

You can configure the connection string with:

  1. STORAGE__MONGODB__CONNECTIONSTRING=mongodb://localhost (Remember the two underscores).

If you want to have support for another database, you can create an issue in Github.

Https

Chrome and Google has increased the requirements in the last year. Some redirects are only possible for https websites. Therefore notifo needs a valid https certificate. The docker-compose setup uses caddy and lets encrypt to configure the SSL certificate automatically and free of charge.

Additional Requirements

Sticky Sessions

Notifo provides a web plugin that is connected with SignalR to the web server. It is a framework from Microsoft for realtime applications, that provides several communication methods.

For the initial handshake SignalR needs sticky sessions: https://docs.microsoft.com/en-us/aspnet/core/signalr/scale. You can turn off sticky sessions (which is the default), then the web plugin can only use web sockets and will fail to connect, when the browser does not support it.

Use the following setting to turn on sticky sessions:

  1. WEB__SIGNALR__STICKY=true (Remember the two underscores).

Redis

For scale out scenarios (you have more than one notifo instance) you need a backplane for SignalR. This backplane is used to establish a communication between your instances. For example when you have two nodes (node1 and node2). The user is connected to node1, but the notification is received from node2. Then node2 has to send the notification to node1, which then sends it to browser of the user.

You can configure the connection string to your redis instance with:

  1. CLUSTERING__MODE=redis (Remember the two underscores)
  2. CLUSTERING__REDIS__CONNECTIONSTRING=localhost

If you do not want to use Redis, you can turn off SignalR. Then the web plugin uses polling to get the updates from the server. It creates more load, but it is easier to scale. You can just ignore this setting.

You can turn off SignalR with:

  1. WEB__SIGNALR__ENABLED=false

Messaging

Notifo uses a lot of queues to distribute the load. Therefore a messaging solution is needed.

You can configure the messaging solution with these app settings: https://github.com/notifo-io/notifo/blob/main/backend/src/Notifo/appsettings.json#L70

If you want to have support for another messaging solution, you can create an issue in Github.

Installation

Notifo is built as container image. How you install it, depends on your environment. In the following section we explain the installation with docker-compose, but it is very similar for kubernetes, azure container services and so on.

Other platforms

But notifo is just a console app built on top of ASP.NET Core and can run on all operation systems. If you do not use containers, you can read the official hosting guides from Microsoft: https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/

Containers

For containers you have to execute the following steps:

  1. Configure the system with environment variables (see the previous section or the article about configuration). The only relevant setting is the URLS__BASEURL environment variable which must point to the URL under which your Notifo instance is available. For example https://app.notifo.io for the demo instance.
  2. Configure volume mounts, e.g. for the app storage.
  3. Use the image: notifo/notifo:1. Ensure that you specify at least a major version. If you use the latest tag it can happen that your instance is updated automatically to the next major version, when a restart happens or a new node is added to your cluster.

We provide a two docker-compose files under the following URL:

https://github.com/notifo-io/notifo/tree/main/deployment/docker-compose

  • docker-compose.yml installs notifo, MongoDB and caddy. Caddy is used as reverse proxy and also handles https. In this case you do not need another reverse proxy and you just need a DNS record to your server.
  • docker-compose-noproxy.yml installs notifo and MongoDB, but no reverse proxy. This setup is useful if your hosting provider already has a solution in place or if you have a reverse proxy configured and ready to be used. You can also use cloudflare for https termination. In this case you do not get https from end-to-end, but this might be acceptable for you.