# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: Open Design
spec:
    description: |
        Open-source Claude Design alternative. Local-first agent-native design studio:
        design systems (DESIGN.md), skills/plugins, sandboxed HTML prototypes,
        decks (PPTX/PDF), images, HyperFrames (MP4). Runs as a single daemon image
        serving API + static web UI on port 7456.
    coverImage: https://repo-assets.open-design.ai/resources/images/hero.png
    icon: https://repo-assets.open-design.ai/resources/images/hero.png
    variables:
        - key: PUBLIC_DOMAIN
          type: DOMAIN
          name: Domain
          description: Public domain (e.g. design.z88.dev)
        - key: OD_API_TOKEN
          type: PASSWORD
          name: API Token
          description: Required bearer token (openssl rand -hex 32). Browser/API must send Authorization Bearer.
        - key: OPEN_DESIGN_IMAGE
          type: STRING
          name: Image
          description: Container image tag (default ghcr.io/nexu-io/od:latest)
    tags:
        - AI
        - Design
        - Agent
        - Productivity
    readme: "# Open Design\n\n**Upstream:** [github.com/nexu-io/open-design](https://github.com/nexu-io/open-design)  \n**Website:** [open-design.ai](https://open-design.ai)  \n**License:** Apache-2.0  \n**Image:** `ghcr.io/nexu-io/od:latest`\n\nOpen-source **Claude Design** alternative — agent-native design studio\n(prototypes, decks, images, HyperFrames) driven by skills + `DESIGN.md`.\n\n## Services\n\nSingle container (official published image):\n\n| Process | Port | Role |\n|---------|------|------|\n| Daemon + Web UI | **7456** | API `/api/*` + static Next export |\n\nPersistent data: `/app/.od`\n\n## Auth (important)\n\nBinding `0.0.0.0` **requires** `OD_API_TOKEN` unless `OD_DISABLE_API_AUTH=1`\n(only for trusted reverse proxies that already authenticate every request).\n\nGenerate token:\n\n```bash\nopenssl rand -hex 32\n```\n\nClients must send:\n\n```http\nAuthorization: Bearer <OD_API_TOKEN>\n```\n\nSet `OD_ALLOWED_ORIGINS` to your exact HTTPS origin(s), e.g.\n`https://design.z88.dev`.\n\n## After deploy\n\n1. Open `https://PUBLIC_DOMAIN`\n2. Configure model / BYOK or Open Design Cloud in Settings\n3. Create a project and run a skill\n\n## Health\n\n`GET /api/health`\n\n## Deploy note (Zeabur)\n\nPrefer **PREBUILT** image `ghcr.io/nexu-io/od` (no monorepo build).\nIf GHCR pull fails, check package visibility is public.\n"
    resourceRequirement:
        minConfig:
            cpu: 1
            ram: 1
        recommendedConfig:
            cpu: 2
            ram: 2
    services:
        - name: open-design
          icon: https://repo-assets.open-design.ai/resources/images/hero.png
          template: PREBUILT_V2
          spec:
            id: open-design
            source:
                image: ghcr.io/nexu-io/od:latest
            ports:
                - id: web
                  port: 7456
                  type: HTTP
            volumes:
                - id: od-data
                  dir: /app/.od
            env:
                NODE_ENV:
                    default: production
                NODE_OPTIONS:
                    default: --max-old-space-size=192
                OD_ALLOWED_ORIGINS:
                    default: https://${PUBLIC_DOMAIN}
                OD_API_TOKEN:
                    default: ${OD_API_TOKEN}
                OD_BIND_HOST:
                    default: 0.0.0.0
                OD_PORT:
                    default: "7456"
                OD_WEB_PORT:
                    default: "7456"
                TZ:
                    default: Asia/Shanghai
            healthCheck:
                type: HTTP
                port: web
                http:
                    path: /api/health
          domainKey: PUBLIC_DOMAIN
localization:
    zh-CN:
        description: |
            Open Design：开源 Claude Design 替代品。Agent 原生设计工作室
            （DESIGN.md / Skills / 原型 / 演示稿 / 动效）。官方镜像 ghcr.io/nexu-io/od，端口 7456。
        variables:
            - key: PUBLIC_DOMAIN
              type: DOMAIN
              name: 域名
              description: 公网域名（如 design.z88.dev）
            - key: OD_API_TOKEN
              type: PASSWORD
              name: API Token
              description: 必填 Bearer 令牌（openssl rand -hex 32）
            - key: OPEN_DESIGN_IMAGE
              type: STRING
              name: 镜像
              description: 容器镜像（默认 ghcr.io/nexu-io/od:latest）
        readme: |
            # Open Design

            上游：[nexu-io/open-design](https://github.com/nexu-io/open-design)

            ## 要点

            - 官方镜像 `ghcr.io/nexu-io/od:latest`，端口 **7456**
            - 数据目录 `/app/.od`
            - 公网绑定必须配置 `OD_API_TOKEN`（或可信反代下 `OD_DISABLE_API_AUTH=1`）
            - `OD_ALLOWED_ORIGINS` 填完整 HTTPS 源，如 `https://design.z88.dev`
            - 健康检查：`/api/health`

            ## 部署后

            打开域名 → Settings 配置模型（BYOK / Open Design Cloud）→ 创建项目运行技能。
