A simple but powerful Flask application for receiving, logging, and monitoring webhooks. Built for developers who need to debug and test webhook integrations.
Project description
Demeter
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
- Clone the repository:
pip install demeter-tod
- Run the application:
demeter
The application will start onhttp://0.0.0.0:13370.
Usage
- Access the Application:
- Open your browser and navigate to
http://localhost:13370. - Log in with the default credentials:
- Username:
anonre - Password:
hackerbiasa123
- Username:
- Open your browser and navigate to
- Webhook Endpoint:
- Send webhooks to any path (e.g.,
http://localhost:13370/your/webhook/path). - The application captures and stores the request details.
- Send webhooks to any path (e.g.,
- Dashboard:
- View recent webhooks, including method, path, headers, data, and IP address.
- Use the
/get-webhooksendpoint to fetch webhook data via JavaScript.
- Statistics:
- Access the
/api/statsendpoint to retrieve request statistics.
- Access the
- Clear History:
- Use the
/clearendpoint (POST) to clear the webhook history (requires authentication).
- Use the
- 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.logwith 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
- Fork the repository.
- Create a feature branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -m 'Add your feature'). - Push to the branch (
git push origin feature/your-feature). - 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file demeter_tod-3.1.tar.gz.
File metadata
- Download URL: demeter_tod-3.1.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa40a6edb4b70ca92e686513b00e54bb617b887053609e1d48f9e79dcaedfd38
|
|
| MD5 |
2ab12ee4f625e3fa154a83f03e394525
|
|
| BLAKE2b-256 |
eedccf18dfda1efe9f28961932df5944cb369e8c2c6ad43fbd81187bd430261d
|
File details
Details for the file demeter_tod-3.1-py3-none-any.whl.
File metadata
- Download URL: demeter_tod-3.1-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b63ea66a5f3ef87f01b467e5daed92ecf4b63dadd27243497282e3cce90bc56
|
|
| MD5 |
dc62239775511f7f6a9287a35001e8a0
|
|
| BLAKE2b-256 |
2db03c6605f1f99475a7998170f8eead4cc5f43db2646c182800679e0a41d310
|