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.name
and has theuse-subdomains
flagtrue
- 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.name
and has theuse-subdomains
flagfalse
- 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.io
will point toweb
web.project.apps.lair.io
will point toweb
api.project.apps.lair.io
will 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.io
will point toweb
project-web.apps.lair.io
will point toweb
project-api.apps.lair.io
will point toapi