FireAlerts

Get alerted before your Handshake domains expire.

Overview

FireAlerts is a web application that monitors Handshake domain expiry dates and sends notifications when domains are approaching expiration. Users can set up multiple notification types including Discord webhooks and email alerts.

Features

  • Monitor multiple Handshake domains
  • Multiple notification types (Discord webhook, Email)
  • Customizable notification timing (blocks before expiry)
  • User authentication via HNS.au login system
  • REST API for programmatic access
  • Background monitoring every 2 minutes

Setup

  1. Install dependencies:
pip install -r requirements.txt
  1. Configure environment variables in .env using example.env as a template

  2. Run the application:

python main.py

API Documentation

Authentication

Account API endpoints require a valid token from the HNS.au authentication system.

Endpoints

Get Domain Information

GET /api/v1/domain/<domain>

Returns expiry information for a specific domain.

Response:

{
  "domain": "example",
  "expiry_date": 123456,
  "expires_in_blocks": 1008
}

Get Current Block

GET /api/v1/current_block

Returns the current blockchain block number.

Response:

{
  "current_block": 123456
}

Get User Notifications

GET /api/v1/notifications/<token>

Returns all notifications for the authenticated user.

Response:

[
  {
    "domain": "example",
    "notification": {
      "type": "discord_webhook",
      "url": "https://discord.com/api/webhooks/...",
      "blocks": 1008,
      "id": "abc123",
      "user_name": "username"
    }
  }
]

Add Notification

POST /api/v1/notifications/<token>

Add a new notification for the authenticated user.

Request Body:

{
  "domain": "example",
  "type": "discord_webhook",
  "url": "https://discord.com/api/webhooks/...",
  "blocks": 1008
}

Response:

{
  "message": "Notification added successfully",
  "notification": {
    "type": "discord_webhook",
    "url": "https://discord.com/api/webhooks/...",
    "blocks": 1008,
    "id": "abc123",
    "user_name": "username"
  }
}

Notification Types

Discord Webhook

  • Type: discord_webhook
  • Required Fields:
    • url: Discord webhook URL

Email

  • Type: email
  • Required Fields:
    • email: Email address

Web Interface

Routes

  • / - Home page
  • /account - User dashboard (requires authentication)
  • /login - Authentication callback
  • /logout - Clear authentication
  • /notification/<type> - Add notification (POST)
  • /notification/delete/<id> - Delete notification

Background Processing

The application runs a background thread that checks domain expiries every 2 minutes. When a domain is within the specified number of blocks from expiry, appropriate notifications are sent.

File Structure

  • server.py - Main Flask application
  • domains.py - Domain and notification management
  • alerts.py - Notification handling and types
  • templates/ - HTML templates
  • templates/assets/ - Static assets (CSS, images)
  • data/domains.json - Notification storage (created automatically)

Dependencies

  • Flask - Web framework
  • requests - HTTP client
  • python-dotenv - Environment variable management
Description
Handshake alerts by FireWallet
Readme AGPL-3.0 270 KiB
Languages
Python 64.3%
HTML 19.9%
CSS 15.3%
Dockerfile 0.5%