# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: PPANEL
spec:
    description: |
        PPanel is a pure, professional, and perfect open-source proxy panel tool, designed to be your ideal choice for learning and practical use.
    icon: https://raw.githubusercontent.com/perfect-panel/ppanel-assets/main/logo.svg
    variables:
        - key: PUBLIC_SERVER_DOMAIN
          type: DOMAIN
          name: SERVER DOMAIN
          description: What is the domain you want for your ppanel server?
        - key: PUBLIC_ADMIN_DOMAIN
          type: DOMAIN
          name: ADMIN DOMAIN
          description: What is the domain you want for your ppanel admin web?
        - key: PUBLIC_USER_DOMAIN
          type: DOMAIN
          name: USER DOMAIN
          description: What is the domain you want for your ppanel user web?
    readme: ""
    services:
        - name: redis
          icon: https://raw.githubusercontent.com/zeabur/service-icons/main/marketplace/redis.svg
          template: PREBUILT_V2
          spec:
            id: redis
            source:
                image: redis/redis-stack-server:latest
            ports:
                - id: database
                  port: 6379
                  type: TCP
            volumes:
                - id: data
                  dir: /data
            instructions:
                - title: Command to connect to your Redis
                  content: redis-cli -h ${PORT_FORWARDED_HOSTNAME} -p ${DATABASE_PORT_FORWARDED_PORT} -a ${REDIS_PASSWORD}
                - title: Redis Connection String
                  content: redis://:${REDIS_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT}
                - title: Redis password
                  content: ${REDIS_PASSWORD}
                - title: Redis host
                  content: ${PORT_FORWARDED_HOSTNAME}
                - title: Redis port
                  content: ${DATABASE_PORT_FORWARDED_PORT}
            env:
                REDIS_ARGS:
                    default: --requirepass ${REDIS_PASSWORD}
                    expose: false
                REDIS_CONNECTION_STRING:
                    default: redis://:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}
                    expose: true
                REDIS_HOST:
                    default: ${CONTAINER_HOSTNAME}
                    expose: true
                REDIS_PASSWORD:
                    default: ${PASSWORD}
                    expose: true
                REDIS_PORT:
                    default: ${DATABASE_PORT}
                    expose: true
                REDIS_URI:
                    default: ${REDIS_CONNECTION_STRING}
                    expose: true
            configs:
                - path: /etc/redis-stack.conf
                  template: |
                    port 6379
                    daemonize no
                  permission: null
                  envsubst: true
        - name: mysql
          icon: https://cdn.zeabur.com/marketplace/mysql.svg
          template: PREBUILT
          spec:
            id: mysql
            source:
                image: mysql:8.0
            ports:
                - id: database
                  port: 3306
                  type: TCP
            volumes:
                - id: data
                  dir: /var/lib/mysql
            instructions:
                - title: Command to connect to your MySQL
                  content: mysqlsh --sql --host=${PORT_FORWARDED_HOSTNAME} --port=${DATABASE_PORT_FORWARDED_PORT} --user=${MYSQL_USERNAME} --password=${MYSQL_PASSWORD} --schema=${MYSQL_DATABASE}
                - title: MySQL username
                  content: ${MYSQL_USERNAME}
                - title: MySQL password
                  content: ${MYSQL_PASSWORD}
                - title: MySQL database
                  content: ${MYSQL_DATABASE}
                - title: MySQL host
                  content: ${PORT_FORWARDED_HOSTNAME}
                - title: MySQL port
                  content: ${DATABASE_PORT_FORWARDED_PORT}
            env:
                MYSQL_DATABASE:
                    default: zeabur
                    expose: true
                MYSQL_HOST:
                    default: ${CONTAINER_HOSTNAME}
                    expose: true
                MYSQL_PASSWORD:
                    default: ${MYSQL_ROOT_PASSWORD}
                    expose: true
                MYSQL_PORT:
                    default: ${DATABASE_PORT}
                    expose: true
                MYSQL_ROOT_PASSWORD:
                    default: ${PASSWORD}
                MYSQL_USERNAME:
                    default: root
                    expose: true
            configs:
                - path: /etc/my.cnf
                  template: |
                    [mysqld]
                    default-authentication-plugin=mysql_native_password
                    host-cache-size=0
                    skip-name-resolve
                    datadir=/var/lib/mysql
                    socket=/var/run/mysqld/mysqld.sock
                    secure-file-priv=/var/lib/mysql-files
                    user=mysql
                    max_allowed_packet=10M
                    performance_schema=off

                    pid-file=/var/run/mysqld/mysqld.pid
                    [client]
                    socket=/var/run/mysqld/mysqld.sock

                    !includedir /etc/mysql/conf.d/
                  permission: null
                  envsubst: null
        - name: ppanel-server
          icon: https://raw.githubusercontent.com/perfect-panel/ppanel-assets/main/logo.svg
          template: PREBUILT_V2
          spec:
            id: ppanel-server
            source:
                image: ppanel/ppanel-server:latest
            ports:
                - id: server
                  port: 8080
                  type: HTTP
            volumes:
                - id: config
                  dir: /app/etc
            instructions:
                - title: Server Address
                  content: https://${PUBLIC_SERVER_DOMAIN}.zeabur.app
                - title: JWT Access Secret
                  content: ${JWT_ACCESS_SECRET}
            env:
                JWT_ACCESS_SECRET:
                    default: ${PASSWORD}
                    expose: true
                MYSQL_PASSWORD:
                    default: ${MYSQL_PASSWORD}
                    expose: true
                MYSQL_USERNAME:
                    default: ${MYSQL_USER}
                    expose: true
                PPANEL_SERVER_ARGS:
                    default: --requirepass ${JWT_ACCESS_SECRET}
                REDIS_PASSWORD:
                    default: ${REDIS_PASSWORD}
                    expose: true
          domainKey: PUBLIC_SERVER_DOMAIN
        - name: ppanel-admin-web
          icon: https://raw.githubusercontent.com/perfect-panel/ppanel-assets/main/logo.svg
          template: PREBUILT_V2
          spec:
            id: ppanel-admin-web
            source:
                image: ppanel/ppanel-admin-web:latest
            ports:
                - id: admin
                  port: 3000
                  type: HTTP
            instructions:
                - title: Default Language
                  content: ${NEXT_PUBLIC_DEFAULT_LANGUAGE}
                - title: Admin Web Address
                  content: https://${PUBLIC_ADMIN_DOMAIN}.zeabur.app
                - title: Server Address
                  content: https://${PUBLIC_ADMIN_DOMAIN}.zeabur.app
            env:
                NEXT_PUBLIC_API_URL:
                    default: https://${PUBLIC_SERVER_DOMAIN}.zeabur.app
                    expose: false
                NEXT_PUBLIC_DEFAULT_LANGUAGE:
                    default: en-US
                    expose: false
                NEXT_PUBLIC_DEFAULT_USER_EMAIL:
                    default: ""
                    expose: false
                NEXT_PUBLIC_DEFAULT_USER_PASSWORD:
                    default: ""
                    expose: false
                NEXT_PUBLIC_SITE_URL:
                    default: https://${PUBLIC_ADMIN_DOMAIN}.zeabur.app
                    expose: false
            configs: []
          domainKey: PUBLIC_ADMIN_DOMAIN
        - name: ppanel-user-web
          icon: https://raw.githubusercontent.com/perfect-panel/ppanel-assets/main/logo.svg
          template: PREBUILT_V2
          spec:
            id: ppanel-user-web
            source:
                image: ppanel/ppanel-user-web:latest
            ports:
                - id: user
                  port: 3000
                  type: HTTP
            instructions:
                - title: Default Language
                  content: ${NEXT_PUBLIC_DEFAULT_LANGUAGE}
                - title: User Web Address
                  content: https://${PUBLIC_USER_DOMAIN}.zeabur.app
                - title: Server Address
                  content: https://${PUBLIC_USER_DOMAIN}.zeabur.app
            env:
                NEXT_PUBLIC_API_URL:
                    default: https://${PUBLIC_SERVER_DOMAIN}.zeabur.app
                    expose: false
                NEXT_PUBLIC_DEFAULT_LANGUAGE:
                    default: en-US
                    expose: false
                NEXT_PUBLIC_DEFAULT_USER_EMAIL:
                    default: ""
                    expose: false
                NEXT_PUBLIC_DEFAULT_USER_PASSWORD:
                    default: ""
                    expose: false
                NEXT_PUBLIC_DISCORD_LINK:
                    default: ""
                    expose: false
                NEXT_PUBLIC_EMAIL:
                    default: ""
                    expose: false
                NEXT_PUBLIC_FACEBOOK_LINK:
                    default: ""
                    expose: false
                NEXT_PUBLIC_GITHUB_LINK:
                    default: ""
                    expose: false
                NEXT_PUBLIC_INSTAGRAM_LINK:
                    default: ""
                    expose: false
                NEXT_PUBLIC_LINKEDIN_LINK:
                    default: ""
                    expose: false
                NEXT_PUBLIC_SITE_URL:
                    default: https://${PUBLIC_USER_DOMAIN}.zeabur.app
                    expose: false
                NEXT_PUBLIC_TELEGRAM_LINK:
                    default: ""
                    expose: false
                NEXT_PUBLIC_TWITTER_LINK:
                    default: ""
                    expose: false
            configs: []
          domainKey: PUBLIC_USER_DOMAIN
localization:
    en-US:
        description: |
            PPanel is a pure, professional, and perfect open-source proxy panel tool, designed to be your ideal choice for learning and practical use.
        coverImage: https://urlscan.io/liveshot/?width=1920&height=1080&url=https://user.ppanel.dev
        variables:
            - key: PUBLIC_SERVER_DOMAIN
              type: DOMAIN
              name: SERVER DOMAIN
              description: What is the domain you want for your ppanel server?
            - key: PUBLIC_ADMIN_DOMAIN
              type: DOMAIN
              name: ADMIN DOMAIN
              description: What is the domain you want for your ppanel admin web?
            - key: PUBLIC_USER_DOMAIN
              type: DOMAIN
              name: USER DOMAIN
              description: What is the domain you want for your ppanel user web?
        readme: |-
            # Perfect Panel
            PPanel is a pure, professional, and perfect open-source proxy panel tool, designed to be your ideal choice for learning and practical use.

            ## How to use
            - You can access your ppanel server for initialization configuration by visiting SERVER DOMAIN.zeabur.app.
            - You can access your ppanel admin web for management operations by visiting ADMIN DOMAIN.zeabur.app.
            - You can access your ppanel user web for use operations by visiting USER DOMAIN.zeabur.app.

            ## Note
            - After modifying the server domain, admin domain, and user domain, please update the corresponding `environment variables` in the corresponding end and restart the service.

            ## Others
            - For all environment variable configurations, please refer to the [PPanel official documentation](https://ppanel.dev).
    zh-CN:
        description: |
            PPanel 是一个纯粹、专业、完美的开源代理面板工具，旨在成为您学习和实际使用的理想选择。
        coverImage: https://urlscan.io/liveshot/?width=1920&height=1080&url=https://user.ppanel.dev
        variables:
            - key: PUBLIC_SERVER_DOMAIN
              type: DOMAIN
              name: 服务端域名
              description: 您想要为您的 ppanel 服务器设置的域名是什么？
            - key: PUBLIC_ADMIN_DOMAIN
              type: DOMAIN
              name: 管理端域名
              description: 您想要为您的 ppanel 管理端设置的域名是什么？
            - key: PUBLIC_USER_DOMAIN
              type: DOMAIN
              name: 用户端域名
              description: 您想要为您的 ppanel 用户端设置的域名是什么？
        readme: |-
            # Perfect Panel
            PPanel 是一个纯粹、专业、完美的开源代理面板工具，旨在成为您学习和实际使用的理想选择。

            ## 如何使用
            - 您可以通过访问 服务端域名.zeabur.app 访问您的 ppanel 服务端进行初始化配置。
            - 您可以通过访问 管理端域名.zeabur.app 访问您的 ppanel 管理端进行管理操作。
            - 您可以通过访问 用户端域名.zeabur.app 访问您的 ppanel 用户端进行使用操作。

            ## 注意事项
            - 修改服务端域名、管理端域名、用户端域名后，请及时更新对应端中的`环境变量`并重启服务。

            ## 其他
            - 所有环境变量配置请参考 [PPanel 官方文档](https://ppanel.dev)。
