mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-05 16:37:46 +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.
90 lines
4.3 KiB
Plaintext
90 lines
4.3 KiB
Plaintext
---
|
|
title: App Store
|
|
description: Browse and deploy pre-configured application templates in one click.
|
|
---
|
|
|
|
The **App Store** tab lets you browse a curated catalogue of Docker Compose templates and deploy any of them as a new stack with environment-specific configuration, no YAML required.
|
|
|
|
<Frame>
|
|
<img src="/images/app-store/app-store-overview.png" alt="App Store showing a grid of application templates with category filters" />
|
|
</Frame>
|
|
|
|
## Browsing templates
|
|
|
|
Templates are loaded from a remote registry (configurable in **Settings > App Store**). The default registry is LinuxServer.io. A live count of available apps is shown next to the category pills.
|
|
|
|
**Search:** Type in the search bar to filter templates by name, description, or category in real-time.
|
|
|
|
**Categories:** Click any category pill to narrow the list:
|
|
`All` · `Automation` · `Books` · `Development` · `Documentation` · `Downloaders` · `Media` · `Monitoring` · `Networking` · `Other` · `Productivity` · `Security` · `Utilities`
|
|
|
|
Each template card shows:
|
|
- Application logo (or a placeholder icon if unavailable)
|
|
- Name and short description
|
|
- Up to three category badges (click a badge to filter by that category)
|
|
|
|
## Deploying a template
|
|
|
|
Click any template card to open the **deployment sheet** on the right side of the screen.
|
|
|
|
<Frame>
|
|
<img src="/images/app-store/app-store-deploy.png" alt="Deployment sheet for heimdall showing stack name, ports, volumes, and environment variables" />
|
|
</Frame>
|
|
|
|
The sheet header displays the app logo, title, and a truncated description with a **Read more** / **Read less** toggle. Below the description you may see:
|
|
|
|
- **Architecture badges** (e.g. `amd64`, `arm64`) when the template declares supported platforms
|
|
- **GitHub stars** count
|
|
- **Source** link to the GitHub repository
|
|
- **Docs** link to the official documentation
|
|
|
|
When deploying to a remote node, a badge at the top of the sheet shows the target node name.
|
|
|
|
### Stack name
|
|
|
|
Pre-filled with the template name in lowercase. You can change it; the same [naming rules](/features/stack-management#creating-a-stack) apply (lowercase, hyphens, no spaces).
|
|
|
|
### Ports
|
|
|
|
For each exposed port, the sheet shows an editable **host port** field (left side) and the fixed **container port** (right side). Edit the host port to avoid conflicts with other services on the same machine. Ports must be in the valid range (1 to 65535); invalid values are highlighted and block deployment.
|
|
|
|
### Volumes
|
|
|
|
For each container mount point, enter the **host path** where that data should be stored. Suggested defaults (e.g. `./config`, `./data`) are pre-filled.
|
|
|
|
<Note>
|
|
Relative paths like `./config` are resolved relative to the stack directory inside your `COMPOSE_DIR`. Absolute paths map directly to the host filesystem.
|
|
</Note>
|
|
|
|
### Environment variables
|
|
|
|
Each template declares the variables it needs. Sencho pre-fills sensible defaults where available (e.g. `PUID=1000`, `PGID=1000`, `TZ` from your browser locale). Edit any value before deploying.
|
|
|
|
### Custom variables
|
|
|
|
Below the template variables, an **Add Custom Variable** section lets you define arbitrary key-value pairs not declared by the template. Type a key and value, then click **+** to add it. If you add a key that already exists in the template defaults, a warning will let you know your custom value will override the default.
|
|
|
|
### What happens on Deploy
|
|
|
|
1. Sencho creates a new stack directory in `COMPOSE_DIR`
|
|
2. Writes the generated `compose.yaml` (and `.env` file if environment variables are configured)
|
|
3. Runs `docker compose up -d`
|
|
4. On success: switches you to the Editor view for that stack
|
|
5. On failure: rolls back by running `docker compose down` and deleting the stack directory
|
|
|
|
A toast notification confirms success or shows the error message. Large images may take a few minutes to pull.
|
|
|
|
<Note>
|
|
Deploying a template requires the `stack:create` permission. Users without this permission will see the Deploy button disabled.
|
|
</Note>
|
|
|
|
## Custom template registry
|
|
|
|
By default Sencho uses the LinuxServer.io template registry. To use your own:
|
|
|
|
1. Open **Settings > App Store**
|
|
2. Enter your registry URL (must serve a JSON array of template objects in Portainer v2 format)
|
|
3. Click **Save & Refresh**
|
|
|
|
Sencho saves the new URL and automatically refreshes the template cache from the new source. To revert to the default registry, click **Reset to Default**.
|