Merge branch 'hotfix/v2.5.1' into develop

This commit is contained in:
Alexey Safronov 2024-05-13 11:24:39 +04:00
commit a127774c46
3 changed files with 13 additions and 9 deletions

View File

@ -1371,8 +1371,13 @@ install_product () {
reconfigure APP_URL_PORTAL "${APP_URL_PORTAL:-"http://${PACKAGE_SYSNAME}-router:8092"}"
reconfigure EXTERNAL_PORT ${EXTERNAL_PORT}
if [[ -z ${MYSQL_HOST} ]] && [ "$INSTALL_MYSQL_SERVER" == "true" ]; then
echo -n "Waiting for MySQL container to become healthy..."
(timeout 30 bash -c "while ! docker inspect --format '{{json .State.Health.Status }}' ${PACKAGE_SYSNAME}-mysql-server | grep -q 'healthy'; do sleep 1; done") && echo "OK" || (echo "FAILED")
fi
docker-compose -f $BASE_DIR/migration-runner.yml up -d
docker wait ${PACKAGE_SYSNAME}-migration-runner
echo -n "Waiting for database migration to complete..." && docker wait ${PACKAGE_SYSNAME}-migration-runner && echo "OK"
docker-compose -f $BASE_DIR/${PRODUCT}.yml up -d
docker-compose -f ${PROXY_YML} up -d
docker-compose -f $BASE_DIR/notify.yml up -d

View File

@ -446,14 +446,9 @@ change_mysql_config(){
else
sed "s/collation_server.*/collation_server = utf8_general_ci/" -i ${CNF_PATH} || true # ignore errors
fi
MYSQL_AUTHENTICATION_PLUGIN=$($MYSQL -e "SHOW VARIABLES LIKE 'default_authentication_plugin';" -s | awk '{print $2}' >/dev/null 2>&1)
MYSQL_AUTHENTICATION_PLUGIN=${MYSQL_AUTHENTICATION_PLUGIN:-caching_sha2_password}
if ! grep -q "^default-authentication-plugin" ${CNF_PATH}; then
sed "/\[mysqld\]/a default-authentication-plugin = ${MYSQL_AUTHENTICATION_PLUGIN}" -i ${CNF_PATH}
else
sed "s/default-authentication-plugin.*/default-authentication-plugin = ${MYSQL_AUTHENTICATION_PLUGIN}/" -i ${CNF_PATH} || true # ignore errors
if grep -q "^default-authentication-plugin" ${CNF_PATH}; then
sed "/^default-authentication-plugin/d" -i "${CNF_PATH}" || true # ignore errors
fi
if [ -e ${CNF_SERVICE_PATH} ]; then

View File

@ -1,7 +1,6 @@
services:
onlyoffice-mysql-server:
image: ${MYSQL_IMAGE}
command: --default-authentication-plugin=caching_sha2_password
cap_add:
- SYS_NICE
container_name: ${MYSQL_CONTAINER_NAME}
@ -17,6 +16,11 @@ services:
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping --silent"]
interval: 10s
timeout: 5s
retries: 3
volumes:
- mysql_data:/var/lib/mysql
- ./config/mysql/conf.d/:/etc/mysql/conf.d