From d0126999b3a4309247087ab081ef82f6526a3d38 Mon Sep 17 00:00:00 2001 From: Michael McNees Date: Mon, 23 Mar 2026 10:10:19 -0400 Subject: [PATCH 01/20] fix: improve mobile navigation and layouts on docs site Co-Authored-By: Claude Opus 4.6 (1M context) --- site/src/components/DocsSidebar.astro | 37 ++++++++++++++++----------- site/src/components/Nav.astro | 24 +++++++++++++++-- site/src/layouts/Docs.astro | 14 +--------- site/src/styles/global.css | 36 +++++++++++++++++++++++++- 4 files changed, 80 insertions(+), 31 deletions(-) diff --git a/site/src/components/DocsSidebar.astro b/site/src/components/DocsSidebar.astro index b7cd7f7..c998e8e 100644 --- a/site/src/components/DocsSidebar.astro +++ b/site/src/components/DocsSidebar.astro @@ -111,7 +111,7 @@ function isParentActive(item: NavItem): boolean { ))} + + + From 9b089419fe0c9f1ad6d3c99e709246715cee4750 Mon Sep 17 00:00:00 2001 From: Michael McNees Date: Mon, 23 Mar 2026 19:54:45 -0400 Subject: [PATCH 17/20] fix: bail out of deferInitNav after 10 frames on non-docs pages --- site/src/components/Nav.astro | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/site/src/components/Nav.astro b/site/src/components/Nav.astro index 76a20f3..8c0f6ab 100644 --- a/site/src/components/Nav.astro +++ b/site/src/components/Nav.astro @@ -100,17 +100,23 @@ function initNav() { } }; } -// Defer init until sidebar DOM exists (Nav renders before DocsSidebar) +// Defer init until sidebar DOM exists (Nav renders before DocsSidebar). +// Bail after a few frames if sidebar never appears (non-docs pages). +var _navRetries = 0; +var _navMaxRetries = 10; function deferInitNav() { if (document.getElementById('docs-sidebar-mobile')) { initNav(); - } else { - // Sidebar not yet in DOM — wait for it + } else if (_navRetries < _navMaxRetries) { + _navRetries++; requestAnimationFrame(deferInitNav); } + // else: sidebar doesn't exist on this page — stop trying } +_navRetries = 0; deferInitNav(); document.addEventListener('astro:after-swap', function() { - requestAnimationFrame(deferInitNav); + _navRetries = 0; + deferInitNav(); }); From 815ec7051ad7fa7518c9106aa879eb70b81eee4e Mon Sep 17 00:00:00 2001 From: Michael McNees Date: Mon, 23 Mar 2026 20:19:11 -0400 Subject: [PATCH 18/20] fix: sslmode=prefer warning for non-loopback hosts, prefix nav globals - Warn at startup when database URL uses sslmode=prefer with a non-loopback host (localhost/127.0.0.1/::1 are excluded) - Prefix inline script globals in Nav.astro (_mantleNavRetries, _mantleDeferInitNav) to avoid collisions Co-Authored-By: Claude Opus 4.6 (1M context) --- internal/config/config.go | 15 +++++++++++++++ site/src/components/Nav.astro | 20 ++++++++++---------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 3da8be3..41a21c7 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -5,6 +5,8 @@ import ( "crypto/rand" "encoding/hex" "fmt" + "log" + "net/url" "os" "time" @@ -231,6 +233,19 @@ func Load(cmd *cobra.Command) (*Config, error) { return nil, err } + // Warn if database URL uses sslmode=prefer on a non-loopback host. + if dbURL := cfg.Database.URL; dbURL != "" { + if parsed, err := url.Parse(dbURL); err == nil { + host := parsed.Hostname() + if host != "localhost" && host != "127.0.0.1" && host != "::1" { + q := parsed.Query() + if q.Get("sslmode") == "prefer" { + log.Printf("WARNING: database URL uses sslmode=prefer for non-loopback host %q; consider sslmode=require for production", host) + } + } + } + } + // Generate default NodeID if not set. // Format: hostname:pid:random8chars — the random suffix ensures uniqueness // across Kubernetes container restarts where PID 1 is common. diff --git a/site/src/components/Nav.astro b/site/src/components/Nav.astro index 8c0f6ab..ecf73cd 100644 --- a/site/src/components/Nav.astro +++ b/site/src/components/Nav.astro @@ -102,21 +102,21 @@ function initNav() { } // Defer init until sidebar DOM exists (Nav renders before DocsSidebar). // Bail after a few frames if sidebar never appears (non-docs pages). -var _navRetries = 0; -var _navMaxRetries = 10; -function deferInitNav() { +var _mantleNavRetries = 0; +var _mantleNavMaxRetries = 10; +function _mantleDeferInitNav() { if (document.getElementById('docs-sidebar-mobile')) { initNav(); - } else if (_navRetries < _navMaxRetries) { - _navRetries++; - requestAnimationFrame(deferInitNav); + } else if (_mantleNavRetries < _mantleNavMaxRetries) { + _mantleNavRetries++; + requestAnimationFrame(_mantleDeferInitNav); } // else: sidebar doesn't exist on this page — stop trying } -_navRetries = 0; -deferInitNav(); +_mantleNavRetries = 0; +_mantleDeferInitNav(); document.addEventListener('astro:after-swap', function() { - _navRetries = 0; - deferInitNav(); + _mantleNavRetries = 0; + _mantleDeferInitNav(); }); From 4b48827fa911fac23821db44de9ca71249684d75 Mon Sep 17 00:00:00 2001 From: Michael McNees Date: Mon, 23 Mar 2026 20:28:26 -0400 Subject: [PATCH 19/20] Update internal/config/config.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- internal/config/config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/config/config.go b/internal/config/config.go index 41a21c7..0f6c882 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -237,7 +237,9 @@ func Load(cmd *cobra.Command) (*Config, error) { if dbURL := cfg.Database.URL; dbURL != "" { if parsed, err := url.Parse(dbURL); err == nil { host := parsed.Hostname() - if host != "localhost" && host != "127.0.0.1" && host != "::1" { + ip := net.ParseIP(host) + isLoopback := host != "" && (strings.EqualFold(host, "localhost") || (ip != nil && ip.IsLoopback())) + if !isLoopback { q := parsed.Query() if q.Get("sslmode") == "prefer" { log.Printf("WARNING: database URL uses sslmode=prefer for non-loopback host %q; consider sslmode=require for production", host) From 00bca25350b90b4beb9e04084d46b8883bdec5bf Mon Sep 17 00:00:00 2001 From: Michael McNees Date: Mon, 23 Mar 2026 21:07:42 -0400 Subject: [PATCH 20/20] fix: add missing net and strings imports for sslmode check The CodeRabbit suggestion (4b48827) replaced the simple string comparison with net.ParseIP/strings.EqualFold but didn't add the required imports, breaking CI. Co-Authored-By: Claude Opus 4.6 (1M context) --- internal/config/config.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/config/config.go b/internal/config/config.go index 0f6c882..b0fbffa 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -6,8 +6,10 @@ import ( "encoding/hex" "fmt" "log" + "net" "net/url" "os" + "strings" "time" "github.com/spf13/cobra"