A Rust application that monitors the status of API services and sends notifications to Discord when services are down or slow.
- Create a
.envfile 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,npub1k8l6jv9s7q8l6jv9s7q8l6jv9s7q8l6jv9cargo runThis project can be run using Docker for easier setup and deployment.
- Docker installed on your machine
- Docker Compose installed
- Create a
.envfile 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,npub1k8l6jv9s7q8l6jv9s7q8l6jv9s7q8l6jv9DOCKER COMPOSE NOTE
depending on the version of docker compose these commands can be as
docker-compose
or
docker compose
- Build the Docker image:
docker-compose build- Run the application:
docker-compose up -d- To view the logs:
docker-compose logs -f- To stop the application:
docker-compose downAlternatively, you can use the provided test script:
./test_docker.sh