Sign inSign up

samosadlaker/wled-relay

By samosadlaker

•Updated over 1 year ago

A Dockerized Node.js app that exposes secure HTTP endpoints to forward requests to webhooks.

Image
Internet of things
Web servers
0

1.0K

samosadlaker/wled-relay repository overview

⁠Webhook Relay Server

A lightweight, Dockerized Node.js application that exposes secure HTTP endpoints which forward requests to local webhooks. Perfect for triggering smart home actions or internal services via public triggers like IFTTT — without exposing your local webhooks directly.


⁠✨ Features

  • šŸ” Dynamic endpoints configured via config.json
  • šŸ” Simple API key protection
  • šŸ“¦ Dockerized and easy to deploy
  • šŸš€ Forwards requests to local webhooks
  • šŸ”„ Hot reload when config file changes (no restart needed)
  • 🧱 Extensible structure for custom logic

ā šŸ“ Project Structure

ā”œā”€ā”€ config.json # Define your endpoints and target webhooks
ā”œā”€ā”€ .env # Store your API key and port
ā”œā”€ā”€ Dockerfile # Docker config
ā”œā”€ā”€ index.js # Main application logic
└── package.json # Dependencies and scripts


ā šŸš€ Quick Start

docker run -d \
  -p 3000:3000 \
  -e API_KEY=your_secret_key \
  -v /path/to/config.json:/app/config.json \
  samosadlaker/wled-relay:latest

Manual Setup:

  1. Clone repo & install dependencies
  2. Configure .env and config.json
  3. Start with npm start

ā āš™ļø Configuration

config.json

{
  "endpoints": [
    {
      "path": "/trigger-light",
      "webhook": "http://host.docker.internal:4567/light"
    },
    {
      "path": "/trigger-alarm",
      "webhook": "http://host.docker.internal:4567/alarm"
    }
  ]
}

.env

PORT=3000                 # Server port
API_KEY=change_this       # Required for all requests

ā šŸ” Authentication

Include your API key via either:

  • Header: x-api-key: your_key
  • Query param: ?key=your_key

⁠🐳 Docker Compose

services:
  relay:
    image: samosadlaker/wled-relay:latest
    ports:
      - "3000:3000"
    environment:
      - API_KEY=${API_KEY}
    volumes:
      - ./config.json:/app/config.json
    restart: unless-stopped

⁠🌐 Usage Example

curl -X GET "http://your-server:3000/wled-on?key=your_key"

Tag summary

Content type

Image

Digest

sha256:0f0d5ed7a…

Size

56.1 MB

Last updated

over 1 year ago

docker pull samosadlaker/wled-relay