The Simplest Way to Make Caddy and Teamcity Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Running caddy and teamcity together gives your build server safe HTTPS web traffic. Caddy handles TLS certificates while TeamCity runs your automated code builds and tests. Teams often struggle to expose a build server to webhooks and remote developers. Plain HTTP leaves build logs, deploy keys, and source code open to network snooping. Setting up TLS by hand takes too much time and breaks when certificates expire. Pairing these two tools fixes web routing and keeps certificate renewals automat

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Running caddy and teamcity together gives your build server safe HTTPS web traffic. Caddy handles TLS certificates while TeamCity runs your automated code builds and tests.

Teams often struggle to expose a build server to webhooks and remote developers. Plain HTTP leaves build logs, deploy keys, and source code open to network snooping. Setting up TLS by hand takes too much time and breaks when certificates expire. Pairing these two tools fixes web routing and keeps certificate renewals automatic.

How traffic and logins flow between caddy and teamcity

Caddy sits at the network edge and listens for incoming web requests. It gets and renews TLS certificates without human work. When a developer or webhook hits your build URL, Caddy takes the encrypted request. It then forwards that traffic over a local network path to the TeamCity server.

TeamCity needs to know the original client IP address and protocol to work right. Caddy passes standard forwarding headers so the build server sees the true host name. This keeps login redirects and webhook callbacks working without port mismatches. WebSockets also flow through this path so build logs update live in the browser.

Build agents also talk to the main server over this same web path. Agents pull build steps, run tests, and send back artifacts and test results. Keeping Caddy in front ensures every agent talk uses strong encryption in transit.

Common failure modes and how to scope access

A common mistake is leaving the build server port open to the public internet. If users can bypass the web server, TLS rules do not matter at all. Bind the TeamCity server port to localhost or a private subnet only. Only the Caddy host should have network clearance to reach that backend port.

Shared admin accounts inside the build tool create another major security risk. When everyone logs in with one root user, you lose track of who changed build steps. Give each developer their own login tied to an identity provider. Scope project roles so teams can only run and edit their own builds.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Broad API tokens stored in build scripts also cause big problems during leaks. If a build agent holds a wide token, any bad commit can read all secrets. Scope tokens to single projects and give them read-only rights whenever you can. Rotate agent keys on a set schedule and log every build trigger event.

Keeping build logs and artifacts clean

Build logs often print out sensitive data when a test or script fails. Developers might dump database results or request payloads straight into the console output. If those logs contain customer emails, phone numbers, or card numbers, anyone with build view rights can read them.

Keep raw production data out of test runs and build steps from the start. Where live data touches a pipeline, masking rewrites matched fields like national IDs or card numbers in results. Combine clean logs with strict role limits so build history stays safe during audits.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

Why do TeamCity build pages fail to update live behind Caddy?

Live build logs rely on WebSockets to push text updates to your browser. Check that your Caddy routing rules allow connection upgrades and do not buffer streaming responses.

How do I stop users from bypassing Caddy to reach TeamCity directly?

Set the TeamCity listen address to the local loopback interface or a private internal network. Use host firewall rules to block all public traffic to the backend port.

Should build agents talk to TeamCity through Caddy or on a local port?

Remote agents outside your private network should always route through Caddy over HTTPS. Local agents on the same private network can talk over an internal subnet if firewall rules allow it.

The query runs. The emails stay hidden.