Configuration
Every option of the DMS automation module, from run retention to clustering.
The module reads the config block of the dms-automation entry in antelope.config.ts. Every key is optional, and the module runs with no config block at all.
| Key | Type | Default | Description |
|---|---|---|---|
runs.retentionDays | number | 30 | Days a run is kept. The leader instance deletes older runs when the module starts and every hour after. 0 keeps every run. |
runs.sensitiveNames | string[] | [] | More header and query parameter names whose value is a credential. A name matches when it contains one of these strings, compared case-insensitively. They add to the built-in list in Credentials in runs. A run stores, shows and replays these values as [redacted]. |
httpRequest.blockPrivateNetwork | boolean | false | Refuse HTTP requests to this server's network. See Private network in HTTP requests. |
cluster.driver | "auto" | "redis" | "memory" | "auto" | How instances coordinate. See Clustering. |
Credentials in runs
A run keeps the headers and query parameters its webhook received, except the value of a credential. These names count as credentials, compared case-insensitively:
- The exact names
Authorization,Proxy-Authorization,Cookie,Set-Cookie,auth,keyandsig. - Any name that contains
token,secret,signature,hmac,password,passwd,session,apikey,api-key,api_key,accesskey,access-keyoraccess_key. - Any name that starts with
x-auth, or ends with-keyor_key. - Any name that contains a string of
runs.sensitiveNames.
The run itself receives the full values. Only the stored copy holds [redacted].
Private network in HTTP requests
The built-in HTTP request action can call any address the server can reach, its own network included. Turn on blockPrivateNetwork when people you do not fully trust build procedures, or when a URL can come from a webhook payload:
"dms-automation": {
config: {
httpRequest: { blockPrivateNetwork: true },
},
},
With the option on, the step fails when the host resolves to one of these addresses:
- Loopback:
127.0.0.0/8and::1. - Unspecified:
0.0.0.0/8and::. - Private:
10.0.0.0/8,172.16.0.0/12,192.168.0.0/16andfc00::/7. - Carrier-grade NAT:
100.64.0.0/10. - Link-local, cloud metadata endpoints included:
169.254.0.0/16andfe80::/10. - Multicast and reserved:
224.0.0.0/4,240.0.0.0/4andff00::/8. - A NAT64 address in
64:ff9b::/96that embeds one of the IPv4 addresses above.
The action follows redirects itself, at most 5, and checks each hop the same way. The check does not cover DNS rebinding between the lookup and the connection. The error names the host and the blocked address, and ends with this server refuses requests to its internal network (httpRequest.blockPrivateNetwork).
Two limits apply to every request, whatever the option says. Each step has a timeout, timeoutMs, set on the step: 30 seconds by default and at most 5 minutes. A larger value is capped, and the run log says so. The action refuses a response larger than 2 MB.
Webhooks
The API server serves each webhook under the path set on its trigger. The dashboard's frontend server never serves them. The module refuses a path in these cases:
- The path does not start with
/, or uses a character other than letters, digits,-,.,_,~,:and/, or contains an empty,.or..segment. - The path is
/api,/auth,/dms,/modulesor/settings, or starts with one of them followed by/. - A route the server already serves answers the same method on the same path.
- Another enabled procedure has a webhook with the same method on the same path.
Two paths count as the same when they have the same number of segments and each pair of segments is equal, or one of the pair is a :param segment.
The Library and the Builder show each webhook's full URL on the DMS apiBaseUrl. Set apiBaseUrl to the URL callers reach your API at. When apiBaseUrl is not set, the DMS uses its default, http://127.0.0.1:5010, which outside callers cannot reach. A loopback apiBaseUrl such as this one is shown as it is, with a hint to set apiBaseUrl in the DMS configuration. Only an empty apiBaseUrl makes the URL fall back to the origin the dashboard reached the API on.
Clustering
By default the module runs standalone. A single instance owns every trigger, and there is nothing to configure. To run several instances against shared state, provide @antelopejs/interface-redis in the project and start more than one instance. The module then coordinates the instances itself.
cluster.driver | Behaviour |
|---|---|
auto | Redis when a module provides @antelopejs/interface-redis, standalone otherwise. |
redis | Redis. When no module provides the interface, the module logs a warning and runs standalone. |
memory | Standalone, even when a module provides Redis. |
Each trigger type declares how it fires across a cluster:
singleton, such as the cron schedule and the table watch, fires once cluster-wide. Only the elected leader activates it. Leadership is a Redis lock with a 30-second TTL that the leader renews every 10 seconds, so another instance takes over when the leader stops.replicated, such as the webhook and the manual trigger, activates on every instance. The load balancer routes each event to one instance.
An edit to a procedure or a template on one instance reaches the others over Redis pub/sub, so every instance reconciles its triggers without a restart.
Singleton triggers fire once in normal operation. They are not transactionally exactly-once. A cron occurrence can be missed when the leader dies or stalls without releasing its lock, for up to the 30-second lock TTL. An instance starts a run from a singleton trigger only within 30 seconds of its last confirmed hold on the lock, so a leader that stalls past the TTL drops what its triggers fire when it resumes. A run started just before a handover can still overlap the new leader's first run. If the downstream effect of a singleton trigger must never run twice, make it idempotent. Keep the activate and deactivate of a custom trigger fast.