# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: statping.ng with MySQL
spec:
    description: Web and App Status Monitoring for Any Type of Project With MySQL as Database
    coverImage: https://statping-ng.github.io/assets/img/banner.png
    icon: https://statping-ng.github.io/assets/img/banner.png
    tags:
        - Monitoring
    readme: "# Statping-ng - Status Page & Monitoring Server\n\n> with MySQL as Database\n\nAn easy to use Status Page for your websites and applications. Statping will automatically fetch the application and render a beautiful status page with tons of features for you to build an even better status page. This Status Page generator allows you to use MySQL, Postgres, or SQLite on multiple operating systems.        \n\n# UserName and Password\n- default username: admin\n- default password: admin\n\n[Website](https://statping-ng.github.io)|[Wiki](https://github.com/statping-ng/statping-ng/wiki)"
    services:
        - name: MySQL
          icon: https://raw.githubusercontent.com/zeabur/service-icons/main/marketplace/mysql.svg
          template: PREBUILT
          spec:
            id: mysql
            source:
                image: mysql:8.0.33
            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
                    skip-host-cache
                    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

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

                    !includedir /etc/mysql/conf.d/
                  permission: null
                  envsubst: null
        - name: statping.ng
          icon: https://statping-ng.github.io/assets/img/banner.png
          template: PREBUILT
          spec:
            id: statping-ng
            source:
                image: adamboutcher/statping-ng:latest
            ports:
                - id: web
                  port: 8080
                  type: HTTP
            volumes:
                - id: statping-data
                  dir: /app
            env:
                DB_CONN:
                    default: mysql
                DB_DATABASE:
                    default: ${MYSQL_DATABASE}
                DB_HOST:
                    default: ${MYSQL_HOST}
                DB_PASS:
                    default: ${MYSQL_PASSWORD}
                DB_PORT:
                    default: ${MYSQL_PORT}
                DB_USER:
                    default: ${MYSQL_USERNAME}
localization:
    zh-CN:
        description: Statping-ng - 状态页 & 监控服务
        readme: |
            一个易于使用的网站和应用程序状态页面。Statping 将自动获取应用程序并呈现一个漂亮的状态页面，具有许多功能，可以帮助您构建更好的状态页面。这个状态页面生成器允许您在多个操作系统上使用 MySQL、Postgres 或 SQLite。

            ## 默认用户名密码

            - 默认用户名: admin
            - 默认密码: admin

            [Website](https://statping-ng.github.io)|[Wiki](https://github.com/statping-ng/statping-ng/wiki)
