diff --git a/ct/ghost.sh b/ct/ghost.sh index 354fde0b..76249ff3 100644 --- a/ct/ghost.sh +++ b/ct/ghost.sh @@ -32,7 +32,7 @@ function update_script() { msg_info "Updating ${APP} LXC" if command -v ghost &> /dev/null; then - current_version=$(ghost --version | awk '{print $2}') #TO REVIEW + current_version=$(ghost version | grep 'Ghost-CLI version' | awk '{print $3}') latest_version=$(npm show ghost-cli version) if [ "$current_version" != "$latest_version" ]; then msg_info "Updating ${APP} from version $current_version to $latest_version" diff --git a/install/ghost-install.sh b/install/ghost-install.sh index a853a686..a9d1b99c 100644 --- a/install/ghost-install.sh +++ b/install/ghost-install.sh @@ -31,8 +31,15 @@ $STD ufw allow 'Nginx Full' # Configure MySQL msg_info "Configuring MySQL" -$STD mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY 'ghost';" +DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) +$STD mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY '$DB_PASS';" $STD mysql -u root -p'ghost' -e "FLUSH PRIVILEGES;" + +{ + echo "MySQL-Credentials" + echo "Username: root" + echo "Password: $DB_PASS" +} >> ~/mysql.creds msg_ok "Configured MySQL"