Consolidate audit-fixes branch: webhooks, integrations, and deploy hardening

Batch commit of the pending working tree on security/audit-fixes-2026-07.
Major areas:
- Outbound webhooks / Zapier: schema + signed delivery with retries, public
  v1 API (REST-hook subscribe/unsubscribe), settings UI, cron drain.
- Deploy hardening: email via SMTP2GO (Resend fully removed), verified DB TLS
  (DATABASE_SSL=require + DATABASE_CA), storage fails loud in production when
  Spaces is unconfigured instead of silently using ephemeral disk.
- Integrations & features (concurrent work): accounting (QuickBooks/Xero),
  e-signature (DocuSign/Dropbox Sign), PayPal, geocoding/maps, onboarding,
  expanded legal pages.
- DB migrations 0006–0009.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Leon Serfaty
2026-07-02 13:42:34 -04:00
co-authored by Claude Opus 4.8
parent 969d5d4c8a
commit c9968531e4
282 changed files with 41530 additions and 4013 deletions
+127 -12
View File
@@ -7,7 +7,7 @@ import {
LayoutDashboard, Building2, Users, CreditCard,
Wrench, FileText, Receipt, Settings, LogOut,
X, Menu, ChevronRight, Zap, Sparkles, Bot, BarChart3, Hammer, ClipboardList,
PanelLeftClose, PanelLeftOpen, CalendarDays, Activity, Brain, Bell,
PanelLeftClose, PanelLeftOpen, CalendarDays, Activity, Brain, Bell, Palette, KeyRound, Plug, Webhook,
} from "lucide-react"
import { cn } from "@/lib/utils"
import { Logo, LogoMark } from "@/components/shared/logo"
@@ -43,16 +43,18 @@ const planConfig: Record<string, { label: string; color: string; bg: string; bor
lifetime: { label: "Lifetime", color: "text-amber-300", bg: "bg-amber-500/10", border: "border-amber-500/20" },
}
interface SidebarProps { profile: Profile | null }
interface SidebarProps { profile: Profile | null; isAdmin?: boolean }
function NavContent({
profile,
collapsed,
onClose,
isAdmin,
}: {
profile: Profile | null
collapsed?: boolean
onClose?: () => void
isAdmin?: boolean
}) {
const pathname = usePathname()
@@ -150,27 +152,140 @@ function NavContent({
{!collapsed && "Settings"}
</Link>
{/* Demo Data is an admin-only testing tool (seed sample data + plan
switcher). Hidden from regular users; access is also enforced
server-side in the page and actions. */}
{isAdmin && (
<Link
href="/settings/demo"
onClick={onClose}
title={collapsed ? "Demo Data" : undefined}
className={cn(
"group relative flex items-center rounded-xl transition-all duration-200",
collapsed ? "justify-center p-2.5" : "gap-3 px-3 py-2.5",
pathname === "/settings/demo"
? "bg-indigo-600/15 text-indigo-300"
: "text-white/50 hover:bg-white/[0.05] hover:text-white/90"
)}
>
{pathname === "/settings/demo" && (
<div className="absolute left-0 top-1/2 -translate-y-1/2 w-[3px] h-5 rounded-r-full bg-indigo-500" />
)}
<Sparkles className={cn(
"h-4 w-4 shrink-0 transition-colors",
pathname === "/settings/demo" ? "text-indigo-400" : "text-white/30 group-hover:text-white/60"
)} />
{!collapsed && "Demo Data"}
</Link>
)}
<Link
href="/settings/demo"
href="/settings/api-keys"
onClick={onClose}
title={collapsed ? "Demo Data" : undefined}
title={collapsed ? "API keys" : undefined}
className={cn(
"group relative flex items-center rounded-xl transition-all duration-200",
collapsed ? "justify-center p-2.5" : "gap-3 px-3 py-2.5",
pathname === "/settings/demo"
pathname === "/settings/api-keys"
? "bg-indigo-600/15 text-indigo-300"
: "text-white/50 hover:bg-white/[0.05] hover:text-white/90"
)}
>
{pathname === "/settings/demo" && (
{pathname === "/settings/api-keys" && (
<div className="absolute left-0 top-1/2 -translate-y-1/2 w-[3px] h-5 rounded-r-full bg-indigo-500" />
)}
<Sparkles className={cn(
<KeyRound className={cn(
"h-4 w-4 shrink-0 transition-colors",
pathname === "/settings/demo" ? "text-indigo-400" : "text-white/30 group-hover:text-white/60"
pathname === "/settings/api-keys" ? "text-indigo-400" : "text-white/30 group-hover:text-white/60"
)} />
{!collapsed && "Demo Data"}
{!collapsed && "API keys"}
</Link>
<Link
href="/settings/integrations"
onClick={onClose}
title={collapsed ? "Integrations" : undefined}
className={cn(
"group relative flex items-center rounded-xl transition-all duration-200",
collapsed ? "justify-center p-2.5" : "gap-3 px-3 py-2.5",
pathname === "/settings/integrations"
? "bg-indigo-600/15 text-indigo-300"
: "text-white/50 hover:bg-white/[0.05] hover:text-white/90"
)}
>
{pathname === "/settings/integrations" && (
<div className="absolute left-0 top-1/2 -translate-y-1/2 w-[3px] h-5 rounded-r-full bg-indigo-500" />
)}
<Plug className={cn(
"h-4 w-4 shrink-0 transition-colors",
pathname === "/settings/integrations" ? "text-indigo-400" : "text-white/30 group-hover:text-white/60"
)} />
{!collapsed && "Integrations"}
</Link>
<Link
href="/settings/webhooks"
onClick={onClose}
title={collapsed ? "Webhooks" : undefined}
className={cn(
"group relative flex items-center rounded-xl transition-all duration-200",
collapsed ? "justify-center p-2.5" : "gap-3 px-3 py-2.5",
pathname === "/settings/webhooks"
? "bg-indigo-600/15 text-indigo-300"
: "text-white/50 hover:bg-white/[0.05] hover:text-white/90"
)}
>
{pathname === "/settings/webhooks" && (
<div className="absolute left-0 top-1/2 -translate-y-1/2 w-[3px] h-5 rounded-r-full bg-indigo-500" />
)}
<Webhook className={cn(
"h-4 w-4 shrink-0 transition-colors",
pathname === "/settings/webhooks" ? "text-indigo-400" : "text-white/30 group-hover:text-white/60"
)} />
{!collapsed && "Webhooks"}
</Link>
{(plan === "landlord" || plan === "lifetime") && (
<>
<Link
href="/settings/branding"
onClick={onClose}
title={collapsed ? "Branding" : undefined}
className={cn(
"group relative flex items-center rounded-xl transition-all duration-200",
collapsed ? "justify-center p-2.5" : "gap-3 px-3 py-2.5",
pathname === "/settings/branding"
? "bg-indigo-600/15 text-indigo-300"
: "text-white/50 hover:bg-white/[0.05] hover:text-white/90"
)}
>
<Palette className={cn(
"h-4 w-4 shrink-0 transition-colors",
pathname === "/settings/branding" ? "text-indigo-400" : "text-white/30 group-hover:text-white/60"
)} />
{!collapsed && "Branding"}
</Link>
<Link
href="/settings/team"
onClick={onClose}
title={collapsed ? "Team" : undefined}
className={cn(
"group relative flex items-center rounded-xl transition-all duration-200",
collapsed ? "justify-center p-2.5" : "gap-3 px-3 py-2.5",
pathname === "/settings/team"
? "bg-indigo-600/15 text-indigo-300"
: "text-white/50 hover:bg-white/[0.05] hover:text-white/90"
)}
>
<Users className={cn(
"h-4 w-4 shrink-0 transition-colors",
pathname === "/settings/team" ? "text-indigo-400" : "text-white/30 group-hover:text-white/60"
)} />
{!collapsed && "Team"}
</Link>
</>
)}
</nav>
{/* Bottom — plan + user */}
@@ -239,7 +354,7 @@ function NavContent({
)
}
export function Sidebar({ profile }: SidebarProps) {
export function Sidebar({ profile, isAdmin }: SidebarProps) {
const [mobileOpen, setMobileOpen] = useState(false)
const [collapsed, setCollapsed] = useState(false)
@@ -264,7 +379,7 @@ export function Sidebar({ profile }: SidebarProps) {
collapsed ? "w-16" : "w-60"
)}
>
<NavContent profile={profile} collapsed={collapsed} />
<NavContent profile={profile} collapsed={collapsed} isAdmin={isAdmin} />
{/* Collapse toggle */}
<button
@@ -298,7 +413,7 @@ export function Sidebar({ profile }: SidebarProps) {
onClick={() => setMobileOpen(false)}
/>
<aside className="absolute left-0 top-0 flex h-full w-72 flex-col bg-[#111118] shadow-2xl">
<NavContent profile={profile} onClose={() => setMobileOpen(false)} />
<NavContent profile={profile} onClose={() => setMobileOpen(false)} isAdmin={isAdmin} />
</aside>
</div>
)}