2025-09-25 08:02:07 +00:00
2025-09-22 12:26:50 -07:00
2025-09-22 13:13:54 -07:00
2025-09-22 12:26:50 -07:00
2025-09-22 12:26:50 -07:00
2025-09-22 12:26:50 -07:00
2025-09-22 12:26:50 -07:00
2025-09-25 08:02:07 +00:00
2025-09-22 12:26:50 -07:00
2025-09-22 13:06:26 -07:00
2025-09-22 13:06:26 -07:00

Slack to ntfy Middleware

A lightweight Go service that acts as a middleware between Slack webhooks and ntfy servers, with Bearer token authentication and basic authentication support.

Features

  • Parses Slack webhook format
  • Forwards alerts to self-hosted ntfy servers
  • Bearer token authentication support
  • Health check endpoint
  • Lightweight Docker container (~8.4MB)
  • High performance and low resource usage

Quick Start

  1. Configure the service:

    # Edit docker-compose.yml and set:
    # - NTFY_BASE_URL=https://your-ntfy-server.com
    # - NTFY_TOKEN=tk_your_bearer_token
    # OR
    # - NTFY_USERNAME=your_username
    # - NTFY_PASSWORD=your_password
    
  2. Run the service:

    docker compose up -d
    
  3. Configure Slack:

    • Go to Slack Integrations → Incoming Webhooks
    • Add new webhook
    • Webhook URL: http://your-server-ip:8080/your-topic-name
  4. Test the service:

    # Test webhook
    curl -X POST http://localhost:8080/test-topic \
         -H 'Content-Type: application/json' \
         -d '{"text": "Test alert from Slack to ntfy"}'
    
    # Check health
    curl http://localhost:8080/health
    

Configuration

Environment Variable Default Description
NTFY_BASE_URL https://ntfy.sh Your ntfy server URL (without topic)
NTFY_TOKEN "" Bearer token for ntfy authentication
NTFY_USERNAME "" Username for ntfy basic authentication
NTFY_PASSWORD "" Password for ntfy basic authentication
BIND_ADDRESS 0.0.0.0 Interface to bind to
BIND_PORT 8080 Port to listen on

Development

Build locally

make build
make run

Build Docker image

make docker-build

Run tests

make test

License

MIT License

Description
A lightweight Go service that acts as a middleware between Slack webhooks and ntfy servers, with Bearer token authentication and basic authentication support.
Readme MIT 25 MiB
Languages
Go 50.7%
Shell 32.5%
Makefile 10.9%
Dockerfile 5.9%