Add app template preview with ACL-protected defaults in New Server modal#1441
Add app template preview with ACL-protected defaults in New Server modal#1441caffeinated92 wants to merge 1 commit intodevelopfrom
Conversation
PR Review: Add app template preview with ACL-protected defaultsOverall the feature is well-motivated and the UX improvement is clear. The ACL integration looks correct and the frontend state management (touched flags, dynamic-value detection) is sensible. That said, there are a few issues — one security-critical — that need addressing before merge. Critical: Path Traversal in
|
| Severity | Issue |
|---|---|
| 🔴 Critical | Path traversal in GetTemplateContent via {templateName:.*} route |
| 🟠 Bug | http.Error called after WriteHeader(200) — status 500 is dropped |
| 🟡 Minor | mycluster == nil should return 404 |
| 🟡 Minor | Raw template content may contain sensitive values |
| 🟢 Nit | fetchTemplatePreview missing useCallback |
| 🟢 Nit | No test coverage for new endpoint |
Requesting changes on the path traversal and the response-after-headers bug before merge. The rest can be addressed in follow-up issues if needed.
Summary
Why
Creating app monitors from templates was missing an important feedback step: users could select a template, but they could not see what it contained before submitting. That made it harder to understand what host, port, image, and deployment settings a template would imply, and increased the chance of creating an app with the wrong assumptions.
This change improves the app creation flow by making template intent visible at selection time, while keeping the backend as the source of truth and preserving operator control over the final values.
Details
Backend
Frontend
UX impact
This gives users immediate visibility into what a template does before creating an app monitor, which makes app initiation safer, more understandable, and easier to trust.
Security
Template preview is not public; it is protected by the same cluster ACL evaluation flow and explicitly requires the app deployment grant.