Skip to content

feat: auto DNS validation + unicorn.service systemd auto-setup on Hetzner#158

Merged
ruffy80 merged 2 commits into
mainfrom
copilot/configure-dns-ip-hetzner
Apr 13, 2026
Merged

feat: auto DNS validation + unicorn.service systemd auto-setup on Hetzner#158
ruffy80 merged 2 commits into
mainfrom
copilot/configure-dns-ip-hetzner

Conversation

Copilot AI commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Two silent failure modes in the Hetzner bootstrap: certbot would attempt (and fail) even when DNS hadn't propagated to the server IP, and unicorn.service was never created by setup-server.sh — only by the separately-invoked setup-systemd.sh.

setup-server.sh

New ETAPA 5.5 — unicorn.service creation

  • Delegates to setup-systemd.sh if present, otherwise writes units inline
  • Creates both pm2-{user}.service (PM2 resurrect on boot) and unicorn.service (direct Node.js fallback)
  • Validates node/pm2 binary paths before writing unit files; uses dirname instead of fragile %/node strip
  • systemctl enable both; auto-starts unicorn.service if backend port isn't already bound

DNS guard before certbot (ETAPA 6)

  • Resolves server public IP (tries ipify → ifconfig.me → ipecho → icanhazip)
  • Resolves zeusai.pro + www.zeusai.pro via getenthostdig fallback chain
  • If either record doesn't match: auto-sets SKIP_SSL=1, prints exact A records needed, and provides the manual certbot command — certbot is never invoked
⚠️  DNS: zeusai.pro → 1.2.3.4 ≠ IP server (5.6.7.8)
ℹ️   $DOMAIN     → 5.6.7.8
ℹ️   certbot --nginx -d zeusai.pro -d www.zeusai.pro --non-interactive ...

fix-server.sh

  • Section 3f now tries systemctl restart unicorn.service first before falling back to PM2 clean-start when the backend port is not listening
  • Final status report includes unicorn.service enabled/active state
  • Simplified redundant list-unit-files + is-enabled check to just is-enabled

@vercel

vercel Bot commented Apr 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
zeusai Ready Ready Preview, Comment Apr 13, 2026 9:02pm

Request Review

@ruffy80 ruffy80 marked this pull request as ready for review April 13, 2026 21:03
@ruffy80 ruffy80 merged commit f5c8e5b into main Apr 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants