Skip to content

feat: make domain/Cloudflare setup optional — IP-only deployments#6

Open
PhilippWu wants to merge 1 commit into
mainfrom
feat/1-ip-only-deployments
Open

feat: make domain/Cloudflare setup optional — IP-only deployments#6
PhilippWu wants to merge 1 commit into
mainfrom
feat/1-ip-only-deployments

Conversation

@PhilippWu
Copy link
Copy Markdown
Owner

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 CLI

Changes

Configurator (Python)

  • cli.py: New upfront question "Do you have a domain?" — No sets ip_only=True and 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_only and use_cloudflare added to default_config(), _RVS_KEY_ORDER, and cloud-init template. generate_cloud_init() computes coder_url dynamically (empty for ip_only — setup.sh fills it at boot).
  • validators.py: _check_required_fields respects modes — ip_only requires only the password; use_cloudflare=False drops CF fields.

Shell scripts

  • infra/dns.sh: Graceful skip when IP_ONLY=true or 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_VARS conditional on mode; FQDN overridden to PUBLIC_IP for ip_only; CODER_ACCESS_URL exported correctly for both modes; Coder systemd unit and enable_coder_proxy() updated to use CODER_ACCESS_URL.
  • install.sh: CF key warning only when DOMAIN is set.

Tests & docs

  • Fix pre-existing bug: coder_admin_password missing from _full_config() helper.
  • 5 new preflight tests covering ip_only and use_cloudflare=False modes.
  • 250/250 tests pass.
  • docs/deployment.md: domain/CF prerequisites marked optional; new IP-only Quickstart section.

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)
Copilot AI review requested due to automatic review settings April 10, 2026 13:04
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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}" \
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_only and use_cloudflare configurator 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.

Comment on lines +223 to 227
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" \
Comment thread install.sh
Comment on lines +125 to +129
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
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.

feat: Make domain/Cloudflare setup optional — support IP-only deployments

2 participants