Skip to content
This page was translated with AI and may contain inaccuracies. Help improve it on GitHub.

Notification Center ​

The Notification Center subscribes to Gately's internal event bus and, according to your rules, pushes events such as DDNS changes, certificate expiry, WAF blocks and process failures to Webhook, Telegram, Bark, ntfy, Gotify, Pushover, Discord, Slack, ServerChan, PushPlus, WeCom, DingTalk, Feishu and email. The management UI is under the sidebar "System" group → "Notifications".

How it works ​

  1. Each module publishes events to the in-process event bus when its state changes. Publishing never blocks business logic.
  2. When the Notification Center receives an event, it checks the rules one by one: the rule is enabled, the event level is not lower than the rule's minimum level, and the event type matches the rule's event list.
  3. After a matching rule passes silence deduplication, the message is delivered to the enabled channels selected by the rule. If one event matches several rules, each channel is sent to only once.
  4. The result of each delivery (success, or the reason for failure) is written to "Recent deliveries", which keeps the latest 200 entries in memory. Failures are also written to the module log.

A single delivery times out after 45 seconds.

Channels ​

Click "Add channel", choose a type and fill in the fields. Every channel has a name (required), a remark and an enable switch. Secret fields are not shown again after saving; leaving them empty when editing keeps the original value.

TypeRequired fieldsOptional fields
WebhookRequest URLRequest method (default GET; GET, POST, PUT or PATCH), headers (one Key: Value per line), body, success-match content, timeout (seconds, default 20), skip certificate verification
TelegramBot Token, Chat IDAPI URL (leave empty to use https://api.telegram.org)
BarkDevice KeyServer URL (leave empty to use https://api.day.app)
WeComBot URLNone
DingTalkBot URLSigning secret (fill in when the bot has "signature" enabled)
FeishuBot URLSigning secret (fill in when the bot has "signature verification" enabled)
EmailServer, recipients, and at least one of sender or usernameEncryption, port, username, password
ntfyTopicServer URL (leave empty to use https://ntfy.sh), access token
GotifyServer URL, application tokenNone
PushoverApplication token, user keyNone
DiscordWebhook URLNone
SlackWebhook URLNone
ServerChanSendKeyNone
PushPlusTokenNone

URL fields need a full address starting with http:// or https://.

Webhook template variables ​

The following variables can be used in the request URL and body, written as the variable name wrapped in curly braces (the # prefix form is also accepted):

VariableContent
titleTitle, in the form [Gately] Event title
messageDetailed description of the event
textFull body, including description, source, level and time
typeEvent type, such as ddns.changed
sourceEvent source
levelLevel: info, warn or error
timeTime in RFC 3339 format

Extra fields carried by an event (such as ip and container) can also be used as variables. If a name collides with the table above, the table above takes precedence. Variable values in the URL are URL-escaped.

Email ​

EncryptionValueDefault port
STARTTLSstarttls587
SSL/TLStls465
Nonenone25

A port of 0 uses the default port for the chosen encryption. You can enter several recipients separated by commas. Emails are sent as UTF-8 plain text. PLAIN authentication is used when the server supports AUTH and a username is set; when the sender is empty, the username is used.

Signatures and response codes ​

  • DingTalk: once a signing secret is set, requests automatically carry timestamp and sign.
  • Feishu: once a signing secret is set, the request body automatically carries timestamp and sign.
  • WeCom, DingTalk, Feishu and Bark check the business return code in the response. An HTTP 200 with a business failure is also recorded as a failed delivery.

Rules ​

Click "Add rule":

FieldDescription
NameRequired
EventsAt least one. Pick specific event types, * for all events, or enter a wildcard such as ddns.*. Wildcards use Go path.Match syntax
Minimum levelinfo, warn or error; empty means info. Events below this level are not pushed
ChannelsAt least one
Silence (seconds)Within one rule, events of the same type from the same source are pushed only once in this period, and repeats are dropped. 0 disables deduplication
EnabledSwitch

TIP

WAF blocks and upstream state changes can happen frequently. For rules covering them, set a silence time of 300 seconds or more.

Rule templates ​

When creating a rule, click a template to prefill the events, level and silence time, then pick channels and save:

TemplateEvents
Critical failuresDDNS update failed, certificate renewal failed, upstream down, child process exited abnormally, backup failed, container exited
Certificate expiryCertificate expiring soon, renewal failed (24-hour silence)
Address changesDDNS record updated, STUN address changed
Service healthUpstream down and recovered, container exited, child process exited
Security & sign-insLogin failures, IP bans, successful logins, access to sensitive content
Configuration changesEvery configuration change made in the management UI

Event types ​

Event typeNameLevelTrigger
ddns.changedDynamic DNS: record updatedInfoA DDNS task updated its record successfully
ddns.failedDynamic DNS: update failedErrorA DDNS task failed to update
stun.changedSTUN: traversal address changedInfoThe traversal address of a STUN rule changed
ssl.expiringCertificate: expiring soonWarningLess than 7 days of validity left; each certificate is reminded at most once every 24 hours
ssl.renew_failedCertificate: renewal failedErrorCertificate issuance or renewal failed
waf.blockedWAF: request blockedWarningThe WAF blocked a request, with the fields ip, host and path
upstream.downReverse proxy: upstream downErrorA backend of a Web service was judged unavailable
upstream.upReverse proxy: upstream recoveredInfoAn unavailable backend recovered
docker.exitedDocker: container exitedWarning or ErrorA container exited with a non-zero exit code (warning), or was killed for running out of memory (error)
process.exitedChild process exited abnormallyErrorA child process managed by Gately exited abnormally and will be restarted automatically; the source is that process's log name
backup.doneBackup: completedInfoA scheduled or manual backup succeeded for all destinations; see Configuration Backup
backup.failedBackup: failedErrorBackup packaging failed, or writing to any destination failed
auth.failedAuthentication: repeated failuresWarningA management UI login failed, with the ip field
auth.bannedAuthentication: IP bannedWarningRepeated Web service authentication failures triggered an automatic ban
login.successManagement UI: login succeededInfoA management UI login succeeded, with the ip and user fields
audit.changeManagement UI: configuration changedInfoAny change made in the management UI, with the actor, ip, method and path fields; see Audit Log & Config History
audit.accessManagement UI: sensitive content accessedWarningDownloading a backup, diagnostics bundle or certificate private key, opening a terminal, and similar; same fields as above
notify.testTest notificationInfoProduced by the channel's "Test" button; it does not take part in rule matching

Sending a test ​

The "Test" button on a channel card sends a message titled "Test notification" directly to that channel. It bypasses rules and works even if the channel is not enabled. On success, "Test notification sent" is shown; on failure, the specific error is shown. Test results also appear in "Recent deliveries", with "Test" in the rule column.

The matching API is POST /api/notify/channels/{key}/test, which can be called with the notify:write scope of an API token.

Released under the Apache-2.0 license.