Skip to main content

Demeter


image
Demeter is a lightweight Flask-based tool designed to capture, store, and analyze incoming webhook requests. It provides a simple web interface for authenticated users to view webhook data, statistics, and manage request history. The application supports multiple HTTP methods, logs requests to a SQLite database, and includes features like session management, request caching, and periodic cleanup of old records.

Features

  • Webhook Capture: Handles GET, POST, PUT, DELETE, PATCH, and OPTIONS requests on any path.
  • Database Storage: Stores webhook data (headers, payload, method, IP address, etc.) in a SQLite database.
  • User Authentication: Secure login system with hashed passwords.
  • Dashboard: Displays recent webhooks with details like timestamp, method, path, headers, and data.
  • Statistics API: Provides insights into total requests, method distribution, and status counts.
  • Cache Management: Maintains a memory cache of up to 50 recent webhooks for quick access.
  • Periodic Cleanup: Automatically deletes webhook records older than 30 days.
  • Logging: Logs application events and errors to a rotating log file.
  • Secure Session Management: Uses a secure secret key for session handling.

Prerequisites

  • Python 3.6+
  • Flask (pip install flask)
  • SQLite3 (included with Python)
  • No additional external services required

Installation

  1. Clone the repository:
    pip install demeter-tod
    
  2. Run the application:
    demeter
    
    The application will start on http://0.0.0.0:13370.

Usage

  1. Access the Application:
    • Open your browser and navigate to http://localhost:13370.
    • Log in with the default credentials:
      • Username: anonre
      • Password: hackerbiasa123
  2. Webhook Endpoint:
    • Send webhooks to any path (e.g., http://localhost:13370/your/webhook/path).
    • The application captures and stores the request details.
  3. Dashboard:
    • View recent webhooks, including method, path, headers, data, and IP address.
    • Use the /get-webhooks endpoint to fetch webhook data via JavaScript.
  4. Statistics:
    • Access the /api/stats endpoint to retrieve request statistics.
  5. Clear History:
    • Use the /clear endpoint (POST) to clear the webhook history (requires authentication).
  6. Logout:
    • Click the logout link to end the session.

Configuration

  • Database: The application uses a SQLite database (webhooks.db) to store webhook data and user credentials.
  • Logging: Logs are stored in the logs/ directory with a maximum size of 10MB per file and up to 5 backup files.
  • Cache: The in-memory cache stores up to 50 recent webhooks for performance.
  • Cleanup: Old records (>30 days) are automatically deleted daily.

Endpoints

  • GET /login: Renders the login page.
  • POST /login: Handles user login.
  • GET /logout: Logs out the current user.
  • GET /dashboard: Displays the webhook dashboard (requires authentication).
  • GET /get-webhooks: Returns the cached webhook data as JSON.
  • POST /clear: Clears the webhook history (requires authentication).
  • GET /api/stats: Returns webhook statistics (requires authentication).
  • ANY /: Catches all webhook requests and stores them.

Security

  • Password Hashing: User passwords are hashed using SHA-256.
  • Session Management: Secure session handling with a randomly generated secret key.
  • Input Validation: Handles various input types (JSON, form data, query params) safely.
  • Error Handling: Logs errors and returns meaningful responses.

Logging

  • Logs are stored in logs/webhook.log with rotation to prevent excessive disk usage.
  • Example log entry:
    [2025-08-14 10:50:00] INFO in app: Webhook received: abc123 from 127.0.0.1 on path /test
    

Contributing

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/your-feature).
  3. Commit your changes (git commit -m 'Add your feature').
  4. Push to the branch (git push origin feature/your-feature).
  5. Create a Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For issues or suggestions, please open an issue on the GitHub repository.

Release files for demeter-tod 3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for demeter-tod 3.1
File Size Uploaded
demeter_tod-3.1.tar.gz 14.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for demeter-tod 3.1
File Interpreter ABI Platform
demeter_tod-3.1-py3-none-any.whl Python 3 none any Details

Total release size: 32.3 kB

Release files / demeter_tod-3.1.tar.gz

Download URL demeter_tod-3.1.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
aa40a6edb4b70ca92e686513b00e54bb617b887053609e1d48f9e79dcaedfd38
BLAKE2b-256 checksum
How to use checksums
eedccf18dfda1efe9f28961932df5944cb369e8c2c6ad43fbd81187bd430261d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / demeter_tod-3.1-py3-none-any.whl

Download URL demeter_tod-3.1-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b63ea66a5f3ef87f01b467e5daed92ecf4b63dadd27243497282e3cce90bc56
BLAKE2b-256 checksum
How to use checksums
2db03c6605f1f99475a7998170f8eead4cc5f43db2646c182800679e0a41d310
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

3.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page