cloudflare
Technical notes on web development, DevOps, and AI integration.
11 articles
- 23:02devops
Closing the Door Does Not Hide the Drawers
The deploy port was closed, yet /.git/ stayed readable through the staging hostname. Next: an nginx edge regex guard and an api/db network split.
TL;DR: Closing the inbound port didn't protect a staging server still serving .git and .env files over its tunnel. The fix needs three layers: nginx edge rules denying dot-paths, server_tokens off, and explicit Docker networks isolating services. Each layer covers what the others miss; any one alone leaves the same exposed drawers.
#nginx#docker#devops - 22:31devops
Frozen Staging Deploys: When a Tunnel Replaces the Ritual
The inbound deploy port is gone: KotaPortal staging is now served through an outbound-only tunnel, with no per-commit deploy ritual.
TL;DR: After a Cloudflare Tunnel took over backend staging, the per-commit deploy job disappeared, replaced by a persistent staging link that updates as the origin refreshes. The tunnel is outbound-only on port 7844, so the origin needs no public IP and loses its scannable deploy port, a real security win. Frontend keeps preview hosting; most 502s mean a wrong Service URL.
#cloudflare#cloudflared#deployment - 04:43backend
The Client IP You Can Actually Trust
The first X-Forwarded-For entry is attacker-controlled. Which address behind Cloudflare and nginx actually deserves a rate limiter's trust.
TL;DR: A burst of password guesses on an admin login exposed a flaw: the rate limiter trusted an attacker-controlled X-Forwarded-For entry. The fix prefers Cloudflare's CF-Connecting-IP header, then the last proxy entry, then X-Real-IP, and finally the raw connection address. Per-account keys pairing IP with email, 429 responses with Retry-After, and bounded memory keep the limiter effective.
#go#security#nginx - 04:24backend
Stealth Proxies Cannot Buy a Captcha That Measures the Browser
Stealth proxies beat WAF walls and die at browser-measuring captcha gates.
TL;DR: Stealth proxies hit captcha walls, not WAFs: Jakarta Selatan hid Cloudflare Turnstile, Jakarta Pusat ran reCAPTCHA v2. Real browsers cleared both—Chromium passed Turnstile untouched; a Firefox anti-detect profile solved reCAPTCHA with Tab plus Space, no solver service. Detail pages need live sessions, so the build now tiers access: proxies for WAFs, browsers for captchas, supervised runs for Jakarta Pusat.
#scraping#captcha#browser-automation - 21:53devops
A 502 from Cloudflare Tunnel, caused by a compose service name
The tunnel said 502 while every container was green. Compose DNS only knows service names, and a six-line alias solved it in one step.
TL;DR: Public URL returned 502 while everything looked healthy and curl to the proxy worked fine. Ingress pointed to proxy on port 8199 but the service is actually plane-proxy, so Docker DNS had no record and cloudflared couldn't reach the origin. Adding a network alias proxy to plane-proxy fixed it, keeping the name stable for anything outside the repo.
#docker#compose#cloudflared - 21:07devops
Self-hosting Plane without a single public port
A 13-service Plane stack on a single-admin VPS: a cloudflared sidecar as the only public door, bind-mounted state, and no public host ports.
TL;DR: Running Plane on a packed VPS clashed with its default host ports 80 and 443. I kept the 13-service stack fully internal and exposed it only via a Cloudflare Tunnel sidecar aimed at the proxy, not port 8000 which is just the API. This keeps the firewall to SSH only, handles TLS at the edge, and removes public port exposure.
#self-hosting#plane#docker - 20:30devops
Switching Deploys to Vercel: The Lock Is Outside the Code
The diff was docs-only, yet the deploy migration from Cloudflare Workers to Vercel still happened. The wiring lives in the Vercel dashboard and GitHub settings, not in the repo.
TL;DR: A docs-only commit revealed the Workers-to-Vercel migration left almost no trace in Git, since the wiring lives in Vercel and GitHub settings. Vercel elects the production branch only at import, so the GitHub default branch stag and production branch main are two independent switches. Env variables need per-target re-registration, and rollback is repointing a deployment, not git revert.
#vercel#cloudflare#git - 18:50devops
Naming a Loopback Forgejo Through hosts and ROOT_URL
A local domain via /etc/hosts plus DOMAIN and ROOT_URL in Forgejo, and the 100 MB Cloudflare upload cap that makes the SSH path the sensible choice.
#forgejo#dns#cloudflare - 10:38devops
Blamed on DDoS, the Nginx Logs Disagreed
An hourly wave of 504s looked like an attack. The logs pointed at a dormant rate limit and a PHP-FPM pool out of workers.
TL;DR: Hourly 504 waves looked like a DDoS but were actually PHP-FPM worker exhaustion, worsened by request_terminate_timeout killing slow requests. Nginx rate limiting never fired because Cloudflare hid real client IPs, collapsing everyone into one $binary_remote_addr bucket. Fixes: enable Cloudflare caching, tune PHP-FPM pool settings, and rotate container logs with copytruncate.
#nginx#docker#cloudflare