frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: A dynamic key-value IP allowlist for Nginx

https://github.com/dayt0n/kvauth
2•dayt0n•4h ago
I am currently working on a larger project that needs a short-lived HTTP "auth" based on a separate, out-of-band authentication process. Since every allowed IP only needs to be allowed for a few minutes at a time on specific server names, I created this project to solve that. It should work with any Redis-compatible database. For the docker-compose example, I used valkey.

This is mostly useful if you have multiple domains that you want to control access to. If you want to allow 1.1.1.1 to mywebsite.com and securesite.com, and 2.2.2.2 to securesite.com and anothersite.org for certain TTLs, you just need to set hash keys in your Redis-compatible database of choice like:

1.1.1.1:

  - mywebsite.com: 1 (30 sec TTL)

  - securesite.com: 1 (15 sec TTL)
2.2.2.2:

  - securesite.com: 1 (3600 sec TTL)

  - anothersite.org: 1 (never expires)
Since you can use any Redis-compatible database as the backend, per-entry TTLs are encouraged.

An in-process cache can also be used, but is not enabled unless you pass --enable-l1-cache to kvauth. That makes successful auth_requests a lot faster since the program is not reaching out to the key/value database on every request.

I didn't do any hardcore profiling on this but did enable the chi logger middleware to see how long requests generally took:

kvauth-1 | 2025/12/30 21:32:28 "GET http://127.0.0.1:8888/kvauth HTTP/1.0" from 127.0.0.1:42038 - 401 0B in 300.462µs # disallowed request

nginx-1 | 192.168.65.1 - - [30/Dec/2025:21:32:28 +0000] "GET / HTTP/1.1" 401 179 "-" "curl/8.7.1"

kvauth-1 | 2025/12/30 21:32:37 "GET http://127.0.0.1:8888/kvauth HTTP/1.0" from 127.0.0.1:40160 - 401 0B in 226.189µs # disallowed request

nginx-1 | 192.168.65.1 - - [30/Dec/2025:21:32:37 +0000] "GET / HTTP/1.1" 401 179 "-" "curl/8.7.1"

# IP added to redis allowlist

kvauth-1 | 2025/12/30 21:34:02 "GET http://127.0.0.1:8888/kvauth HTTP/1.0" from 127.0.0.1:54032 - 200 0B in 290.648µs # allowed, but had to reach out to valkey

kvauth-1 | 2025/12/30 21:34:02 "GET http://127.0.0.1:8888/kvauth HTTP/1.0" from 127.0.0.1:54044 - 200 0B in 4.041µs

nginx-1 | 192.168.65.1 - - [30/Dec/2025:21:34:02 +0000] "GET / HTTP/1.1" 200 111 "-" "curl/8.7.1"

kvauth-1 | 2025/12/30 21:34:06 "GET http://127.0.0.1:8888/kvauth HTTP/1.0" from 127.0.0.1:51494 - 200 0B in 6.617µs # allowed, used cache

kvauth-1 | 2025/12/30 21:34:06 "GET http://127.0.0.1:8888/kvauth HTTP/1.0" from 127.0.0.1:51496 - 200 0B in 3.313µs

nginx-1 | 192.168.65.1 - - [30/Dec/2025:21:34:06 +0000] "GET / HTTP/1.1" 200 111 "-" "curl/8.7.1

IP allowlisting isn't true authentication, and any production implementation of this project should use it as just a piece of the auth flow. This was made to solve the very specific problem of a dynamic IP allow list for NGINX.

Show HN: 22 GB of Hacker News in SQLite

https://hackerbook.dosaygo.com
359•keepamovin•10h ago•115 comments

Show HN: RAMBnB.xyz P2P marketplace for RAM rentals

https://www.rambnb.xyz
9•olivierroy•3h ago•1 comments

Show HN: One clean, developer-focused page for every Unicode symbol

https://fontgenerator.design/symbols
166•yarlinghe•5d ago•66 comments

Show HN: I remade my website in the Sith Lord Theme and I hope it's fun

https://cookie.engineer/index.html
28•cookiengineer•9h ago•12 comments

Show HN: Tidy Baby is a SET game but with words

https://tidy.baby
29•brgross•11h ago•6 comments

Show HN: A Claude Code plugin that catch destructive Git and filesystem commands

https://github.com/kenryu42/claude-code-safety-net
55•kenryu•5d ago•57 comments

Show HN: Brainrot Translator – Convert corporate speak to Gen Alpha and back

https://brainrottranslator.com
18•todaycompanies•10h ago•2 comments

Show HN: Replacing my OS process scheduler with an LLM

https://github.com/mprajyothreddy/brainkernel
15•ImPrajyoth•10h ago•6 comments

Show HN: Stop Claude Code from forgetting everything

https://github.com/mutable-state-inc/ensue-skill
181•austinbaggio•1d ago•215 comments

Show HN: A dynamic key-value IP allowlist for Nginx

https://github.com/dayt0n/kvauth
2•dayt0n•4h ago•0 comments

Show HN: Claude Cognitive – Working memory for Claude Code

https://github.com/GMaN1911/claude-cognitive
4•MirrorEthic•4h ago•1 comments

Show HN: Superset – Terminal to run 10 parallel coding agents

https://superset.sh/
95•avipeltz•1w ago•88 comments

Show HN: A 45x45 Connections Puzzle To Commemorate 2025=45*45

https://thomaswc.com/2025.html
73•thomaswc•1w ago•28 comments

Show HN: Aroma: Every TCP Proxy Is Detectable with RTT Fingerprinting

https://github.com/Sakura-sx/Aroma
80•Sakura-sx•5d ago•49 comments

Show HN: See what readers who loved your favorite book/author also loved to read

https://shepherd.com/bboy/2025
125•bwb•1d ago•37 comments

Show HN: Z80-μLM, a 'Conversational AI' That Fits in 40KB

https://github.com/HarryR/z80ai
491•quesomaster9000•1d ago•117 comments

Show HN: My not-for-profit search engine with no ads, no AI, & all DDG bangs

https://nilch.org
193•UnmappedStack•1d ago•74 comments

Show HN: Euclidle – Guess the Coordinates in N‑Dimensional Space

https://euclidle.com/
17•bills-appworks•4d ago•7 comments

Show HN: Slide notes visible only to you during screen sharing

https://cuecard.dev
2•thisisnsh•9h ago•0 comments

Show HN: Cck ClaudeCode file change tracking and auto Claude.md

4•takawasi•10h ago•0 comments

Show HN: MCP Mesh – one endpoint for all your MCP servers (OSS self-hosted)

https://github.com/decocms/mesh
7•gadr90•10h ago•0 comments

Show HN: Spacelist, a TUI for Aerospace window manager

https://github.com/magicmark/spacelist
41•markl42•4d ago•6 comments

Show HN: Financial calculators with no tracking, no signup, no email gates

https://www.financialaha.com/financial-calculators/
3•stefanneculai•11h ago•0 comments

Show HN: Flipper Zero MCP – Control Your Flipper Using AI via USB or WiFi

https://github.com/busse/flipperzero-mcp
2•busseio•11h ago•0 comments

Show HN: Minimum Viable Parents (MVP)

https://yaz.zone/essays/mvp
3•plawlost•11h ago•0 comments

Show HN: Per-instance TSP Solver with No Pre-training (1.66% gap on d1291)

18•jivaprime•1d ago•3 comments

Show HN: Tetris Time

https://tetris-time.koenvangilst.nl/?mode=countdown&to=2026-01-01T00:00:00.000Z&speed=3
8•vnglst•17h ago•3 comments

Show HN: Lazy-image – Node.js image library with static binaries (Rust/NAPI)

https://github.com/albert-einshutoin/lazy-image
4•einshutoin•17h ago•1 comments

Show HN: Mysti – Claude, Codex, and Gemini debate your code, then synthesize

https://github.com/DeepMyst/Mysti
215•bahaAbunojaim•1w ago•177 comments

Show HN: Vibe coding a bookshelf with Claude Code

https://balajmarius.com/writings/vibe-coding-a-bookshelf-with-claude-code/
276•balajmarius•1d ago•208 comments