# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: Shlink Dashboard (without DB)
spec:
    description: The next-generation management UI for Shlink, with user accounts and server-side settings. Deploy it in the same project as Shlink to reuse its PostgreSQL.
    icon: https://raw.githubusercontent.com/shlinkio/shlink-dashboard/develop/public/favicon.svg
    tags:
        - Website
        - API
    readme: |
        # Shlink Dashboard (without DB)

        [Shlink Dashboard](https://github.com/shlinkio/shlink-dashboard) is the next-generation web application for Shlink. It supports user authentication with roles (admins, advanced users and managed users), saves all settings server-side per user, and proxies interactions with your Shlink server so API keys never leak to the browser.

        ## Requirements

        This template does not include a database. Deploy it into the **same project** as your Shlink stack (e.g. deployed from the [Shlink template](https://zeabur.com/templates/CQI9A8)), and it will reuse that PostgreSQL service via the shared `POSTGRES_*` variables.

        Alternatively, deploy this template first and then add a PostgreSQL service to the project yourself — once PostgreSQL is up and running, restart the `shlink-dashboard` service.

        On first start it creates its own `shlink_dashboard` database in the existing PostgreSQL server. No other change is needed.

        Shlink Dashboard works with Shlink 4.0 and later, so it pairs directly with the [Shlink template](https://zeabur.com/templates/CQI9A8).

        ## First steps

        1. Open the Dashboard URL (see the instructions section of the `shlink-dashboard` service)
        2. Log in with username `admin` and password `admin`, and set a new password when prompted
        3. Click "Add a server", enter any name, the "Endpoint URL" and "API key" (both can be found in the instructions section of the `shlink` service in this project)
        4. Create and manage short URLs, tags, domains and visits

        You can also keep using the classic web client at [app.shlink.io](https://app.shlink.io) — both work with the same Shlink instance.

        ## License

        Shlink Dashboard is open-source software licensed under the [MIT license](https://github.com/shlinkio/shlink-dashboard/blob/main/LICENSE). See [shlinkio/shlink-dashboard](https://github.com/shlinkio/shlink-dashboard) on GitHub.
    services:
        - name: shlink-dashboard
          icon: https://raw.githubusercontent.com/shlinkio/shlink-dashboard/develop/public/favicon.svg
          template: PREBUILT_V2
          spec:
            id: shlink-dashboard
            source:
                image: shlinkio/shlink-dashboard:stable
            ports:
                - id: web
                  port: 3005
                  type: HTTP
            instructions:
                - title: Dashboard URL
                  content: ${ZEABUR_WEB_URL}
                - title: Initial username
                  content: admin
                - title: Initial password
                  content: admin (change it on first login)
                - title: Shlink Endpoint URL and API key
                  content: See the instructions of the shlink service in this project
            env:
                SHLINK_DASHBOARD_DB_DRIVER:
                    default: postgres
                    expose: false
                SHLINK_DASHBOARD_DB_HOST:
                    default: ${POSTGRES_HOST}
                    expose: false
                SHLINK_DASHBOARD_DB_NAME:
                    default: shlink_dashboard
                    expose: false
                SHLINK_DASHBOARD_DB_PASSWORD:
                    default: ${POSTGRES_PASSWORD}
                    expose: false
                SHLINK_DASHBOARD_DB_PORT:
                    default: ${POSTGRES_PORT}
                    expose: false
                SHLINK_DASHBOARD_DB_USER:
                    default: ${POSTGRES_USERNAME}
                    expose: false
                SHLINK_DASHBOARD_SESSION_SECRETS:
                    default: ${PASSWORD}
                    expose: false
            configs: []
            portForwarding:
                enabled: false
localization:
    zh-CN:
        description: Shlink 新一代管理界面，支持用户帐号与服务器端设置。部署到与 Shlink 相同的项目以复用其 PostgreSQL。
        readme: |
            # Shlink Dashboard（无数据库）

            [Shlink Dashboard](https://github.com/shlinkio/shlink-dashboard) 是 Shlink 的新一代网页应用，支持带角色的用户认证（管理员、高级用户、受管用户），设置按用户保存在服务器端，并代理与 Shlink 服务器的交互，API key 不会泄露到浏览器。

            ## 前置需求

            此模板不包含数据库。请将它部署到与 Shlink **同一个项目**中（例如由 [Shlink 模板](https://zeabur.com/templates/CQI9A8) 部署的项目），它会通过共享的 `POSTGRES_*` 变量复用该 PostgreSQL 服务。

            或者，也可以先部署此模板，再自行将 PostgreSQL 服务部署到项目中，PostgreSQL 启动后重启 `shlink-dashboard` 服务即可。

            首次启动时会在既有的 PostgreSQL 服务器中自动创建独立的 `shlink_dashboard` 数据库，无需其他设置。

            Shlink Dashboard 需要 Shlink 4.0 或更高版本，可直接搭配 [Shlink 模板](https://zeabur.com/templates/CQI9A8) 使用。

            ## 首次使用

            1. 打开 Dashboard URL（见 `shlink-dashboard` 服务的使用说明区块）
            2. 使用用户名 `admin`、密码 `admin` 登录，并按提示设置新密码
            3. 点击「Add a server」，输入任意名称、「Endpoint URL」与「API key」（可在本项目 `shlink` 服务的使用说明区块取得）
            4. 创建并管理短网址、标签、域名与访问统计

            您也可以继续使用传统网页客户端 [app.shlink.io](https://app.shlink.io)，两者可管理同一个 Shlink 实例。

            ## 授权

            Shlink Dashboard 是开源软件，采用 [MIT 授权条款](https://github.com/shlinkio/shlink-dashboard/blob/main/LICENSE)，参见 [shlinkio/shlink-dashboard](https://github.com/shlinkio/shlink-dashboard)。
    zh-TW:
        description: Shlink 新一代管理介面，支援使用者帳號與伺服器端設定。部署到與 Shlink 相同的專案以複用其 PostgreSQL。
        readme: |
            # Shlink Dashboard（無資料庫）

            [Shlink Dashboard](https://github.com/shlinkio/shlink-dashboard) 是 Shlink 的新一代網頁應用，支援具角色的使用者認證（管理員、進階使用者、受管使用者），設定按使用者保存在伺服器端，並代理與 Shlink 伺服器的互動，API key 不會洩漏到瀏覽器。

            ## 前置需求

            此模板不包含資料庫。請將它部署到與 Shlink **同一個專案**中（例如由 [Shlink 模板](https://zeabur.com/templates/CQI9A8) 部署的專案），它會透過共享的 `POSTGRES_*` 變數複用該 PostgreSQL 服務。

            或者，也可以先部署此模板，再自行將 PostgreSQL 服務部署到專案中，PostgreSQL 啟動後重新啟動 `shlink-dashboard` 服務即可。

            首次啟動時會在既有的 PostgreSQL 伺服器中自動建立獨立的 `shlink_dashboard` 資料庫，無需其他設定。

            Shlink Dashboard 需要 Shlink 4.0 或以上版本，可直接搭配 [Shlink 模板](https://zeabur.com/templates/CQI9A8) 使用。

            ## 首次使用

            1. 開啟 Dashboard URL（見 `shlink-dashboard` 服務的使用說明區塊）
            2. 以帳號 `admin`、密碼 `admin` 登入，並依提示設定新密碼
            3. 點擊「Add a server」，輸入任意名稱、「Endpoint URL」與「API key」（可於本專案 `shlink` 服務的使用說明區塊取得）
            4. 即可建立與管理短網址、標籤、網域及訪問統計

            您也可以繼續使用傳統網頁客戶端 [app.shlink.io](https://app.shlink.io)，兩者可管理同一個 Shlink 實例。

            ## 授權

            Shlink Dashboard 為開源軟體，採用 [MIT 授權條款](https://github.com/shlinkio/shlink-dashboard/blob/main/LICENSE)，參見 [shlinkio/shlink-dashboard](https://github.com/shlinkio/shlink-dashboard)。
