# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: LobeHub
spec:
    description: LobeHub is an open-source, modern-design AI chat framework. Supports Multi AI Providers, Knowledge Base, Text-to-Speech & Speech-to-Text.
    icon: https://i.imgur.com/1N9pEHJ.png
    variables:
        - key: LOBEHUB_DOMAIN
          type: DOMAIN
          name: LOBEHUB Domain
          description: The domain name of LOBEHUB.
        - key: MINIO_DOMAIN
          type: DOMAIN
          name: MINIO Domain
          description: The domain name of MINIO.
    readme: |
        # LobeHub
        LobeHub is an open-source, extensible, and high-performance AI chat framework. It supports one-click free deployment of your private ChatGPT/Claude/Gemini/Ollama chat application.

        ## Features
        - **Multi-Model Support**: Integrated with OpenAI, Claude, Gemini, Ollama, and more.
        - **Multimodal Interaction**: Supports Vision (GPT-4V), Text-to-Speech (TTS), and Speech-to-Text (STT).
        - **Plugin System**: Extensible function calling system for plugins.
        - **Agent Market**: Access to a rich ecosystem of pre-configured agents.

        ## Usage
        After deployment, visit the configured domain to start using LobeHub. You may need to configure your model provider API keys in the settings.
    services:
        - name: PostgreSQL
          icon: https://cdn.zeabur.com/marketplace/postgresql.svg
          template: PREBUILT_V2
          spec:
            source:
                image: docker.io/paradedb/paradedb:latest-pg18
                command:
                    - docker-entrypoint.sh
                    - -c
                    - config_file=/etc/postgresql/postgresql.conf
            ports:
                - id: database
                  port: 5432
                  type: TCP
            volumes:
                - id: data
                  dir: /var/lib/postgresql/18/docker
            instructions:
                - title: Connection String
                  content: postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT}/${POSTGRES_DATABASE}
                - title: PostgreSQL Connect Command
                  content: psql "postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT}/${POSTGRES_DATABASE}"
                - title: PostgreSQL username
                  content: ${POSTGRES_USERNAME}
                - title: PostgresSQL password
                  content: ${POSTGRES_PASSWORD}
                - title: PostgresSQL database
                  content: ${POSTGRES_DATABASE}
                - title: PostgreSQL host
                  content: ${PORT_FORWARDED_HOSTNAME}
                - title: PostgreSQL port
                  content: ${DATABASE_PORT_FORWARDED_PORT}
            env:
                PGDATA:
                    default: /var/lib/postgresql/18/docker/pgdata
                    expose: false
                POSTGRES_CONNECTION_STRING:
                    default: postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DATABASE}
                    expose: true
                POSTGRES_DATABASE:
                    default: ${POSTGRES_DB}
                    expose: true
                POSTGRES_DB:
                    default: zeabur
                    expose: false
                POSTGRES_HOST:
                    default: ${CONTAINER_HOSTNAME}
                    expose: true
                POSTGRES_PASSWORD:
                    default: ${PASSWORD}
                    expose: true
                POSTGRES_PORT:
                    default: ${DATABASE_PORT}
                    expose: true
                POSTGRES_URI:
                    default: ${POSTGRES_CONNECTION_STRING}
                    expose: true
                POSTGRES_USER:
                    default: root
                    expose: false
                POSTGRES_USERNAME:
                    default: ${POSTGRES_USER}
                    expose: true
            configs:
                - path: /etc/postgresql/postgresql.conf
                  template: |
                    # https://github.com/postgres/postgres/blob/master/src/backend/utils/misc/postgresql.conf.sample
                    listen_addresses = '*'
                    max_connections = 256
                    shared_buffers = 256MB
                    dynamic_shared_memory_type = posix
                    max_wal_size = 1GB
                    min_wal_size = 80MB
                    log_timezone = 'UTC'
                    datestyle = 'iso, mdy'
                    timezone = 'UTC'
                    lc_messages = 'en_US.UTF-8'
                    lc_monetary = 'en_US.UTF-8'
                    lc_numeric = 'en_US.UTF-8'
                    lc_time = 'en_US.UTF-8'
                    default_text_search_config = 'pg_catalog.english'
                  permission: null
                  envsubst: null
            portForwarding:
                enabled: true
        - name: Minio
          icon: https://cdn.zeabur.com/marketplace/minio.svg
          template: PREBUILT_V2
          spec:
            source:
                image: quay.io/minio/minio:latest
                command:
                    - /bin/sh
                args:
                    - -c
                    - |
                      minio server /data --console-address :9090 &
                      MINIO_PID=$!
                      while ! curl -s http://localhost:9000/minio/health/live; do
                        echo 'Waiting for MinIO to start...'
                        sleep 1
                      done
                      sleep 5
                      mc alias set myminio http://localhost:9000 $MINIO_USERNAME $MINIO_PASSWORD
                      echo "Creating bucket '$MINIO_DEFAULT_BUCKET'"
                      mc mb myminio/$MINIO_DEFAULT_BUCKET
                      wait $MINIO_PID
            ports:
                - id: web
                  port: 9000
                  type: HTTP
                - id: console
                  port: 9090
                  type: HTTP
            volumes:
                - id: data
                  dir: /data
            instructions:
                - title: Go to MinIO Console
                  content: ${MINIO_CONSOLE_URL}
                - title: Default Username (S3 Access Key ID)
                  content: ${MINIO_USERNAME}
                - title: Default Password (S3 Secret Access Key)
                  content: ${MINIO_PASSWORD}
                - title: Default Bucket
                  content: ${MINIO_DEFAULT_BUCKET}
            env:
                MINIO_BROWSER_REDIRECT:
                    default: "false"
                    expose: false
                MINIO_CONSOLE_URL:
                    default: ${ZEABUR_CONSOLE_URL}
                    expose: true
                MINIO_DEFAULT_BUCKET:
                    default: zeabur
                    expose: true
                MINIO_PASSWORD:
                    default: ${MINIO_ROOT_PASSWORD}
                    expose: true
                MINIO_PUBLIC_URL:
                    default: ${ZEABUR_WEB_URL}
                    expose: true
                MINIO_ROOT_PASSWORD:
                    default: ${PASSWORD}
                    expose: false
                MINIO_ROOT_USER:
                    default: minio
                    expose: false
                MINIO_USERNAME:
                    default: ${MINIO_ROOT_USER}
                    expose: true
            configs: []
            portForwarding:
                enabled: false
          domainKey: MINIO_DOMAIN
        - name: LobeHub
          icon: https://i.imgur.com/1N9pEHJ.png
          dependencies:
            - PostgreSQL
          template: PREBUILT_V2
          spec:
            source:
                image: docker.io/lobehub/lobehub:latest
            ports:
                - id: web
                  port: 3210
                  type: HTTP
            env:
                APP_URL:
                    default: https://${ZEABUR_WEB_DOMAIN}
                    expose: false
                AUTH_SECRET:
                    default: ${PASSWORD}
                    expose: false
                DATABASE_URL:
                    default: ${POSTGRES_CONNECTION_STRING}
                    expose: false
                ENABLED_OLLAMA:
                    default: "0"
                    expose: false
                KEY_VAULTS_SECRET:
                    default: ${PASSWORD}
                    expose: false
                LLM_VISION_IMAGE_USE_BASE64:
                    default: "1"
                    expose: false
                S3_ACCESS_KEY_ID:
                    default: ${MINIO_USERNAME}
                    expose: false
                S3_BUCKET:
                    default: ${MINIO_DEFAULT_BUCKET}
                    expose: false
                S3_ENABLE_PATH_STYLE:
                    default: "1"
                    expose: false
                S3_ENDPOINT:
                    default: ${MINIO_PUBLIC_URL}
                    expose: false
                S3_PUBLIC_DOMAIN:
                    default: ${MINIO_PUBLIC_URL}
                    expose: false
                S3_REGION:
                    default: auto
                    expose: false
                S3_SECRET_ACCESS_KEY:
                    default: ${MINIO_PASSWORD}
                    expose: false
            configs: []
            portForwarding:
                enabled: false
          domainKey: LOBEHUB_DOMAIN
localization:
    zh-CN:
        description: LobeHub 是一个开源、高性能的聊天机器人框架，支持语音合成、多模态和可扩展的函数调用插件系统。
        readme: |
            # LobeHub
            LobeHub 是一个开源、可扩展的高性能 AI 聊天框架。支持一键免费部署您的私人 ChatGPT/Claude/Gemini/Ollama 聊天应用。

            ## 功能特性
            - **多模型支持**：集成 OpenAI、Claude、Gemini、Ollama 等多种模型。
            - **多模态交互**：支持视觉识别 (GPT-4V)、语音合成 (TTS) 和语音识别 (STT)。
            - **插件系统**：支持可扩展的函数调用插件。
            - **助手市场**：提供丰富的预配置助手生态系统。

            ## 使用说明
            部署完成后，请访问配置的域名开始使用。您可能需要在设置中配置模型提供商的 API 密钥。
    zh-TW:
        description: LobeHub 是一個開源、高效能的聊天機器人框架，支援語音合成、多模態和可擴展的函數調用外掛系統。
        readme: |
            # LobeHub
            LobeHub 是一個開源、可擴展的高效能 AI 聊天框架。支援一鍵免費部署您的私人 ChatGPT/Claude/Gemini/Ollama 聊天應用。

            ## 功能特性
            - **多模型支援**：整合 OpenAI、Claude、Gemini、Ollama 等多種模型。
            - **多模態互動**：支援視覺識別 (GPT-4V)、語音合成 (TTS) 和語音識別 (STT)。
            - **外掛系統**：支援可擴展的函數調用外掛。
            - **助手市場**：提供豐富的預配置助手生態系統。

            ## 使用說明
            部署完成後，請訪問配置的域名開始使用。您可能需要在設定中配置模型提供商的 API 金鑰。
