Refactor (#9808)
This commit is contained in:
parent
ee3c4f843d
commit
f07e6a92b0
@ -11,7 +11,7 @@
|
|||||||
"interface_port": 80,
|
"interface_port": 80,
|
||||||
"documentation": "https://wordpress.org/documentation/",
|
"documentation": "https://wordpress.org/documentation/",
|
||||||
"website": "https://wordpress.org/",
|
"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",
|
"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.",
|
"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": [
|
"install_methods": [
|
||||||
|
|||||||
@ -15,34 +15,20 @@ update_os
|
|||||||
|
|
||||||
PHP_VERSION="8.4" PHP_FPM="YES" PHP_MODULE="common,snmp,imap,mysql" PHP_APACHE="YES" setup_php
|
PHP_VERSION="8.4" PHP_FPM="YES" PHP_MODULE="common,snmp,imap,mysql" PHP_APACHE="YES" setup_php
|
||||||
setup_mariadb
|
setup_mariadb
|
||||||
|
MARIADB_DB_NAME="wordpress_db" MARIADB_DB_USER="wordpress" setup_mariadb_db
|
||||||
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"
|
|
||||||
|
|
||||||
msg_info "Installing Wordpress (Patience)"
|
msg_info "Installing Wordpress (Patience)"
|
||||||
cd /var/www/html || exit
|
cd /var/www/html
|
||||||
curl -fsSL "https://wordpress.org/latest.zip" -o "latest.zip"
|
curl -fsSL "https://wordpress.org/latest.zip" -o "latest.zip"
|
||||||
$STD unzip latest.zip
|
$STD unzip latest.zip
|
||||||
chown -R www-data:www-data wordpress/
|
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 d -exec chmod 755 {} \;
|
||||||
find . -type f -exec chmod 644 {} \;
|
find . -type f -exec chmod 644 {} \;
|
||||||
mv wp-config-sample.php wp-config.php
|
mv wp-config-sample.php wp-config.php
|
||||||
sed -i -e "s|^define( 'DB_NAME', '.*' );|define( 'DB_NAME', '$DB_NAME' );|" \
|
sed -i -e "s|^define( 'DB_NAME', '.*' );|define( 'DB_NAME', '$MARIADB_DB_NAME' );|" \
|
||||||
-e "s|^define( 'DB_USER', '.*' );|define( 'DB_USER', '$DB_USER' );|" \
|
-e "s|^define( 'DB_USER', '.*' );|define( 'DB_USER', '$MARIADB_DB_USER' );|" \
|
||||||
-e "s|^define( 'DB_PASSWORD', '.*' );|define( 'DB_PASSWORD', '$DB_PASS' );|" \
|
-e "s|^define( 'DB_PASSWORD', '.*' );|define( 'DB_PASSWORD', '$MARIADB_DB_PASS' );|" \
|
||||||
/var/www/html/wordpress/wp-config.php
|
/var/www/html/wordpress/wp-config.php
|
||||||
rm -rf /var/www/html/latest.zip
|
rm -rf /var/www/html/latest.zip
|
||||||
msg_ok "Installed Wordpress"
|
msg_ok "Installed Wordpress"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user