mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-07-27 04:11:01 +00:00
d4882d32d9
* fix(app-store): harden App Store with auth, validation, bug fixes, and design compliance Add authMiddleware to GET /api/templates and POST /api/templates/deploy endpoints. Add isValidStackName and isPathWithinBase checks to the deploy endpoint. Replace fs.existsSync with async fsPromises.access. Extract FileSystemService to local variable to avoid repeated getInstance calls. Fix template mutation bug where PUID/PGID/TZ duplicated on re-open by working on a copy instead of mutating state. Make env_file conditional in generated compose YAML (only when env vars exist). Add port validation (range 1-65535) with visual feedback and deploy blocking. Add env key collision warning toast for custom variables. Replace any types with proper LSIO API interfaces. Change catch types from any to unknown with getErrorMessage. Add structured logging with [Templates] prefix and diagnostic logging gated behind Developer Mode. Align with design system: remove hardcoded bg-white and text-red-500, use ScrollArea, fix destructive button variant, add tabular-nums and strokeWidth 1.5, use cn() for conditional classes. Add empty-registry state distinct from no-search-results. Add 16 unit tests for TemplateService covering compose generation, conditional env_file, env string generation, and cache clearing. Update App Store docs with port validation and env collision details. * refactor(app-store): remove unused interface exports Remove export keyword from interfaces that are only used within their own file: TemplateEnv, TemplateVolume, and TemplatesResponse in TemplateService.ts; TemplateEnv and Template in AppStoreView.tsx. No external consumers import these types. * fix(app-store): remove unused fs default import The fs.existsSync call was replaced with fsPromises.access in the deploy endpoint, leaving the fs default import unused. Remove it to fix the ESLint no-unused-vars error in CI.