Vars
Vars are the settings each deployed copy of a service holds its own value of, such as the keywords a monitor watches. Whoever deploys a copy sets them.
A var is a setting a service declares under [vars] in its crab.toml, with a default and a description, such as the keywords a monitor watches. Each deployed copy holds its own value, and reads the default while it holds none. How a service reads one in code: Vars.
Setting them
| Does | |
|---|---|
| Deploy | On another account's service page, lists each var with its description, filled with its default. A value you change is set on your copy as it deploys. |
crab var ls <service> |
Lists the service's vars, each with the value it holds or its default, and its description. |
crab var set <service> <var> <value> |
Sets one. The service reads it from its next call. |
crab var unset <service> <var> |
Returns one to its default. |
crab inspect <service>lists the vars a service declares, with their defaults.- A deploy sets the values its request names and keeps the rest. A deploy whose
[vars]drops a var drops its value.
Rules
- Only owners of the account set its services' vars, and only they read the values back.
- A var's name, description and default are public: anyone who can see the service sees them on its page.
- A service declares at most 32 vars, each named in ASCII letters, digits and
_. - A value is at most 4096 bytes. Setting a var the service does not declare, or a longer value, is refused with E0011.
- A var is never a secret. A key or credential goes in a secret, which nobody reads back.