Skip to content

GiesN/webhook-catcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webhook-catcher

Minimal HTTP webhook sink that stores events in SQLite.

Run

From the repo root:

  • uv run -m src.server.server

Optional: direct file run (adds import path explicitly):

  • PYTHONPATH=. uv run src/server/server.py

Server listens on http://127.0.0.1:8000.

How requests are handled

The server uses a threaded HTTP server (see src/server/server.py). Each incoming request is processed in its own thread. That means concurrent requests are handled in parallel (e.g. 30 requests → ~30 handler threads, subject to OS limits).

Within a single request, execution is synchronous/blocking (no async/await). Any shared resources must therefore be thread‑safe.

SQLite behavior in this repo

SQLite’s Python driver normally restricts a connection to the thread that created it. Because the server is multi‑threaded, a single shared connection would crash on the first request handled by another thread.

To avoid that in this project, the SQLite client:

  • Opens the connection with check_same_thread=False, allowing cross‑thread use.
  • Serializes all DB operations with a lock, so only one thread accesses SQLite at a time.

This is fine for local/dev or low‑throughput use. For scalable production, use a server‑grade DB (PostgreSQL/MySQL) with proper connection pooling instead of SQLite.

About

Webhook catcher optimized for running on a Raspberry Pi Zero 2 W

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages