From a64ed00579296c1c013631bfaa8176bdd44887b0 Mon Sep 17 00:00:00 2001 From: wanghe Date: Thu, 15 Aug 2024 14:33:28 +0800 Subject: [PATCH] feat: Support MySQL v8.4.2 (#1934) --- apps/mysql/8.4.2/conf/my.cnf | 13 +++++++++++++ apps/mysql/8.4.2/data.yml | 17 +++++++++++++++++ apps/mysql/8.4.2/docker-compose.yml | 24 ++++++++++++++++++++++++ apps/mysql/8.4.2/scripts/upgrade.sh | 9 +++++++++ renovate.json | 6 +++--- 5 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 apps/mysql/8.4.2/conf/my.cnf create mode 100755 apps/mysql/8.4.2/data.yml create mode 100644 apps/mysql/8.4.2/docker-compose.yml create mode 100644 apps/mysql/8.4.2/scripts/upgrade.sh diff --git a/apps/mysql/8.4.2/conf/my.cnf b/apps/mysql/8.4.2/conf/my.cnf new file mode 100644 index 00000000..13e999b0 --- /dev/null +++ b/apps/mysql/8.4.2/conf/my.cnf @@ -0,0 +1,13 @@ +[mysqld] +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 + +pid-file=/var/run/mysqld/mysqld.pid +[client] +socket=/var/run/mysqld/mysqld.sock + +!includedir /etc/mysql/conf.d/ \ No newline at end of file diff --git a/apps/mysql/8.4.2/data.yml b/apps/mysql/8.4.2/data.yml new file mode 100755 index 00000000..221fa8bd --- /dev/null +++ b/apps/mysql/8.4.2/data.yml @@ -0,0 +1,17 @@ +additionalProperties: + formFields: + - default: mysql + envKey: PANEL_DB_ROOT_PASSWORD + labelEn: Root Password + labelZh: root用户密码 + random: true + required: true + rule: paramComplexity + type: password + - default: 3306 + envKey: PANEL_APP_PORT_HTTP + labelEn: Port + labelZh: 端口 + required: true + rule: paramPort + type: number diff --git a/apps/mysql/8.4.2/docker-compose.yml b/apps/mysql/8.4.2/docker-compose.yml new file mode 100644 index 00000000..a79f7ae1 --- /dev/null +++ b/apps/mysql/8.4.2/docker-compose.yml @@ -0,0 +1,24 @@ +services: + mysql: + image: mysql:8.4.2 + container_name: ${CONTAINER_NAME} + restart: always + environment: + MYSQL_ROOT_PASSWORD: ${PANEL_DB_ROOT_PASSWORD} + networks: + - 1panel-network + ports: + - ${PANEL_APP_PORT_HTTP}:3306 + volumes: + - ./data/:/var/lib/mysql + - ./conf/my.cnf:/etc/my.cnf + - ./log:/var/log/mysql + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + labels: + createdBy: "Apps" + command: + - --mysql-native-password=on +networks: + 1panel-network: + external: true diff --git a/apps/mysql/8.4.2/scripts/upgrade.sh b/apps/mysql/8.4.2/scripts/upgrade.sh new file mode 100644 index 00000000..029df7a7 --- /dev/null +++ b/apps/mysql/8.4.2/scripts/upgrade.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +CONFIG_FILE="./conf/my.cnf" + +if grep -q "skip-host-cache" "$CONFIG_FILE"; then + sed -i '/skip-host-cache/d' "$CONFIG_FILE" +else + echo "'skip-host-cache' does not exist in the configuration file." +fi \ No newline at end of file diff --git a/renovate.json b/renovate.json index 1bf371de..73c572b9 100644 --- a/renovate.json +++ b/renovate.json @@ -28,11 +28,11 @@ }, { "matchFileNames": ["apps/mysql/8.0.*/*.yml"], - "allowedVersions": "<8.1" + "allowedVersions": "/^8.0.*/" }, { - "matchFileNames": ["apps/mysql/8.2.*/*.yml"], - "allowedVersions": ">=8.2" + "matchFileNames": ["apps/mysql/8.4.*/*.yml"], + "allowedVersions": "/^8.4.*/" }, { "matchFileNames": ["apps/elasticsearch/7.*/*.yml"],