Show HN:Outpost——开源基础设施,用于出站Webhook和事件目标
Show HN: Outpost – OSS infra for outbound webhooks and event destinations

原始链接: https://github.com/hookdeck/outpost

Hookdeck出品的Outpost是一个自托管的开源基础设施,用于为您的平台添加出站Webhook和事件目标。它支持各种目标类型,例如Webhook、EventBridge、SQS、SNS、Pub/Sub、RabbitMQ和Kafka。Outpost依赖极少(Redis/PostgreSQL/Clickhouse和一个消息队列),确保向后兼容性、高吞吐量和成本效益。 主要功能包括事件主题和订阅、基于API或队列的事件发布、至少一次投递、事件扇出、自动/手动重试、多租户支持、用于调试和管理的用户门户、投递失败警报和OpenTelemetry集成。它还提供Webhook最佳实践,例如幂等性标头和签名轮换,以及Go、Python和TypeScript SDK。 要开始使用,请克隆Outpost仓库,配置您的环境,并使用Docker Compose启动服务。使用API创建一个租户,定义Webhook目标,并发布事件以测试设置。通过生成的链接访问用户门户,进行进一步的管理和测试。

Outpost,一个开源、可自托管的出站事件交付基础设施解决方案,已在 Hacker News 上发布。由 Hookdeck 团队创建,Outpost旨在简化从SaaS/API平台向用户发送事件(例如支付成功或更新)的复杂性。它支持传统的Webhook和直接事件目标,例如SQS、Kinesis和RabbitMQ,与仅Webhook的解决方案相比,它具有更高的可靠性和成本效益。 主要功能包括至少一次交付保证、内置可观察性、目标管理API和多租户支持。Outpost的设计与现有系统向后兼容,并使用Go语言编写,采用Apache 2.0许可证。 Hookdeck团队区分了Outpost和他们的商业产品Hookdeck,解释说Hookdeck专注于入站Webhook,而Outpost则针对出站事件交付的特定需求量身定制,提供更明确且更高效的解决方案。团队鼓励反馈,尤其是在架构和所需事件目标(如Kafka)方面。
相关文章

原文

Outpost is a self-hosted and open-source infrastructure that enables event producers to add outbound webhooks and Event Destinations to their platform with support for destination types such as Webhooks, Hookdeck Event Gateway, Amazon EventBridge, AWS SQS, AWS SNS, GCP Pub/Sub, RabbitMQ, and Kafka.

The Outpost runtime has minimal dependencies (Redis, PostgreSQL or Clickhouse, and one of the supported message queues), is 100% backward compatible with your existing webhooks implementation and is optimized for high-throughput, low-cost operation.

Outpost is built and maintained by Hookdeck. It's written in Go and distributed as a binary and Docker container under the Apache-2.0 license.

Outpost architecture

Read Outpost Concepts to learn more about the Outpost architecture and design.

  • Event topics and topic-based subscriptions: Supports the common publish and subscription paradigm to ease adoption and integration into existing systems.
  • Publish events via the API or a queue: Publish events using the Outpost API or configure Outpost to read events from a publish queue.
  • At least once delivery guarantee: Messages are guaranteed to be delivered at least once and never lost.
  • Event fanout: A message is sent to a topic is replicated and sent to multiple endpoints. This allows for parallel processing and asynchronous event notifications.
  • Automatic and manual retries: Configure retry strategies for event destinations and manually trigger event delivery retries via the API or user portal.
  • Multi-tenant support: Create multiple tenants on a single Outpost deployment.
  • User portal: Allow customers to view metrics, manage, debug, and observe their event destinations.
  • Delivery failure alerts: Manage event delivery failure alerts.
  • OpenTelemetry: OTel standardized traces, metrics, and logs.
  • Event destination types: Out of the box support for Webhooks, Hookdeck Event Gateway, Amazon EventBridge, AWS SQS, AWS SNS. GCP Pub/Sub, RabbitMQ, and Kafka.
  • Webhook best practices: Opt-out webhook best practices, such as headers for idempotency, timestamp and signature, and signature rotation.
  • SDKs and MCP server: Go, Python, and TypeScript SDK are available. Outpost also ships with an MCP server. All generated by Speakeasy.

See the Outpost Features for more information.

The Outpost documentation is built using the Zudoku documentation framework.

Ensure you have Docker installed.

Clone the Outpost repo:

git clone https://github.com/hookdeck/outpost.git

Navigate to outpost/examples/docker-compose/:

cd outpost/examples/docker-compose/

Create a .env file from the example:

Update the $API_KEY value within the new .env file.

Start the Outpost dependencies and services:

docker-compose -f compose.yml -f compose-rabbitmq.yml -f compose-postgres.yml up

Check the services are running:

curl localhost:3333/api/v1/healthz

Wait until you get a OK% response.

Create a tenant with the following command, replacing $TENANT_ID with a unique identifier such as "your_org_name", and the $API_KEY with the value you set in your .env:

Tip

You can use shell variables to store the tenant ID and API key for easier use in the following commands:

TENANT_ID=your_org_name
API_KEY=your_api_key
URL=your_webhook_url
curl --location --request PUT "localhost:3333/api/v1/$TENANT_ID" \
--header "Authorization: Bearer $API_KEY"

Run a local server exposed via a localtunnel or use a hosted service such as the Hookdeck Console to capture webhook events.

Create a webhook destination where events will be delivered to with the following command. Again, replace $TENANT_ID and $API_KEY. Also, replace $URL with the webhook destinations URL:

curl --location "localhost:3333/api/v1/$TENANT_ID/destinations" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $API_KEY" \
--data '{
    "type": "webhook",
    "topics": ["*"],
    "config": {
        "url": "'"$URL"'"
    }
}'

Publish an event, remembering to replace $API_KEY and $TENANT_ID:

curl --location "localhost:3333/api/v1/publish" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $API_KEY" \
--data '{
    "tenant_id": "'"$TENANT_ID"'",
    "topic": "user.created",
    "eligible_for_retry": true,
    "metadata": {
        "meta": "data"
    },
    "data": {
        "user_id": "userid"
    }
}'

Check the logs on your server or your webhook capture tool for the delivered event.

Get an Outpost portal link for the tenant:

curl "localhost:3333/api/v1/$TENANT_ID/portal" \
--header "Authorization: Bearer $API_KEY"

The response will look something like the following:

{ "redirect_url": "http://localhost:3333?token=$TOKEN" }

The token value is an API-generated JWT.

Open the redirect_url link to view the Outpost portal.

Dashboard homepage

Continue to use the Outpost API or the Outpost portal to add and test more destinations.

See CONTRIBUTING.

This repository contains Outpost, covered under the Apache License 2.0, except where noted (any Outpost logos or trademarks are not covered under the Apache License, and should be explicitly noted by a LICENSE file.)

联系我们 contact @ memedata.com