mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-18 09:46:24 +01:00
* webhook: share the default target settings Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * webhook: managed webhook targets with a drainable queue Targets kept as JSON (name, endpoint, token, filters, retry and worker settings) build their own queue; Close waits for queued and in-flight deliveries before stopping it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: run webhook targets stored in /etc/seaweedfs when notification.webhook.managed is set The targets in /etc/seaweedfs/notification_webhooks.json start with the filer and are rebuilt from the store whenever the file changes on any filer, alongside notification.toml. The previous queue drains before it stops. Events for the file itself, which holds bearer tokens, are not sent to notification queues. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: manage filer webhook targets A Webhooks page under Management lists, adds, edits and deletes the targets kept in /etc/seaweedfs/notification_webhooks.json. Bearer tokens are write-only: the API reports whether one is set, and an empty token on edit keeps the stored one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep the webhook queue when the stored targets did not change Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep a replaced webhook queue open until its senders hand over Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * admin: read chunk-backed webhook targets before editing them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shell: keep the stored webhook targets out of fs.meta.notify Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * webhook: reject negative managed target settings Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * webhook: no signal handler on queues that reloads replace Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: swap the webhook queue without waiting behind blocked senders The read lock held across SendMessage made a reload wait for any sender blocked on a saturated target, and the waiting writer stalled every other filer write with it, which is when an operator disables that target. Close now refuses new sends and waits for the senders already inside SendMessage, and a send that hits the closing queue retries on its replacement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * webhook: release blocked test handlers before the server shuts down Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: always run the webhook targets managed in the admin UI Drop the notification.webhook.managed switch: every filer loads and live reloads the stored targets. Without stored targets no queue is created. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * scaffold: place the admin-managed webhook note above enabled Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * scaffold: separate the admin-managed webhook note Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * scaffold: note that admin-managed webhooks follow the notification queue Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: retry loading webhook targets after a failed read Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: retire the admin-managed webhook queue on shutdown Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
103 lines
4.8 KiB
TOML
103 lines
4.8 KiB
TOML
# A sample TOML config file for SeaweedFS filer store
|
||
# Used by both "weed filer" or "weed server -filer" and "weed filer.replicate"
|
||
# Put this file to one of the location, with descending priority
|
||
# ./notification.toml
|
||
# $HOME/.seaweedfs/notification.toml
|
||
# /etc/seaweedfs/notification.toml
|
||
|
||
####################################################
|
||
# notification
|
||
# send and receive filer updates for each file to an external message queue
|
||
####################################################
|
||
[notification.log]
|
||
# this is only for debugging purpose and does not work with "weed filer.replicate"
|
||
enabled = false
|
||
|
||
|
||
[notification.kafka]
|
||
enabled = false
|
||
hosts = [
|
||
"localhost:9092"
|
||
]
|
||
topic = "seaweedfs_filer"
|
||
# event_types = ["create", "update", "delete", "rename"] # optional: filter by event types (default: all)
|
||
offsetFile = "./last.offset"
|
||
offsetSaveIntervalSeconds = 10
|
||
# SASL Authentication
|
||
sasl_enabled = false
|
||
sasl_mechanism = "PLAIN" # PLAIN, SCRAM-SHA-256, SCRAM-SHA-512
|
||
sasl_username = ""
|
||
sasl_password = ""
|
||
# TLS/SSL
|
||
tls_enabled = false
|
||
tls_ca_cert = "" # path to CA certificate PEM file
|
||
tls_client_cert = "" # path to client certificate PEM file (for mTLS)
|
||
tls_client_key = "" # path to client private key PEM file (for mTLS)
|
||
tls_insecure_skip_verify = false
|
||
|
||
|
||
[notification.aws_sqs]
|
||
# experimental, let me know if it works
|
||
enabled = false
|
||
aws_access_key_id = "" # if empty, loads from the shared credentials file (~/.aws/credentials).
|
||
aws_secret_access_key = "" # if empty, loads from the shared credentials file (~/.aws/credentials).
|
||
region = "us-east-2"
|
||
sqs_queue_name = "my_filer_queue" # an existing queue name
|
||
|
||
|
||
[notification.google_pub_sub]
|
||
# read credentials doc at https://cloud.google.com/docs/authentication/getting-started
|
||
enabled = false
|
||
google_application_credentials = "/path/to/x.json" # path to json credential file
|
||
project_id = "" # an existing project id
|
||
topic = "seaweedfs_filer_topic" # a topic, auto created if does not exists
|
||
|
||
[notification.gocdk_pub_sub]
|
||
# The Go Cloud Development Kit (https://gocloud.dev).
|
||
# PubSub API (https://godoc.org/gocloud.dev/pubsub).
|
||
# Supports AWS SNS/SQS, Azure Service Bus, Google PubSub, NATS and RabbitMQ.
|
||
enabled = false
|
||
# This URL will Dial the RabbitMQ server at the URL in the environment
|
||
# variable RABBIT_SERVER_URL and open the exchange "myexchange".
|
||
# The exchange must have already been created by some other means, like
|
||
# the RabbitMQ management plugin. Сreate myexchange of type fanout and myqueue then
|
||
# create binding myexchange => myqueue
|
||
topic_url = "rabbit://myexchange"
|
||
sub_url = "rabbit://myqueue"
|
||
|
||
[notification.webhook]
|
||
# Send file system events to HTTP webhook endpoints (push model)
|
||
# BEST FOR: Low to moderate traffic (< 100 events/second sustained)
|
||
# FOR HIGH TRAFFIC: Consider using Kafka, SQS, or pull-based event logs instead
|
||
# Documentation: https://github.com/seaweedfs/seaweedfs/wiki/Filer-Notification-Webhook
|
||
#
|
||
# Webhook targets edited in the admin UI (stored in the filer at
|
||
# /etc/seaweedfs/notification_webhooks.json) always run and apply without a
|
||
# filer restart, whether or not this section is enabled. They are sent after
|
||
# the notification queue configured in this file, so a saturated target there
|
||
# also delays them.
|
||
enabled = false
|
||
endpoint = "https://your-server.com/webhook" # required: HTTP endpoint URL
|
||
bearer_token = "" # optional: bearer token for authentication
|
||
timeout_seconds = 10 # optional: HTTP timeout (default: 10, range: 1-300)
|
||
max_retries = 3 # optional: retry attempts (default: 3, range: 0-10)
|
||
backoff_seconds = 3 # optional: initial backoff delay (default: 3, range: 1-60)
|
||
max_backoff_seconds = 30 # optional: max backoff delay (default: 30, range: backoff_seconds-300)
|
||
workers = 5 # optional: concurrent workers (default: 5, range: 1-100)
|
||
buffer_size = 10000 # optional: event buffer size (default: 10000, range: 100-1000000)
|
||
# event_types = ["create", "update", "delete", "rename"] # optional: filter by event types (default: all)
|
||
# path_prefixes = ["/important", "/data"] # optional: filter by path prefixes (default: all)
|
||
#
|
||
# Additional endpoints can be declared as named subsections, each with its own
|
||
# endpoint, filters, retry and worker settings, e.g.:
|
||
# [notification.webhook.file_ingress]
|
||
# enabled = true
|
||
# endpoint = "https://ingress.example.com/hook"
|
||
# event_types = ["create"]
|
||
# path_prefixes = ["/buckets/uploads/data"]
|
||
#
|
||
# [notification.webhook.metadata_extractor]
|
||
# enabled = true
|
||
# endpoint = "https://metadata.example.com/hook"
|
||
# path_prefixes = ["/buckets/repository"]
|