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.
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)
| File | Size | Uploaded | |
|---|---|---|---|
| demeter_tod-3.1.tar.gz | 14.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|