Configuration
The server reads environment variables, or a TOML file with hod-server --config FILE (or HOD_CONFIG); environment variables override the file.
Basics
Database
Jobs, storage and caches
Connections and limits
TLS, secrets and sign-in
Forges
Limits
The server protects itself without a proxy in front. Besides the settings above, these limits are fixed:
What a client sees:
- A closed connection, when the server has too many connections, or when the client is too slow to send a request or read a response.
429 Too Many Requests, past a rate limit, withRetry-Afterand the problemcoderate_limited; past a stream cap, withRetry-After: 5and thecodetoo_many_streams.503 Service Unavailablewith an RFC 9457 problem document (API reference). Itscodeisoverloaded, withRetry-After: 1, when too many requests are in flight. It istimeoutwhen a request took longer thanHOD_REQUEST_TIMEOUT. Event streams, downloads, blob uploads, the git proxy and runners are not cut off by it. A request that times out may still have made its change, as when a connection drops.
The server raises its open-file limit to the system's maximum. If that is still too low for HOD_MAX_CONNECTIONS, it serves fewer connections and logs a warning: raise the limit (ulimit -n, or nofile in Docker or systemd).
Rate limits
Each limit is a number of requests a minute, and all of them may come at once: a client that used them all gets one more every 60/N seconds.
Health checks, the web UI's static files, blob transfers, runners and forge webhooks aren't limited. An IPv6 client counts by its /64.
The counts are kept in memory on each server: with several servers behind a load balancer, a client may get up to the limit times the number of servers.
Behind a reverse proxy, set HOD_TRUSTED_PROXIES. Without it every client's address is the proxy's, and all anonymous visitors share one limit.
hod sends a read that got 429 or 503 once more by itself when Retry-After is 10 seconds or less.
Stream caps
Event, log and log-row streams (the web UI's live updates and log view, hod logs -f) stay open for as long as the client keeps them. The caps limit how many are open at once: per signed-in user (the admin token counts as one user), per client address for anonymous viewers of public projects, and on the whole server. A browser tab holds one or two; hod logs -f holds one per running job.
Past a cap, a new stream gets 429 with Retry-After: 5, and streams already open are left alone. The web UI and hod try again by themselves. Like rate limits, the counts are kept on each server, and an IPv6 client counts by its /64. Behind a reverse proxy, set HOD_TRUSTED_PROXIES: without it, all anonymous viewers share the proxy's address, and so one cap of 32 streams.
Outbound requests
Any org member can trigger a run of any repository URL, and the server fetches the pipeline file from it. So that nobody can use the server to reach the network behind it, a repository URL that isn't under a configured forge's URL (Forgejo, GitLab, GitHub):
- must resolve to public addresses only: not loopback, private (RFC 1918,
fc00::/7), link-local, CGNAT (100.64.0.0/10) or other special-purpose ranges, in any form, IPv4-mapped IPv6 and NAT64 included. The addresses checked are the ones connected to, so a name that resolves differently the second time gains nothing; - follows no redirects.
A refused URL gets one fixed message, <host> resolves to an address Hod doesn't fetch from (private, loopback or link-local); see HOD_OUTBOUND_ALLOW, whatever the address was.
To fetch from a git server on your own network that isn't a configured forge, allow it with HOD_OUTBOUND_ALLOW (outbound_allow = [...] in the file): by name (git.lan, matched exactly, and then any address it resolves to), by address or CIDR (10.1.0.0/16), or private_ranges for all of loopback and the private ranges. Cloud metadata services are never fetched from, whatever the setting says: 169.254.169.254, fd00:ec2::254, 100.100.100.200 and 192.0.0.192.
With HTTPS_PROXY (or HTTP_PROXY, ALL_PROXY) set, the server only sees the proxy's address, so the proxy decides what can be reached: restrict it there. The proxy's own name is allowed, even when it resolves to a private address.
file:// URLs, which only HOD_GIT_PROTOCOLS=file allows, read repositories on the server's own disk and aren't checked: don't allow file on a server members you don't trust can reach.
Repositories on configured forges, forge APIs, sign-in providers and component registries are set by the admin and aren't checked.
Security headers
Every response carries:
X-Content-Type-Options: nosniffReferrer-Policy: same-origin: Hod's URLs, which name orgs, projects and branches, aren't sent to other sitesCross-Origin-Opener-Policy: same-originandCross-Origin-Resource-Policy: same-originContent-Security-Policy: default-src 'none'; frame-ancestors 'none'andX-Frame-Options: DENY; the web UI's pages and the sign-in pages have stricter policies of their own, which still forbid framingStrict-Transport-Security: max-age=31536000whenHOD_PUBLIC_URLis https, whether the server or a proxy in front ends TLS. It covers only this host: noincludeSubDomains, nopreload
API responses (/api/) also carry Cache-Control: no-store, so neither the browser nor a shared cache keeps them: some show a secret once.
API responses that set their own caching keep it: the OIDC discovery document and JWKS, and hod-runner downloads (public, max-age=300).
Blob downloads from the server's own storage are application/octet-stream, with Content-Disposition: attachment, Content-Security-Policy: sandbox and Cache-Control: private, no-store, so a browser saves them and never runs them as a page. With s3:// storage, runners fetch blobs from the bucket, and the bucket's settings apply.
If a reverse proxy in front adds its own Strict-Transport-Security, set HOD_HSTS_MAX_AGE=0, or drop it from the proxy: two HSTS headers on one response are an error some scanners flag, and browsers use only the first.