From f07e6a92b0302b048a46c9689dbd543acb7deaa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Tue, 9 Dec 2025 16:03:13 +0100 Subject: [PATCH] Refactor (#9808) --- frontend/public/json/wordpress.json | 2 +- install/wordpress-install.sh | 26 ++++++-------------------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/frontend/public/json/wordpress.json b/frontend/public/json/wordpress.json index 567a9f5dd..c8214f19d 100644 --- a/frontend/public/json/wordpress.json +++ b/frontend/public/json/wordpress.json @@ -11,7 +11,7 @@ "interface_port": 80, "documentation": "https://wordpress.org/documentation/", "website": "https://wordpress.org/", - "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@master/webp/wordpress.webp", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/wordpress.webp", "config_path": "/var/www/html/wordpress/wp-config.php", "description": "WordPress is the simplest, most popular way to create your own website or blog. In fact, WordPress powers over 43.6% of all the websites on the Internet. Yes – more than one in four websites that you visit are likely powered by WordPress.\n\nOn a slightly more technical level, WordPress is an open-source content management system licensed under GPLv2, which means that anyone can use or modify the WordPress software for free.", "install_methods": [ diff --git a/install/wordpress-install.sh b/install/wordpress-install.sh index 058922776..d7a56936a 100644 --- a/install/wordpress-install.sh +++ b/install/wordpress-install.sh @@ -15,34 +15,20 @@ update_os PHP_VERSION="8.4" PHP_FPM="YES" PHP_MODULE="common,snmp,imap,mysql" PHP_APACHE="YES" setup_php setup_mariadb - -msg_info "Setting up Database" -DB_NAME=wordpress_db -DB_USER=wordpress -DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) -$STD mariadb -u root -e "CREATE DATABASE $DB_NAME;" -$STD mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';" -$STD mariadb -u root -e "GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;" -{ - echo "WordPress Credentials" - echo "Database User: $DB_USER" - echo "Database Password: $DB_PASS" - echo "Database Name: $DB_NAME" -} >>~/wordpress.creds -msg_ok "Set up Database" +MARIADB_DB_NAME="wordpress_db" MARIADB_DB_USER="wordpress" setup_mariadb_db msg_info "Installing Wordpress (Patience)" -cd /var/www/html || exit +cd /var/www/html curl -fsSL "https://wordpress.org/latest.zip" -o "latest.zip" $STD unzip latest.zip chown -R www-data:www-data wordpress/ -cd /var/www/html/wordpress || exit +cd /var/www/html/wordpress find . -type d -exec chmod 755 {} \; find . -type f -exec chmod 644 {} \; mv wp-config-sample.php wp-config.php -sed -i -e "s|^define( 'DB_NAME', '.*' );|define( 'DB_NAME', '$DB_NAME' );|" \ - -e "s|^define( 'DB_USER', '.*' );|define( 'DB_USER', '$DB_USER' );|" \ - -e "s|^define( 'DB_PASSWORD', '.*' );|define( 'DB_PASSWORD', '$DB_PASS' );|" \ +sed -i -e "s|^define( 'DB_NAME', '.*' );|define( 'DB_NAME', '$MARIADB_DB_NAME' );|" \ + -e "s|^define( 'DB_USER', '.*' );|define( 'DB_USER', '$MARIADB_DB_USER' );|" \ + -e "s|^define( 'DB_PASSWORD', '.*' );|define( 'DB_PASSWORD', '$MARIADB_DB_PASS' );|" \ /var/www/html/wordpress/wp-config.php rm -rf /var/www/html/latest.zip msg_ok "Installed Wordpress"