From 4a4cfab9ee92c0b252d2e25b53abfd10426689c8 Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Sat, 7 Mar 2026 15:16:53 -0700 Subject: [PATCH] feat: add Drupal Site app with 200-only healthcheck MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a second app icon alongside DDEV Web: - DDEV Web: lights up when ddev starts (any 2xx/3xx from port 80) - Drupal Site: lights up only when Drupal returns non-5xx from /user/login — dim during setup (500 from missing DB), bright after drush si completes Uses Iconify API for a white check-circle icon visible on dark backgrounds. Co-Authored-By: Claude Sonnet 4.6 --- drupal-core/template.tf | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drupal-core/template.tf b/drupal-core/template.tf index 6fe158c..b745b0e 100644 --- a/drupal-core/template.tf +++ b/drupal-core/template.tf @@ -1339,6 +1339,8 @@ resource "coder_app" "ddev-web" { subdomain = true share = "owner" + # Healthy when ddev is running and the web server responds (any 2xx/3xx). + # Lights up as soon as `ddev start` completes, before Drupal is installed. healthcheck { url = "http://localhost:80" interval = 10 @@ -1346,6 +1348,27 @@ resource "coder_app" "ddev-web" { } } +resource "coder_app" "drupal-site" { + agent_id = coder_agent.main.id + slug = "drupal-site" + display_name = "Drupal Site" + order = 2 + url = "http://localhost:80" + icon = "https://api.iconify.design/heroicons:check-circle.svg?color=white" + subdomain = true + share = "owner" + + # Healthy only when Drupal returns 200. /user/login returns 500 when the + # database isn't set up (before drush si) and 200 when Drupal is fully + # installed — giving a "site is actually working" indicator distinct from + # "web server is up". + healthcheck { + url = "http://localhost:80/user/login" + interval = 10 + threshold = 3 + } +} + # Note: JetBrains IDEs (PhpStorm, GoLand, WebStorm, etc.) are supported via JetBrains Gateway # Users should install JetBrains Gateway locally and use the Coder plugin to connect # No explicit app definitions needed - coder-login module enables Gateway support