# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: Kobato
spec:
    description: A self-hosted blog CMS powered by React Router 8, Hono, and oRPC.
    icon: https://raw.githubusercontent.com/syhily/kobato/main/src/server/assets/defaults/favicon.svg
    variables:
        - key: PUBLIC_DOMAIN
          type: DOMAIN
          name: Public Domain
          description: The domain to access your Kobato blog.
        - key: SESSION_SECRET
          type: STRING
          name: Session Secret
          description: Random string of at least 32 characters used to sign session cookies. Generate with `openssl rand -base64 48`.
        - key: ENCRYPTION_KEY
          type: STRING
          name: Encryption Key
          description: Random string of at least 32 characters used to AES-256-GCM encrypt sensitive settings. Generate with `openssl rand -base64 48`. Must differ from SESSION_SECRET.
    tags:
        - Blog
        - CMS
    readme: |
        # Kobato on Zeabur

        [Kobato](https://github.com/syhily/kobato) is a self-hosted blog CMS built with React Router 8, Hono, and oRPC.

        This template provisions everything you need in one click:

        - **Kobato** — the blog CMS (pre-built image from GHCR), fully self-contained: content lives in an embedded SQLite database, analytics in an embedded DuckDB sidecar, both on the service's `/data` volume.

        ## After deployment

        1. Wait until the service reports healthy in the dashboard.
        2. Open the public domain you bound during deployment.
        3. You will be redirected to `/admin/setup` to create the admin account.
        4. Start writing posts from the built-in admin console at `/admin`.

        ## Custom domain

        Bind your own domain in the **Networking** tab of the Kobato service after deployment.

        ## Updates

        To upgrade, change the image tag of the Kobato service to a newer release from
        [GHCR](https://github.com/syhily/kobato/pkgs/container/kobato) and redeploy.

        ## License

        Kobato is licensed under [MIT](https://github.com/syhily/kobato/blob/main/LICENSE).
    services:
        - name: kobato
          icon: https://raw.githubusercontent.com/syhily/kobato/main/src/server/assets/defaults/favicon.svg
          template: PREBUILT
          spec:
            id: kobato
            source:
                image: ghcr.io/syhily/kobato:latest
            ports:
                - id: web
                  port: 4321
                  type: HTTP
            volumes:
                - id: data
                  dir: /data
                - id: config
                  dir: /etc/kobato
            env:
                NODE_ENV:
                    default: production
                security__encryptionKey:
                    default: ${ENCRYPTION_KEY}
                security__sessionSecret:
                    default: ${SESSION_SECRET}
                server__host:
                    default: 0.0.0.0
                server__loggingLevel:
                    default: info
                server__port:
                    default: "4321"
                storage__analyticsDatabase:
                    default: /data/analytics.duckdb
                storage__data:
                    default: /data
                storage__database:
                    default: /data/kobato.db
          domainKey: PUBLIC_DOMAIN
