- Update flows.example/update_caddy_config.yml with caddy_validate → caddy_reload → smoke test steps and hostname comments - Add flows.example/update_caddy_config_force.yml for docker compose hard restart variant - Add /flows/update-caddy-config UI page with reload/force-restart toggle, dry-run mode showing pending Caddyfile preview, hostname detection, and audit log link Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
import Link from 'next/link'
|
|
import { redirect } from 'next/navigation'
|
|
import { getCurrentUser } from '@/lib/session'
|
|
import { execAgent } from '@/lib/agent-client'
|
|
import FlowPanel from './_components/flow-panel'
|
|
|
|
export const dynamic = 'force-dynamic'
|
|
|
|
export default async function UpdateCaddyConfigPage() {
|
|
const user = await getCurrentUser()
|
|
if (!user) redirect('/login')
|
|
|
|
let caddyfile = ''
|
|
let caddyfileError: string | null = null
|
|
try {
|
|
caddyfile = await execAgent('caddy_show_config')
|
|
} catch (err) {
|
|
caddyfileError = err instanceof Error ? err.message : 'failed to load Caddyfile'
|
|
}
|
|
|
|
return (
|
|
<div className="min-h-screen bg-background p-6">
|
|
<div className="mx-auto max-w-4xl space-y-6">
|
|
<div className="flex items-center gap-3">
|
|
<Link href="/" className="text-sm text-muted-foreground hover:text-foreground">
|
|
← Home
|
|
</Link>
|
|
<span className="text-muted-foreground">/</span>
|
|
<h1 className="text-2xl font-semibold tracking-tight">Update Caddy Config</h1>
|
|
</div>
|
|
|
|
<FlowPanel caddyfile={caddyfile} caddyfileError={caddyfileError} />
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|