Skip to content

Commit f07e6a9

Browse files
authored
Refactor (#9808)
1 parent ee3c4f8 commit f07e6a9

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed

frontend/public/json/wordpress.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"interface_port": 80,
1212
"documentation": "https://wordpress.org/documentation/",
1313
"website": "https://wordpress.org/",
14-
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@master/webp/wordpress.webp",
14+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/wordpress.webp",
1515
"config_path": "/var/www/html/wordpress/wp-config.php",
1616
"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.",
1717
"install_methods": [

install/wordpress-install.sh

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,20 @@ update_os
1515

1616
PHP_VERSION="8.4" PHP_FPM="YES" PHP_MODULE="common,snmp,imap,mysql" PHP_APACHE="YES" setup_php
1717
setup_mariadb
18-
19-
msg_info "Setting up Database"
20-
DB_NAME=wordpress_db
21-
DB_USER=wordpress
22-
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
23-
$STD mariadb -u root -e "CREATE DATABASE $DB_NAME;"
24-
$STD mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
25-
$STD mariadb -u root -e "GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
26-
{
27-
echo "WordPress Credentials"
28-
echo "Database User: $DB_USER"
29-
echo "Database Password: $DB_PASS"
30-
echo "Database Name: $DB_NAME"
31-
} >>~/wordpress.creds
32-
msg_ok "Set up Database"
18+
MARIADB_DB_NAME="wordpress_db" MARIADB_DB_USER="wordpress" setup_mariadb_db
3319

3420
msg_info "Installing Wordpress (Patience)"
35-
cd /var/www/html || exit
21+
cd /var/www/html
3622
curl -fsSL "https://wordpress.org/latest.zip" -o "latest.zip"
3723
$STD unzip latest.zip
3824
chown -R www-data:www-data wordpress/
39-
cd /var/www/html/wordpress || exit
25+
cd /var/www/html/wordpress
4026
find . -type d -exec chmod 755 {} \;
4127
find . -type f -exec chmod 644 {} \;
4228
mv wp-config-sample.php wp-config.php
43-
sed -i -e "s|^define( 'DB_NAME', '.*' );|define( 'DB_NAME', '$DB_NAME' );|" \
44-
-e "s|^define( 'DB_USER', '.*' );|define( 'DB_USER', '$DB_USER' );|" \
45-
-e "s|^define( 'DB_PASSWORD', '.*' );|define( 'DB_PASSWORD', '$DB_PASS' );|" \
29+
sed -i -e "s|^define( 'DB_NAME', '.*' );|define( 'DB_NAME', '$MARIADB_DB_NAME' );|" \
30+
-e "s|^define( 'DB_USER', '.*' );|define( 'DB_USER', '$MARIADB_DB_USER' );|" \
31+
-e "s|^define( 'DB_PASSWORD', '.*' );|define( 'DB_PASSWORD', '$MARIADB_DB_PASS' );|" \
4632
/var/www/html/wordpress/wp-config.php
4733
rm -rf /var/www/html/latest.zip
4834
msg_ok "Installed Wordpress"

0 commit comments

Comments
 (0)