feat: make domain/Cloudflare setup optional — IP-only deployments#6
feat: make domain/Cloudflare setup optional — IP-only deployments#6PhilippWu wants to merge 1 commit into
Conversation
Add ip_only and use_cloudflare flags so RemoteVibeServer can be deployed without a domain name or Cloudflare account. - configurator/cli.py: upfront 'Do you have a domain?' question sets ip_only=True and skips domain/CF steps; Cloudflare step now first asks 'Use Cloudflare?' and shows manual DNS table when answered No; Done section shows http://<server-ip> for IP-only configs - configurator/generator.py: add ip_only/use_cloudflare to default_config and _RVS_KEY_ORDER; compute coder_url dynamically in generate_cloud_init (empty for ip_only so setup.sh can fill it at boot); add IP_ONLY and USE_CLOUDFLARE to the env-file section of the cloud-init template - configurator/validators.py: _check_required_fields respects ip_only (only password required) and use_cloudflare=False (no CF fields required) - infra/dns.sh: graceful skip when IP_ONLY=true or CF creds absent; logs manual A-record instructions instead of aborting - infra/proxy.sh: plain HTTP Caddyfile (http://IP, no TLS) when IP_ONLY=true; EMAIL/FQDN only required for domain-based deployments - setup.sh: REQUIRED_VARS conditional on mode; FQDN overridden to PUBLIC_IP for ip_only; CODER_ACCESS_URL exported as http://IP or https://FQDN; Coder systemd unit and enable_coder_proxy updated to use CODER_ACCESS_URL - install.sh: CF key validation only warns when DOMAIN is set - docs/deployment.md: add IP-only Quickstart section; mark domain/CF as optional - tests: fix missing coder_admin_password in _full_config(); add 5 new preflight tests covering ip_only and use_cloudflare=False modes (250/250 passed)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec7aa3cc82
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| -X POST "${coder_api}/api/v2/users/first" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d "{\"email\":\"${EMAIL}\",\"username\":\"${admin_user}\",\"password\":\"${admin_pass}\",\"trial\":false}" \ | ||
| -d "{\"email\":\"${EMAIL:-admin@localhost}\",\"username\":\"${admin_user}\",\"password\":\"${admin_pass}\",\"trial\":false}" \ |
There was a problem hiding this comment.
Use the same fallback email for admin login
In push_coder_template(), this call creates the first admin user with admin@localhost when EMAIL is empty (the normal IP-only path), but the subsequent login request still posts "email":"${EMAIL}". That mismatch causes login/token creation to fail in IP-only deployments without an explicit email, so template push is skipped and the server comes up without the expected default workspace template/token setup.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
Adds an IP-only deployment path (no domain / no Cloudflare) so RemoteVibeServer can be provisioned and accessed over plain HTTP on the server’s public IP, while still supporting domain-based deployments with optional manual DNS.
Changes:
- Introduces
ip_onlyanduse_cloudflareconfigurator flags and updates cloud-init generation to support both modes. - Updates provisioning scripts to skip DNS automation and write HTTP-only Caddy configs in IP-only mode, and to compute/access Coder URL consistently.
- Extends validators and tests to cover required-fields logic across the new deployment modes; updates deployment docs with an IP-only quickstart.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| install.sh | Adjusts post-config “quick validation” required keys based on deployment mode. |
| dev-server-provision/setup.sh | Makes required env vars conditional; sets CODER_ACCESS_URL for IP-only vs domain; updates Caddy live proxy config and status output. |
| dev-server-provision/infra/proxy.sh | Writes a maintenance Caddyfile suitable for IP-only (HTTP) deployments and relaxes domain/email validation in that mode. |
| dev-server-provision/infra/dns.sh | Skips Cloudflare automation when IP-only or when Cloudflare credentials are missing; prints manual DNS guidance. |
| dev-server-provision/docs/deployment.md | Marks domain/Cloudflare as optional and documents an IP-only quickstart flow. |
| dev-server-provision/configurator/validators.py | Makes required-field preflight checks mode-aware (ip_only, use_cloudflare). |
| dev-server-provision/configurator/tests/test_validators.py | Adds tests for IP-only and manual-DNS modes; fixes _full_config() missing password. |
| dev-server-provision/configurator/generator.py | Adds flags to defaults and YAML ordering; computes coder_url and emits new env vars in cloud-init. |
| dev-server-provision/configurator/cli.py | Adds “Do you have a domain?” and “Use Cloudflare?” prompts; prints manual DNS record table when Cloudflare is declined. |
| log "Creating first Coder admin user (${EMAIL:-admin@localhost}, username: ${admin_user}) …" | ||
| local resp_body resp_code | ||
| resp_body="$(mktemp)" | ||
| resp_code="$(curl -s -o "$resp_body" -w '%{http_code}' \ | ||
| -X POST "${coder_api}/api/v2/users/first" \ |
| if [[ "$IP_ONLY_VAL" != "true" && -n "$DOMAIN" ]]; then | ||
| REQUIRED_KEYS=(DOMAIN SUBDOMAIN EMAIL CLOUDFLARE_API_TOKEN CLOUDFLARE_ZONE_ID) | ||
| else | ||
| REQUIRED_KEYS=(CODER_ADMIN_PASSWORD) | ||
| fi |
Summary
Closes #1
Users can now deploy RemoteVibeServer without a domain name or Cloudflare account. Two new flags drive the behaviour:
ip_only: true— no domain, no TLS; Coder is served via plain HTTP on the public IP (port 80 via Caddy)use_cloudflare: false— domain provided but DNS managed manually; DNS record table shown in the CLIChanges
Configurator (Python)
cli.py: New upfront question "Do you have a domain?" — No setsip_only=Trueand skips all domain/CF steps. Cloudflare step now first asks "Use Cloudflare?" and prints a manual DNS record table when declined. Done section shows correct URL.generator.py:ip_onlyanduse_cloudflareadded todefault_config(),_RVS_KEY_ORDER, and cloud-init template.generate_cloud_init()computescoder_urldynamically (empty for ip_only —setup.shfills it at boot).validators.py:_check_required_fieldsrespects modes — ip_only requires only the password; use_cloudflare=False drops CF fields.Shell scripts
infra/dns.sh: Graceful skip whenIP_ONLY=trueor CF credentials absent; logs manual A-record instructions.infra/proxy.sh: Writes plain-HTTP Caddyfile (http://IP) for ip_only; skips FQDN/EMAIL validation in that mode.setup.sh:REQUIRED_VARSconditional on mode;FQDNoverridden toPUBLIC_IPfor ip_only;CODER_ACCESS_URLexported correctly for both modes; Coder systemd unit andenable_coder_proxy()updated to useCODER_ACCESS_URL.install.sh: CF key warning only whenDOMAINis set.Tests & docs
coder_admin_passwordmissing from_full_config()helper.docs/deployment.md: domain/CF prerequisites marked optional; new IP-only Quickstart section.