Skip to content

Luke-Larsen/Pulse-Notifier

Repository files navigation

PivPulse Notifier

A Rust application that monitors the status of API services and sends notifications to Discord when services are down or slow.

Running the Application bare metal

Setup

  1. Create a .env file in the project root directory and add the required environment variables:
# Example environment file
# Copy this to .env and fill in the values

# API URL (replace with your actual API URL)
API_URL=https://example.com/api

# Discord webhook URL (replace with your actual Discord webhook URL)
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/...

# Comma-separated list of Nostr public keys (npubs)
# Example: NPUBS=npub1...,npub2...,npub3...
NPUBS=npub1rjxl3a3j54r865l9w9u3c4q8l6jv9s7q8l6jv9s7q8l6jv9,npub1v25t9r7q8l6jv9s7q8l6jv9s7q8l6jv9s7q8l6jv9,npub1k8l6jv9s7q8l6jv9s7q8l6jv9s7q8l6jv9
cargo run

Running with Docker

This project can be run using Docker for easier setup and deployment.

Prerequisites

  • Docker installed on your machine
  • Docker Compose installed

Setup

  1. Create a .env file in the project root directory and add the required environment variables:
# Example environment file
# Copy this to .env and fill in the values

# API URL (replace with your actual API URL)
API_URL=https://example.com/api

# Discord webhook URL (replace with your actual Discord webhook URL)
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/...

# Comma-separated list of Nostr public keys (npubs)
# Example: NPUBS=npub1...,npub2...,npub3...
NPUBS=npub1rjxl3a3j54r865l9w9u3c4q8l6jv9s7q8l6jv9s7q8l6jv9,npub1v25t9r7q8l6jv9s7q8l6jv9s7q8l6jv9s7q8l6jv9,npub1k8l6jv9s7q8l6jv9s7q8l6jv9s7q8l6jv9

Running the docker setup

DOCKER COMPOSE NOTE

depending on the version of docker compose these commands can be as docker-compose or docker compose

  1. Build the Docker image:
docker-compose build
  1. Run the application:
docker-compose up -d
  1. To view the logs:
docker-compose logs -f
  1. To stop the application:
docker-compose down

Alternatively, you can use the provided test script:

./test_docker.sh

About

A bot that listens to pivx pulse and sends a message if anything goes wrong

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published