Initial commit

This commit is contained in:
nora 2024-08-10 13:47:55 +02:00
commit 79f4a10d5f
7 changed files with 1645 additions and 0 deletions

21
README.md Normal file
View file

@ -0,0 +1,21 @@
# pretense
Server that listens on arbitary TCP ports and logs connections.
Connections are immediately closed once opened.
It logs connection attempts to stdout.
Additionally, prometheus metrics are exposed on `/metrics`.
## Configuration
Configuration is done via environment variables:
- `PRETENSE_PORTS` (required): Comma-separated list of TCP ports (u16 integers) to listen on.
Example: `23,1234`
- `PRETENSE_METRICS_PORT`: TCP Port (u16 integer) to serve the `/metrics` HTTP endpoint on.
If not set, no metrics are served.
Example: `2000`
## Note about privileged ports
When listening on a privileged port (on UNIX-like systems, 1-1023), you need permissions to bind on that port.
On Linux, this can be achieved by giving the binary the `CAP_NET_BIND_SERVICE` capability.