stolod contains the API and the watcher logic for Stolos.
The API contains the Authentication mechanism of Stolos, as well as the needed API endpoints for managing projects.
Before creating Users and Stacks for Stolos, the following things need to happen in the Admin:
- A Company account should be created in the form of a Group
- The Group should be given rights to:
- view, add, change and delete Projects
- view Stacks
- view, add and delete public keys
- Every user created should be added to it's company's group
Watch Docker daemon for events and update ceryx accordingly
stolos-watchd understands projects and services in the same way that Docker Compose understands them. On top of that, it also understands domain names and configuration options for domain name/project mappings. A typical mapping can be found below:
{
"project-name": {
"domain": "domain.name",
"config": {
"use-subdomains": true
}
}
}stolos-watchd watches the given Docker engine for events and reacts to the following ones:
start- when a container starts, its service is exposeddie- when a container dies, its service route is removed
Services are exposed in the following way:
- domain name is
domain.nameand has theuse-subdomainsflagtrue- web service is exposed at
domain.name - all services (including the web service) are exposed to
<service-name>.domain.name
- web service is exposed at
- domain name is
sub.domain.nameand has theuse-subdomainsflagfalse- web service is exposed at
sub.domain.name - all services (including the web service) are exposed to
sub-<service-name>.domain.name
- web service is exposed at
If domain is project.apps.lair.io and has web and api services with the use-subdomains flag true, then the following domains will be exposed:
project.apps.lair.iowill point towebweb.project.apps.lair.iowill point towebapi.project.apps.lair.iowill point toapi
If domain is project.apps.lair.io and has web and api services with the use-subdomains flag false, then the following domains will be exposed:
project.apps.lair.iowill point towebproject-web.apps.lair.iowill point towebproject-api.apps.lair.iowill point toapi