How antun3s/web-snitch works
Project type and purpose
• Web Snitch is a tiny, single‐service web application packaged in a Docker container.
• Its sole responsibility is to report server environment details (IP, hostname, uptime) and client connection info (IP, headers) as plain text via HTTP.
File structure
• Top‐level files only:
• Dockerfile – builds the container image (Python 3.12 on Alpine, installs dependencies).
• app.py – a Flask app that defines a single route ("/") to gather system and request info.
• requirements.txt – Flask dependency.
• README.md – usage and technical notes.
• No frontend directory, no database, no external microservices.
README for additional insights
• Confirms the tech stack: Python 3.12, Alpine Linux, Flask web server.
• Confirms container size (~61 MB), exposes port 8080, no styling, plain text output.
Main components and interactions
a. Client
• Browser or CLI (curl) sending HTTP GET to host:8080.
b. Docker Host
• Docker Engine listens on host port 8080, routes traffic into container port 8080.
c. Container
• Alpine‐based Linux OS
• Python runtime + Flask
• app.py grabs:
• OS calls for IP, hostname, uptime
• HTTP request metadata for client IP and headers
d. Response
• Flask serializes data into plain‐text payload, returns HTTP 200.
Architectural patterns and principles
• Single‐service “microservice” style: small surface area, one HTTP endpoint.
• Containerization for isolation and reproducible environment.
• Minimal OS layer (Alpine) to reduce attack surface and image size.
Technologies, frameworks, libraries
• Docker + Dockerfile (Alpine Linux base, Python 3.12)
• Flask (lightweight Python web framework)
• Standard Python libraries / OS calls for hostname, IP, uptime