Metadata-Version: 2.3
Name: justserver
Version: 0.1.43
Summary: 
Author: Knspar
Author-email: knspar@proton.me
Requires-Python: >=3.12,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: dynaconf (>=3.2.10,<4.0.0)
Requires-Dist: fastapi (>=0.115.12,<0.116.0)
Requires-Dist: httpx (>=0.28.1,<0.29.0)
Requires-Dist: ipython (>=9.1.0,<10.0.0)
Requires-Dist: kubernetes (>=32.0.1,<33.0.0)
Requires-Dist: loguru (>=0.7.3,<0.8.0)
Requires-Dist: pudb (>=2024.1.3,<2025.0.0)
Requires-Dist: pydantic (>=2.11.2,<3.0.0)
Requires-Dist: typer (>=0.15.2,<0.16.0)
Requires-Dist: uvicorn (>=0.34.0,<0.35.0)
Description-Content-Type: text/markdown

# JustServer

JustServer is a FastAPI-based service designed to manage multiple `justniffer` network sniffing instances in a concurrent, secure, and efficient manner. It exposes a simple RESTful interface for starting, stopping, listing, and restarting sniffers across network interfaces.

## 🚀 Features

- 🔐 API key protection on all operational routes
- 🧵 ThreadPoolExecutor for parallel instance handling
- ⚙️ Dynamic justniffer process spawning with configurable filters and encodings
- 📦 Built-in lifecycle management using FastAPI's `lifespan`
- 💻 Easy process tracking and UUID-based control

## 📦 API Endpoints

All operational endpoints are secured via the `X-API-Key` header.

- `POST /start`: Launch a new justniffer process
- `POST /stop/{uuid}`: Stop a specific sniffer instance
- `POST /stop-all`: Stop all running instances
- `POST /restart`: Restart with new settings
- `GET /list`: List active sniffer processes
- `GET /health`: Health check (unauthenticated)

## 🛠️ Configuration

JustServer uses environment-based configuration via `justserver.daemon.settings`. Key settings:

- `JUSTSERVER_API_KEY`: API key for authentication
- `JUSTSERVER_MAX_INSTANCES`: Maximum concurrent sniffer processes
- `JUSTSERVER_JUSTNIFFER_CMD`: Base justniffer executable command

## 🧪 Example Usage

```bash
curl -X POST http://localhost:8000/start \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"interface": "eth0", "filter": "tcp port 80"}'

