# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: Fast Note Sync
spec:
    description: |
        SQLite version. Self-host Fast Note Sync Service for syncing and backing up Obsidian notes across devices.
    icon: https://cdn.zeabur.com/prebuilt.svg
    variables:
        - key: PASSWORD
          type: PASSWORD
          name: Server Password
          description: A generated server password used by Fast Note Sync Service.
    tags:
        - Tool
        - Productivity
        - Notes
    readme: |
        # Fast Note Sync

        SQLite version.

        Fast Note Sync Service is the self-hosted backend for the Fast Note Sync Obsidian plugin.

        ## After Deployment

        1. Open the generated Zeabur domain for this service.
        2. Register your first user account.
        3. Set `USER_REGISTER_IS_ENABLE` to `false` after the first account is created.
        4. In the Obsidian plugin, paste the remote service configuration from the web UI.

        ## Persistence

        This template mounts both required persistent directories:

        - `/fast-note-sync/storage`
        - `/fast-note-sync/config`

        Back up the SQLite database and config regularly, especially files under `/fast-note-sync/storage/database` and `/fast-note-sync/config/config.yaml`.
    services:
        - name: fast-note-sync
          icon: https://cdn.zeabur.com/prebuilt.svg
          template: PREBUILT_V2
          spec:
            id: fast-note-sync
            source:
                image: docker.io/haierkeys/fast-note-sync-service:2.14.4
            ports:
                - id: api
                  port: 9000
                  type: HTTP
            volumes:
                - id: storage
                  dir: /fast-note-sync/storage
                - id: config
                  dir: /fast-note-sync/config
            env:
                PASSWORD:
                    default: ${PASSWORD}
                    expose: false
                PORT:
                    default: ${WEB_PORT}
                    expose: false
                USER_REGISTER_IS_ENABLE:
                    default: "true"
                    expose: false
            configs: []
            healthCheck:
                type: TCP
                port: api
            portForwarding:
                enabled: false
localization:
    zh-CN:
        description: |
            SQLite 版本。自托管 Fast Note Sync Service，用于跨设备同步和备份 Obsidian 笔记。
        variables:
            - key: PASSWORD
              type: PASSWORD
              name: 服务密码
              description: Fast Note Sync Service 使用的自动生成服务密码。
        readme: |
            # Fast Note Sync

            SQLite 版本。

            Fast Note Sync Service 是 Fast Note Sync Obsidian 插件的自托管后端服务。

            ## 部署后

            1. 打开 Zeabur 为服务生成的域名。
            2. 注册第一个用户账号。
            3. 第一个账号创建完成后，将 `USER_REGISTER_IS_ENABLE` 改为 `false`。
            4. 在 Obsidian 插件中粘贴 Web UI 里的远端服务配置。

            ## 持久化

            此模板会挂载两个必要的持久化目录：

            - `/fast-note-sync/storage`
            - `/fast-note-sync/config`

            建议定期备份 SQLite 数据库和配置文件，重点是 `/fast-note-sync/storage/database` 下的文件以及 `/fast-note-sync/config/config.yaml`。
