# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: AssppWeb
spec:
    description: |
        AssppWeb is a self-hosted web app for acquiring and installing iOS apps outside the App Store.
        It uses a zero-trust browser-side architecture and ships as a single container backed by persistent storage for generated IPA files.
    coverImage: https://raw.githubusercontent.com/Lakr233/AssppWeb/main/resources/preview.png
    icon: https://raw.githubusercontent.com/Lakr233/AssppWeb/main/resources/preview.png
    variables:
        - key: PUBLIC_DOMAIN
          type: DOMAIN
          name: Domain
          description: Public domain bound to AssppWeb.
        - key: ACCESS_PASSWORD
          type: STRING
          name: Access Password
          description: Optional password for protecting the web UI and API. Leave empty to disable.
        - key: DOWNLOAD_THREADS
          type: STRING
          name: Download Threads
          description: Number of parallel download threads, usually between 1 and 32.
        - key: AUTO_CLEANUP_DAYS
          type: STRING
          name: Auto Cleanup Days
          description: Delete cached IPA files older than this many days. Use 0 to disable.
        - key: AUTO_CLEANUP_MAX_MB
          type: STRING
          name: Auto Cleanup Max MB
          description: Delete oldest cached files when storage exceeds this many MB. Use 0 to disable.
        - key: MAX_DOWNLOAD_MB
          type: STRING
          name: Max Download MB
          description: Reject downloads larger than this many MB. Use 0 to disable.
    tags:
        - ios
        - utilities
        - self-hosted
    readme: |
        # AssppWeb

        AssppWeb is a self-hosted web interface for acquiring and installing iOS apps outside the App Store.
        The frontend talks to Apple APIs directly from the browser, while the backend stores generated IPA files and exposes install links over HTTPS.

        ## What this template deploys

        This template deploys a single AssppWeb service using the published image `ghcr.io/lakr233/assppweb:latest`.
        A persistent volume is mounted at `/data` for generated packages and cache data.

        ## Notes

        - HTTPS is required for iOS install links to work correctly.
        - WebSocket support must remain enabled because AssppWeb uses `/wisp/` for its zero-trust relay architecture.
        - `PUBLIC_BASE_URL` is automatically set to the bound Zeabur domain.
        - `ACCESS_PASSWORD` is optional but recommended if the service is exposed publicly.

        ## Default behavior

        - Port: `8080`
        - Data directory: `/data`
        - Download threads: `8`
        - Cleanup limits: disabled by default
    resourceRequirement:
        minConfig:
            cpu: 1
            ram: 2
        recommendedConfig:
            cpu: 2
            ram: 4
    services:
        - name: assppweb
          icon: https://raw.githubusercontent.com/Lakr233/AssppWeb/main/resources/preview.png
          template: PREBUILT_V2
          spec:
            id: assppweb
            source:
                image: ghcr.io/lakr233/assppweb:latest
            ports:
                - id: web
                  port: 8080
                  type: HTTP
            volumes:
                - id: data
                  dir: /data
            env:
                ACCESS_PASSWORD:
                    default: ${ACCESS_PASSWORD}
                AUTO_CLEANUP_DAYS:
                    default: ${AUTO_CLEANUP_DAYS}
                AUTO_CLEANUP_MAX_MB:
                    default: ${AUTO_CLEANUP_MAX_MB}
                DATA_DIR:
                    default: /data
                DOWNLOAD_THREADS:
                    default: ${DOWNLOAD_THREADS}
                MAX_DOWNLOAD_MB:
                    default: ${MAX_DOWNLOAD_MB}
                PORT:
                    default: "8080"
                PUBLIC_BASE_URL:
                    default: ${ZEABUR_WEB_URL}
            healthCheck:
                type: HTTP
                port: web
                http:
                    path: /api/settings
          domainKey: PUBLIC_DOMAIN
localization:
    zh-CN:
        description: |
            AssppWeb 是一个可自托管的 iOS 应用获取与安装 Web 工具。
            它采用浏览器侧零信任架构，并通过持久化存储保存生成的 IPA 文件。
        variables:
            - key: PUBLIC_DOMAIN
              type: STRING
              name: 绑定域名
              description: 绑定到 AssppWeb 的公开域名。
            - key: ACCESS_PASSWORD
              type: STRING
              name: 访问密码
              description: 可选的访问密码，用于保护 Web 界面和 API；留空则不启用。
            - key: DOWNLOAD_THREADS
              type: STRING
              name: 下载线程数
              description: 并行下载线程数量，通常设置在 1 到 32 之间。
            - key: AUTO_CLEANUP_DAYS
              type: STRING
              name: 自动清理天数
              description: 自动删除超过指定天数的缓存 IPA 文件；填 0 表示禁用。
            - key: AUTO_CLEANUP_MAX_MB
              type: STRING
              name: 自动清理容量上限
              description: 当缓存体积超过该 MB 数时自动删除最旧文件；填 0 表示禁用。
            - key: MAX_DOWNLOAD_MB
              type: STRING
              name: 单文件最大下载大小
              description: 超过该 MB 数的下载会被拒绝；填 0 表示禁用。
        readme: |
            # AssppWeb

            AssppWeb 是一个自托管的 Web 工具，用于在 App Store 之外获取和安装 iOS 应用。
            前端会直接在浏览器里与 Apple API 通信，后端负责保存生成的 IPA 文件并通过 HTTPS 提供安装链接。

            ## 这个模板会部署什么

            这个模板会使用 `ghcr.io/lakr233/assppweb:latest` 部署一个单服务实例。
            模板会把持久化卷挂载到 `/data`，用于保存生成包和缓存数据。

            ## 注意事项

            - iOS 安装链接依赖 HTTPS，请确保绑定的是可正常访问的 HTTPS 域名。
            - 必须保留 WebSocket 支持，因为 AssppWeb 会使用 `/wisp/` 进行零信任中继通信。
            - `PUBLIC_BASE_URL` 会自动指向 Zeabur 绑定的公开地址。
            - 如果服务对公网开放，建议设置 `ACCESS_PASSWORD`。

            ## 默认行为

            - 端口：`8080`
            - 数据目录：`/data`
            - 下载线程：`8`
            - 自动清理：默认关闭
