Configuring Hyperflow Services
How Hyperflow's configuration model works
Each service within Hyperflow has its own configuration needs per-site, and those configurations are centrally stored in a KV store.
The KV Store
By convention, that store is named CONFIG
, and it contains one element per site-service-configuration.
This is represented in the key as-
<base-domain>:<service-name>
base-domain
is the domain name you're configuring the service for, minus anywww.
prefix.service-name
is the unique service name for the Hyperflow service you're configuring.
For example;
sygnal.com:purge-cache
Subdomains can be specially configured, e.g.;
blog.sygnal.com:purge-cache
Except;
www.
is resolved to the base domainhf.
is resolved to the base domainz.
is reserved for local debugging
The Config value
The configuration value is a JSON object.
Its specifics will depend on the service you're configuring, but there are always two standard parts;
version
is an integer value indicating the version of the configorigin
is reserved and identifies a 3rd party source as the proxied site. It's used for indirect proxy configurations. Origin always specifies the protocol and domain, as inhttps://www.sygnal.com
Embedded Configs
HtmlRewriter can easily locate matched elements however it does not have the ability to pull the text content. For this reason it's currently easiest to use attributes.
Notes
It is possible to get text elements separately with HtmlRewriter, however it may not be possible to identify the containing element, in which case we have no context.
Ideally, we want to standardize on JSON or HSON configs.
Last updated