2.3 KiB
2.3 KiB
Cloudflare DNS + Home Network Setup for git.bhatfamily.in
Goal
Expose local Gitea securely from home network while preserving Git-over-SSH support.
Recommended Cloudflare DNS records
Create DNS records in Cloudflare for zone bhatfamily.in:
Arecord- Name:
git - Content: your home public IPv4
- Proxy status: DNS only (gray cloud)
- Name:
- Optional
AAAArecord- Name:
git - Content: your home public IPv6
- Proxy status: DNS only
- Name:
Why DNS-only is recommended
This setup uses direct inbound routing for both HTTPS and custom SSH (2222 by default). DNS-only avoids Cloudflare proxy protocol limitations around direct SSH forwarding.
Router/NAT rules
Create forwards to this server's LAN IP:
- TCP 80 ->
<server_lan_ip>:80(ACME challenge + redirect) - TCP 443 ->
<server_lan_ip>:443(HTTPS via Caddy) - TCP 2222 ->
<server_lan_ip>:2222(Git SSH)
Firewall alignment
If UFW is active, use install flag to open public web ports:
./scripts/install.sh --with-tls --open-public-webTo close those later:./scripts/uninstall.sh --with-tls --close-public-web
ISP constraints check
Some ISPs block inbound ports. Validate from outside your network:
curl -I https://git.bhatfamily.innc -vz git.bhatfamily.in 2222If blocked, use alternate routing (VPN/tunnel) or ISP-compatible ports.
Recommended hardening
- Keep strong secrets in
.env - Restrict SSH source ranges if practical
- Keep containers patched (
docker compose pulland recreate) - Add off-host backups for gitea/postgres/caddy data directories
Post-cutover verification checklist
Run these after DNS/NAT/firewall updates to confirm end-to-end readiness:
- DNS resolution
dig +short git.bhatfamily.in A
- HTTPS response and redirect chain
curl -I https://git.bhatfamily.incurl -I http://git.bhatfamily.in
- Certificate validity/issuer
openssl s_client -connect git.bhatfamily.in:443 -servername git.bhatfamily.in </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates
- Git SSH port reachability
nc -vz git.bhatfamily.in 2222
- Stack self-check
./scripts/test.sh --with-tlsIf any check fails during first-time propagation, run:
./scripts/test.sh --with-tls --allow-pending-externalThen re-run strict checks once DNS/certificate propagation completes.