Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

## 7.4.0 - 2026-11-13

### Security

- Config UI: the save-to-directory API (`POST {config-ui-path}/api/save`) is now disabled unless `-config-ui-token` / `CONFIG_UI_TOKEN` is set, and requires the token in the `X-Config-UI-Token` header, a JSON content type and a same-origin request. Previously anyone who could reach the port could write a hook file and trigger it.
Expand All @@ -23,21 +25,31 @@
- The Redis health check sends a real `PING` instead of always reporting healthy.
- `-max-header-bytes` takes effect when set to a non-default value; `-read-header-timeout-seconds` logs a warning because it cannot be applied.
- On shutdown the HTTP server and running async hooks finish before audit logging and tracing are closed.
- Require Go 1.27.4 and update Fiber to v3.7.0. Refresh first-party kit dependencies (audit-kit v2.1.6, cli-kit v1.9.4, health-kit v4.0.7, i18n-kit v4.0.6, logger-kit v3.0.6, metrics-kit v3.0.6, middleware-kit v3.0.6, redis-kit v1.8.2, secure-kit v2.1.5, tracing-kit v2.0.4, version-kit v4.0.5) and their compatible transitive requirements.
- Synchronize container, verification and migration examples with this release.

### Fixed

- `ip-whitelist` lists mixing IPv4 and IPv6 single addresses no longer return an error for clients of the other family.
- `parse-parameters-as-json` works for nested keys and no longer panics when the path crosses a non-object value.
- Signature helpers no longer panic on non-string header values, the Scalr check no longer appends to the request body buffer, and `pass-file-to-command` no longer writes to the shared hook definition under concurrent requests.

- Temp files created for `pass-file-to-command` are now removed when `command-working-directory` is not set.
- When a hook times out, the whole process group is killed (Unix) and the executor slot is released even if leftover processes keep the output pipes open.

### Upgrade notes
### Upgrade from 7.3.4

- Config UI "Save to directory" stops working until `-config-ui-token` is configured.
- Senders of asynchronous hooks may now receive `503` under saturation and should retry.
- Deployments behind a reverse proxy that use rate limiting must set `-trusted-proxies`, otherwise all requests share the proxy's per-IP quota.
- One entry in `-trusted-proxies` that is not an IP address or CIDR range causes the whole list to be ignored, with a startup warning; forwarded headers are then not used.
- `multipart/form-data` request bodies are read fully into memory, up to `-max-request-body-size`, before they are parsed, so that signature rules can cover the raw body. Size the limit and the memory of the process for the largest upload you accept.
- With Redis enabled, `/health` and `/readyz` report unhealthy while Redis does not answer `PING`. An orchestrator that acts on the readiness probe will take the instance out of rotation during a Redis outage.

Hook files keep their format. Retain your hook files, configuration, credentials and mounted data. Keep the same runtime variant (`core`, `runner` or `extended`) and change only its version suffix to `7.4.0`. The unprefixed tag continues to select the core variant, which does not contain a shell.

Validate hooks and test a representative signed request before switching production traffic. See the [migration guide](docs/en-US/Migration-Guide.md) and [container guide](docs/en-US/Container-Images.md) for earlier-version compatibility requirements.

[Compare 7.3.4...7.4.0](https://github.com/soulteary/webhook/compare/7.3.4...7.4.0)

## 7.3.4 - 2026-11-02

Expand Down
18 changes: 9 additions & 9 deletions README-zhCN.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ go install github.com/soulteary/webhook@latest
# 最新稳定 Core 镜像
docker pull soulteary/webhook:latest

# 最小化 scratch 镜像(无前缀的 7.3.4 是它的别名)
docker pull soulteary/webhook:core-7.3.4
# 最小化 scratch 镜像(无前缀的 7.4.0 是它的别名)
docker pull soulteary/webhook:core-7.4.0

# Shell 脚本运行环境
docker pull soulteary/webhook:runner-7.3.4
docker pull soulteary/webhook:runner-7.4.0

# 包含调试和网络工具的运行环境
docker pull soulteary/webhook:extended-7.3.4
docker pull soulteary/webhook:extended-7.4.0
```

| 变体 | 内容 | 适用场景 |
Expand Down Expand Up @@ -243,18 +243,18 @@ http://yourserver:9000/hooks/redeploy-webhook
Tag Release 会发布 SPDX SBOM、Checksum 文件的 Keyless Sigstore Bundle、已签名的多架构容器 Manifest,以及 GitHub 构建来源证明。验证示例:

```bash
gh attestation verify webhook_7.3.4_linux_amd64.tar.gz -R soulteary/webhook
gh attestation verify webhook_7.4.0_linux_amd64.tar.gz -R soulteary/webhook

cosign verify-blob \
--bundle webhook_7.3.4_checksums.txt.sigstore.json \
--bundle webhook_7.4.0_checksums.txt.sigstore.json \
--certificate-identity-regexp='^https://github.com/soulteary/webhook/.github/workflows/build.yml@refs/tags/.+$' \
--certificate-oidc-issuer='https://token.actions.githubusercontent.com' \
webhook_7.3.4_checksums.txt
webhook_7.4.0_checksums.txt

cosign verify \
--certificate-identity='https://github.com/soulteary/webhook/.github/workflows/build.yml@refs/tags/7.3.4' \
--certificate-identity='https://github.com/soulteary/webhook/.github/workflows/build.yml@refs/tags/7.4.0' \
--certificate-oidc-issuer='https://token.actions.githubusercontent.com' \
ghcr.io/soulteary/webhook:runner-7.3.4
ghcr.io/soulteary/webhook:runner-7.4.0
```

## 关于此 Fork
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ Download pre-built binaries for Linux and macOS from the [Releases page](https:/
# Latest stable core image
docker pull soulteary/webhook:latest

# Minimal scratch image (the unprefixed 7.3.4 tag is an alias)
docker pull soulteary/webhook:core-7.3.4
# Minimal scratch image (the unprefixed 7.4.0 tag is an alias)
docker pull soulteary/webhook:core-7.4.0

# Shell-script runtime
docker pull soulteary/webhook:runner-7.3.4
docker pull soulteary/webhook:runner-7.4.0

# Runtime with debugging and network tools
docker pull soulteary/webhook:extended-7.3.4
docker pull soulteary/webhook:extended-7.4.0
```

| Variant | Contents | Intended use |
Expand Down Expand Up @@ -244,18 +244,18 @@ For more examples and use cases, check out [Hook Examples](docs/en-US/Hook-Examp
Tagged releases publish SPDX SBOMs, a keyless Sigstore bundle for the checksum file, signed multi-architecture container manifests, and GitHub build-provenance attestations. Examples:

```bash
gh attestation verify webhook_7.3.4_linux_amd64.tar.gz -R soulteary/webhook
gh attestation verify webhook_7.4.0_linux_amd64.tar.gz -R soulteary/webhook

cosign verify-blob \
--bundle webhook_7.3.4_checksums.txt.sigstore.json \
--bundle webhook_7.4.0_checksums.txt.sigstore.json \
--certificate-identity-regexp='^https://github.com/soulteary/webhook/.github/workflows/build.yml@refs/tags/.+$' \
--certificate-oidc-issuer='https://token.actions.githubusercontent.com' \
webhook_7.3.4_checksums.txt
webhook_7.4.0_checksums.txt

cosign verify \
--certificate-identity='https://github.com/soulteary/webhook/.github/workflows/build.yml@refs/tags/7.3.4' \
--certificate-identity='https://github.com/soulteary/webhook/.github/workflows/build.yml@refs/tags/7.4.0' \
--certificate-oidc-issuer='https://token.actions.githubusercontent.com' \
ghcr.io/soulteary/webhook:runner-7.3.4
ghcr.io/soulteary/webhook:runner-7.4.0
```

## About This Fork
Expand Down
20 changes: 10 additions & 10 deletions docs/en-US/Container-Images.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Container images

WebHook 7.3.4 publishes three multi-architecture runtime variants to Docker Hub
WebHook 7.4.0 publishes three multi-architecture runtime variants to Docker Hub
and GHCR. All variants run as UID/GID `65532`, use `/var/lib/webhook` as their
working directory, and contain the same statically linked WebHook binary.

| Variant | Versioned tag | Runtime contents | Use it when |
|---|---|---|---|
| Core | `core-7.3.4` | `scratch`, CA certificates, WebHook | Every executed command is a mounted static binary |
| Runner | `runner-7.3.4` | Alpine, BusyBox utilities, Bash, CA certificates | Hooks execute ordinary POSIX shell or Bash scripts |
| Extended | `extended-7.3.4` | Runner plus curl, jq, and yq | Hooks explicitly require network or JSON/YAML command-line tools |
| Core | `core-7.4.0` | `scratch`, CA certificates, WebHook | Every executed command is a mounted static binary |
| Runner | `runner-7.4.0` | Alpine, BusyBox utilities, Bash, CA certificates | Hooks execute ordinary POSIX shell or Bash scripts |
| Extended | `extended-7.4.0` | Runner plus curl, jq, and yq | Hooks explicitly require network or JSON/YAML command-line tools |

The unprefixed `7.3.4` and `latest` tags are aliases for `core-7.3.4`. Pin a
The unprefixed `7.4.0` and `latest` tags are aliases for `core-7.4.0`. Pin a
versioned tag, or preferably an image digest, in production. Both registries use
the same tag contract:

Expand Down Expand Up @@ -40,16 +40,16 @@ secure profile's command allowlist. Mounted files must be accessible to UID/GID

## Migrating from 7.1

The old `extend-7.3.4` tag remains as a compatibility alias for
`extended-7.3.4`. Existing deployments can move without an immediate rename,
The old `extend-7.4.0` tag remains as a compatibility alias for
`extended-7.4.0`. Existing deployments can move without an immediate rename,
but new configuration should use `extended-*`.

The old extended image was commonly used for every script hook. In 7.2, choose
the smallest matching runtime:

- Move shell-only hooks to `runner-7.3.4`.
- Keep hooks that require curl, jq, or yq on `extended-7.3.4`.
- Use `core-7.3.4` only when the configured command is a static executable.
- Move shell-only hooks to `runner-7.4.0`.
- Keep hooks that require curl, jq, or yq on `extended-7.4.0`.
- Use `core-7.4.0` only when the configured command is a static executable.

The default image remains shell-free, so changing an existing script-based
deployment from `extend-*` to the unprefixed version tag will not work.
17 changes: 16 additions & 1 deletion docs/en-US/Migration-Guide.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Migration Guide

## Upgrade from 7.3.4 to 7.4.0

Hook definitions need no migration, but this release changes default behavior in the following places. Review them before switching production traffic:

- Config UI: "Save to directory" stops working until `-config-ui-token` / `CONFIG_UI_TOKEN` is configured. The save API then requires the token in the `X-Config-UI-Token` header.
- Rate limiting behind a reverse proxy: `X-Forwarded-For` / `X-Real-IP` are honored only when the request comes from an address listed in `-trusted-proxies` / `TRUSTED_PROXIES`. Without it, all requests share the proxy's per-IP quota.
- Asynchronous hooks: when all execution slots stay busy for the acquire timeout, the request receives `503` with `Retry-After` instead of a success response. Senders should retry.
- Trusted proxy list: one entry in `-trusted-proxies` / `TRUSTED_PROXIES` that is not an IP address or CIDR range causes the whole list to be ignored, with a startup warning. Forwarded headers are then not used.
- Multipart requests: a `multipart/form-data` body is read fully into memory, up to `-max-request-body-size`, before it is parsed, so that signature rules can cover the raw body. Size the limit and the memory of the process for the largest upload you accept.
- Health and readiness with Redis: when Redis is enabled, `/health` and `/readyz` report unhealthy while Redis does not answer `PING`. An orchestrator that acts on the readiness probe will take the instance out of rotation during a Redis outage.

Also check configurations that depended on behavior this release closes: `-allowed-command-paths` directory entries that matched by string prefix or through a symlink leaving the directory, `value` match rules whose configured value is empty, signatures on `multipart/form-data` requests (now computed over the raw body), and a client-supplied `X-Request-Id` without `-x-request-id`.

Keep the existing runtime variant and persistent mounts, update its version suffix to `7.4.0`, validate your hooks, and test a representative signed request. The [changelog](https://github.com/soulteary/webhook/blob/7.4.0/CHANGELOG.md) lists every change.

## Upgrade from 7.3.3 to 7.3.4

This is a dependency maintenance release with no hook or configuration migration. Keep the existing runtime variant and persistent mounts, update its version suffix to `7.3.4`, validate your hooks, and test a representative signed request. Redis-backed deployments should also verify shared rate-limit behavior.
Expand Down Expand Up @@ -62,7 +77,7 @@ Hook JSON/YAML compatibility is tested and regressions are treated as bugs. Runt
2. **Download New Version:**
```bash
# Download a versioned release archive
VERSION=7.3.4
VERSION=7.4.0
wget "https://github.com/soulteary/webhook/releases/download/${VERSION}/webhook_${VERSION}_linux_amd64.tar.gz"
tar -xzf "webhook_${VERSION}_linux_amd64.tar.gz"

Expand Down
22 changes: 11 additions & 11 deletions docs/en-US/OwlMail-Integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ to WebHook. WebHook authenticates the exact request body, maps selected JSON
fields to environment variables, and runs a controlled local command.

```text
SMTP client -> OwlMail v0.13.0 -> signed HTTP POST -> WebHook -> command/script
SMTP client -> OwlMail v0.15.0 -> signed HTTP POST -> WebHook -> command/script
```

A runnable example is available in [`example/owlmail`](../../example/owlmail/).
OwlMail also maintains the sender-side example in
[`examples/webhooks/soulteary-webhook`](https://github.com/soulteary/owlmail/tree/v0.13.0/examples/webhooks/soulteary-webhook).
[`examples/webhooks/soulteary-webhook`](https://github.com/soulteary/owlmail/tree/v0.15.0/examples/webhooks/soulteary-webhook).

## Requirements

- WebHook 7.3.4 (the Compose example uses its shell-capable `runner` image).
- OwlMail v0.13.0 (the version pinned by this example) or later.
- OwlMail v0.15.0 (the version pinned by this example) or later.
- A random shared secret of at least 32 bytes.
- Network reachability from OwlMail to the WebHook endpoint.

Expand Down Expand Up @@ -44,7 +44,7 @@ The example waits for command completion, so failures return non-2xx responses
and OwlMail can retry. Keep handlers idempotent and avoid printing secrets or
unnecessary full message bodies.

## Configure OwlMail v0.13.0
## Configure OwlMail v0.15.0

Open `/webhooks` to create, import, validate, copy, and download a version 1
configuration. Editing happens locally in the browser. Downloading does not
Expand All @@ -55,7 +55,7 @@ The runnable demo uses the released image directly:

```yaml
owlmail:
image: ghcr.io/soulteary/owlmail:0.13.0
image: ghcr.io/soulteary/owlmail:0.15.0
environment:
OWLMAIL_WEBHOOK_CONFIG: /app/config/owlmail.json
OWLMAIL_WEBHOOK_MAX_CONCURRENCY: "8"
Expand All @@ -79,7 +79,7 @@ runtime values fail startup instead of silently disabling delivery.

## Signatures and delivery identity

OwlMail 0.13.0 sends both signature formats when a target has a `secret`:
OwlMail 0.15.0 sends both signature formats when a target has a `secret`:

| Header | Meaning |
|---|---|
Expand Down Expand Up @@ -107,7 +107,7 @@ an authenticated copy in the signed body through a trusted adapter.
## Delivery timing and durability

OwlMail accepts and stores SMTP mail independently from the eventual HTTP
result. In 0.13.0, each event is first synced to
result. In 0.15.0, each event is first synced to
`.owlmail-webhook-outbox` under the mail directory; HTTP delivery then happens
asynchronously and with at-least-once semantics. A failed WebHook command causes
a non-2xx delivery result and retry, but it does not reject or delete the
Expand Down Expand Up @@ -143,11 +143,11 @@ assume the published image supplies a Docker HEALTHCHECK or puts `/app` in PATH.

Stop incoming SMTP traffic and the old process before backing up the complete
mail directory, webhook outbox and any configured Redis/S3 state. Rehearse
0.13.0 against an isolated copy with real outbound destinations disabled, then
0.15.0 against an isolated copy with real outbound destinations disabled, then
check readiness, retained mail/attachments, a new SMTP receipt and its signed
webhook command before reopening traffic. Recovery may resume pending work,
and delivery remains at least once. If Relay is configured, review its
[0.13.0 recovery changes](https://github.com/soulteary/owlmail/blob/v0.13.0/docs/en/Release-0.13.0.md).
[0.15.0 upgrade notes](https://github.com/soulteary/owlmail/blob/v0.15.0/docs/en/Release-0.15.0.md).
Rollback requires stopping the new process and restoring the pre-upgrade backup
with the old image and configuration; do not share writable state between
versions. Reconcile downstream receipts before resuming pending deliveries.
Expand All @@ -163,7 +163,7 @@ docker compose up

Send a test message to `smtp://127.0.0.1:1025`. Open
`http://127.0.0.1:1080` for the inbox and `http://127.0.0.1:1080/webhooks` for
the v0.13.0 webhook configurator. The WebHook container logs the verified and
the v0.15.0 webhook configurator. The WebHook container logs the verified and
mapped demo event.

## Production checklist
Expand All @@ -179,7 +179,7 @@ mapped demo event.

## Filtering and multiple workflows

OwlMail v0.13.0 supports case-insensitive wildcard filters for sender, recipient,
OwlMail v0.15.0 supports case-insensitive wildcard filters for sender, recipient,
subject, and plain-text body. Multiple targets can call separate hook IDs such as
`/hooks/owlmail-archive`, `/hooks/owlmail-alert`, and `/hooks/owlmail-ticket`.
Use separate commands and, where practical, separate secrets to isolate permissions.
Expand Down
Loading
Loading