From 6340d5d87c90c161e4b9aa15fac9b49a9f29d8ff Mon Sep 17 00:00:00 2001 From: Stefan Pejcic Date: Fri, 10 May 2024 12:50:14 +0200 Subject: [PATCH] Update INSTALL.sh --- INSTALL.sh | 55 +++++------------------------------------------------- 1 file changed, 5 insertions(+), 50 deletions(-) diff --git a/INSTALL.sh b/INSTALL.sh index 25a5f3d..873dd5d 100644 --- a/INSTALL.sh +++ b/INSTALL.sh @@ -216,14 +216,16 @@ FUNCTIONS=( configure_nginx configure_modsecurity - mysql_for_ubuntu - + + run_mysql_docker_container setup_ufw setup_opencli install_all_locales helper_function_for_nginx_on_aws_and_azure download_and_import_docker_images + configure_mysql + start_services set_system_cronjob cleanup @@ -607,7 +609,7 @@ configure_nginx() { echo "Setting Nginx configuration.." - # https://dev.openpanel.co/services.html#Nginx + # https://dev.openpanel.co/services/nginx debug_log cp -fr ${OPENPANEL_DIR}conf/nginx.conf /etc/nginx/nginx.conf # dir for domlogs @@ -630,53 +632,6 @@ configure_nginx() { } - -mysql_for_ubuntu() { - - ubuntu_version=$(lsb_release -rs) - - # Check if the version is 22.04 - if [[ "$ubuntu_version" == "22.04" ]]; then - #echo "This is Ubuntu 22.04" - run_mysql_docker_container - configure_mysql - elif [[ "$ubuntu_version" == "24.04" ]]; then - #echo "This is Ubuntu 24.04" - install_mysql_for_ubuntu24 - else - radovan 1 "$ubuntu_version - This version of Ubuntu is not supported. Please use 22.04 or 24.02" - fi -} - - -install_mysql_for_ubuntu24() { - echo "Tweaking MySQL configuration.." - - $PACKAGE_MANAGER -qq install mysql-server -y - - # https://dev.openpanel.co/services.html#MySQL - - debug_log cp -fr ${OPENPANEL_DIR}/conf/mysqld.cnf /etc/mysql/mysql.conf.d/mysqld.cnf - debug_log service mysql start - - echo "Populating the 'panel' database.." - generate_random_password() { - openssl rand -base64 12 | tr -dc 'a-zA-Z0-9' - } - - RANDOM_PASSWORD=$(generate_random_password) - SQL_FILE="${OPENPANEL_DIR}DATABASE.sql" - mysql -u root -e "CREATE DATABASE panel;" - mysql -u root -e "CREATE USER 'panel'@'localhost' IDENTIFIED BY '${RANDOM_PASSWORD}';" - mysql -u root -e "GRANT ALL PRIVILEGES ON panel.* TO 'panel'@'localhost';" - mysql -u root panel < "${SQL_FILE}" - sed -i "s/\"mysql_password\": \"NewPassword\"/\"mysql_password\": \"${RANDOM_PASSWORD}\"/g" ${OPENPADMIN_DIR}config.json - sed -i "s/password = \"NewPassword\"/password = \"${RANDOM_PASSWORD}\"/g" ${OPENPADMIN_DIR}db.cnf - - echo -e "${GREEN}Database is ready.${RESET}" -} - - run_mysql_docker_container() { # MySQL