2025-03-21 17:29:22 +00:00
type: update
id: mbadmin
2025-03-27 16:36:52 +00:00
version: '2.6'
2025-03-21 17:29:22 +00:00
name: MB Administration
description: Mighty Box Control Panel Administration
targetNodes:
nodeGroup: cp
onInstall:
- cmd[cp]:
user: root
commands:
# Ensure all directories exist
- mkdir -p /home/litespeed/mbmanager
- mkdir -p /home/litespeed/mbmanager/relay
- mkdir -p /home/litespeed/mbmanager/ssl-manager
2025-06-13 17:17:12 +00:00
- mkdir -p /home/litespeed/mbmanager/scripts
# Download OPCache scripts with verification
- cd /home/litespeed/mbmanager/scripts
2025-06-13 17:37:35 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/check_opcache.php
2025-06-13 17:17:12 +00:00
- if [ ! -f check_opcache.php ]; then echo "Failed to download check_opcache.php"; exit 1; fi
2025-06-13 17:37:35 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/toggle_opcache.php
2025-06-13 17:17:12 +00:00
- if [ ! -f toggle_opcache.php ]; then echo "Failed to download toggle_opcache.php"; exit 1; fi
2025-06-13 17:37:35 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/clear_opcache.php
2025-06-13 17:17:12 +00:00
- if [ ! -f clear_opcache.php ]; then echo "Failed to download clear_opcache.php"; exit 1; fi
2025-06-13 17:37:35 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/update_opcache_settings.sh
2025-06-13 17:17:12 +00:00
- if [ ! -f update_opcache_settings.sh ]; then echo "Failed to download update_opcache_settings.sh"; exit 1; fi
2025-06-17 15:29:38 +00:00
# Download LiteSpeed scripts with verification
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/check_litespeed.php
- if [ ! -f check_litespeed.php ]; then echo "Failed to download check_litespeed.php"; exit 1; fi
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/manage_litespeed.php
- if [ ! -f manage_litespeed.php ]; then echo "Failed to download manage_litespeed.php"; exit 1; fi
2025-06-17 18:09:33 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/check_redis.php
- if [ ! -f check_redis.php ]; then echo "Failed to download check_redis.php"; exit 1; fi
2025-06-18 10:42:50 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/litespeed_metrics.sh
- if [ ! -f litespeed_metrics.sh ]; then echo "Failed to download litespeed_metrics.sh"; exit 1; fi
2025-06-13 17:17:12 +00:00
- chmod +x *.php *.sh
2025-04-02 17:55:34 +00:00
# Download WordPress Installer with path verification
- cd /home/litespeed/mbmanager
2025-06-13 17:37:35 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/install-wordpress.sh
2025-04-02 17:55:34 +00:00
- if [ ! -f install-wordpress.sh ]; then echo "Failed to download install-wordpress.sh"; exit 1; fi
# Download main scripts with verification
2025-06-13 17:37:35 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/litespeed_fetch_settings.sh
2025-04-02 17:55:34 +00:00
- if [ ! -f litespeed_fetch_settings.sh ]; then echo "Failed to download litespeed_fetch_settings.sh"; exit 1; fi
2025-06-13 17:37:35 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/litespeed_update_settings.sh
2025-04-02 17:55:34 +00:00
- if [ ! -f litespeed_update_settings.sh ]; then echo "Failed to download litespeed_update_settings.sh"; exit 1; fi
- chmod +x *.sh
# Download relay scripts with verification
2025-03-21 17:29:22 +00:00
- cd /home/litespeed/mbmanager/relay
2025-06-13 17:37:35 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/relay/check_relay_installation.sh
2025-04-02 17:55:34 +00:00
- if [ ! -f check_relay_installation.sh ]; then echo "Failed to download check_relay_installation.sh"; exit 1; fi
2025-06-13 17:37:35 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/relay/check_relay_status.sh
2025-04-02 17:55:34 +00:00
- if [ ! -f check_relay_status.sh ]; then echo "Failed to download check_relay_status.sh"; exit 1; fi
2025-06-13 17:37:35 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/relay/disable_relay.sh
2025-04-02 17:55:34 +00:00
- if [ ! -f disable_relay.sh ]; then echo "Failed to download disable_relay.sh"; exit 1; fi
2025-06-13 17:37:35 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/relay/enable_relay.sh
2025-04-02 17:55:34 +00:00
- if [ ! -f enable_relay.sh ]; then echo "Failed to download enable_relay.sh"; exit 1; fi
2025-06-13 17:37:35 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/relay/flush_caches.sh
2025-04-02 17:55:34 +00:00
- if [ ! -f flush_caches.sh ]; then echo "Failed to download flush_caches.sh"; exit 1; fi
2025-06-13 17:37:35 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/relay/install_relay_ocp.sh
2025-04-02 17:55:34 +00:00
- if [ ! -f install_relay_ocp.sh ]; then echo "Failed to download install_relay_ocp.sh"; exit 1; fi
2025-06-13 17:37:35 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/relay/uninstall_relay.sh
2025-04-02 17:55:34 +00:00
- if [ ! -f uninstall_relay.sh ]; then echo "Failed to download uninstall_relay.sh"; exit 1; fi
- chmod +x *.sh
# Download SSL manager script with verification
2025-03-21 17:29:22 +00:00
- cd /home/litespeed/mbmanager/ssl-manager
2025-06-13 17:37:35 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/ssl-manager/ssl_manager.sh
2025-04-02 17:55:34 +00:00
- if [ ! -f ssl_manager.sh ]; then echo "Failed to download ssl_manager.sh"; exit 1; fi
2025-06-13 17:37:35 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/ssl-manager/ipchecker.sh
2025-04-02 17:55:34 +00:00
- if [ ! -f ipchecker.sh ]; then echo "Failed to download ipchecker.sh"; exit 1; fi
2025-06-13 17:37:35 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/ssl-manager/ssl_remover.sh
2025-04-02 17:55:34 +00:00
- if [ ! -f ssl_remover.sh ]; then echo "Failed to download ssl_remover.sh"; exit 1; fi
2025-06-13 17:37:35 +00:00
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/ssl-manager/xmlchecker.sh
2025-04-02 17:55:34 +00:00
- if [ ! -f xmlchecker.sh ]; then echo "Failed to download xmlchecker.sh"; exit 1; fi
- chmod +x *.sh
2025-04-02 17:58:51 +00:00
# Install Certbot for AlmaLinux with memory constraints
- echo "Installing Certbot... (this may take a few minutes)"
- MEMFREE=$(free -m | grep "Mem:" | awk '{print $4}')
- echo "Available memory: ${MEMFREE}MB"
- if [ $MEMFREE -lt 500 ]; then
echo "Low memory detected (${MEMFREE}MB), running dnf with minimal memory usage";
dnf install -y --setopt=install_weak_deps=False --best --allowerasing certbot || echo "Certbot installation failed but continuing";
else
dnf install -y certbot || echo "Certbot installation failed but continuing";
fi
# Only install DNS plugin if certbot was installed successfully
- if command -v certbot > /dev/null; then
echo "Installing Certbot DNS plugin...";
dnf install -y --setopt=install_weak_deps=False python3-certbot-dns-cloudflare || echo "DNS plugin installation failed but continuing";
else
echo "Skipping DNS plugin installation as Certbot wasn't installed";
fi
2025-03-21 17:29:22 +00:00
menu:
- confirmText: Are you sure you want to execute this WP-CLI command?
loadingText: Executing WP-CLI command...
caption: Execute WP-CLI Command
action: dynamic_wp_cli
settings: wpCliConfig
successText: "${response.out}"
- confirmText: Are you sure you want to sync directories using rsync?
loadingText: Syncing directories...
caption: Sync Directories
action: rsync_directories
settings: rsyncConfig
successText: "Directory synchronized successfully from '${settings.old_directory}' to '/var/www/webroot/ROOT/'."
- confirmText: Are you sure you want to check relay installation?
loadingText: Checking relay installation...
caption: Check Relay Installation
action: check_relay_installation
successText: "${response.out}"
- confirmText: Are you sure you want to check relay status?
loadingText: Checking relay status...
caption: Check Relay Status
action: check_relay_status
successText: "${response.out}"
- confirmText: Are you sure you want to disable the relay?
loadingText: Disabling relay...
caption: Disable Relay
action: disable_relay
successText: "${response.out}"
- confirmText: Are you sure you want to enable the relay?
loadingText: Enabling relay...
caption: Enable Relay
action: enable_relay
successText: "${response.out}"
- confirmText: Are you sure you want to install Relay and OCP?
loadingText: Installing Relay and OCP
caption: Install Relay
action: install_relay
successText: "${response.out}"
- confirmText: Are you sure you want to flush keys for Redis and OCP?
loadingText: Clearing Keys
caption: Flush Keys
action: flush_keys
successText: "${response.out}"
- confirmText: Check the Redis Status?
loadingText: Checking Redis
caption: Check Redis Status
action: redis_status
successText: "${response.out}"
- confirmText: Are you sure you want to disable Redis?
loadingText: Disabling Redis
caption: Disable Redis
action: redis_disable
successText: "${response.out}"
- confirmText: Enable Redis?
loadingText: Enabling Redis
caption: Enable Redis
action: redis_enable
successText: "${response.out}"
- confirmText: Are you sure you want to flush keys for Redis?
loadingText: Clearing Keys
caption: Flush Keys
action: redis_clear_keys
successText: "${response.out}"
2025-06-17 18:09:33 +00:00
- confirmText: Get Redis metrics?
loadingText: Getting Redis metrics...
caption: Get Redis Metrics
action: redis_metrics
successText: "${response.out}"
2025-06-16 16:41:32 +00:00
- confirmText: Check OPcache status?
loadingText: Checking OPcache status...
caption: Check OPcache Status
action: opcache_status
successText: "${response.out}"
- confirmText: Get detailed OPcache information?
loadingText: Getting OPcache details...
caption: OPcache Summary
action: opcache_summary
successText: "${response.out}"
- confirmText: Get OPcache statistics?
loadingText: Getting OPcache statistics...
caption: OPcache Statistics
action: opcache_statistics
successText: "${response.out}"
- confirmText: Get OPcache settings?
loadingText: Getting OPcache settings...
caption: Get OPcache Settings
action: opcache_fetch_settings
successText: "${response.out}"
- confirmText: Are you sure you want to update OPcache settings?
loadingText: Updating OPcache settings...
caption: Update OPcache Settings
action: opcache_update_settings
settings: opcacheConfig
successText: "${response.out}"
2025-06-16 17:02:24 +00:00
- confirmText: Are you sure you want to enable OPcache?
loadingText: Enabling OPcache and restarting PHP...
caption: Enable OPcache
action: enable_opcache
successText: "${response.out}"
- confirmText: Are you sure you want to disable OPcache?
loadingText: Disabling OPcache and restarting PHP...
caption: Disable OPcache
action: disable_opcache
successText: "${response.out}"
- confirmText: Are you sure you want to clear OPcache?
loadingText: Clearing OPcache...
caption: Clear OPcache
action: clear_opcache
successText: "${response.out}"
2025-03-21 17:29:22 +00:00
- confirmText: Do you want to export the WordPress database?
loadingText: Exporting WordPress Database...
caption: Export WordPress DB
action: export_wp_db
settings: dbExportConfig
successText: "Database exported successfully to /var/www/webroot/ROOT/${settings.db_filename}.sql"
- confirmText: Are you sure you want to import the WordPress database?
loadingText: Importing WordPress Database...
caption: Import WordPress DB
action: import_wp_db
settings: dbImportConfig
successText: "${response.out}"
- confirmText: Are you sure you want to perform a search and replace?
loadingText: Performing Search and Replace...
caption: Search and Replace URL
action: search_replace_urls
settings: searchReplaceConfig
successText: "Search and Replace completed successfully for '${settings.old_url}' with '${settings.new_url}' in all tables."
- confirmText: Are you sure you want to prepare for DB import?
loadingText: Preparing for DB import...
caption: DB Import Preparation
action: db_import_preparation
successText: "${response.out}"
- confirmText: Are you sure you want to issue an SSL certificate for this domain?
loadingText: Issuing SSL Certificate...
caption: Issue SSL Certificate
action: issue_ssl_cert
settings: sslCertConfig
successText: "SSL certificate for '${settings.domain}' has been issued successfully."
- confirmText: Check if the domain is resolving to the expected IP address?
loadingText: Checking Domain...
caption: Check Domain IP
action: check_domain_ip
settings: checkDomainConfig
successText: "${response.out}"
2025-03-21 18:22:40 +00:00
- confirmText: Are you sure you want to remove SSL certificate(s)?
loadingText: Removing SSL Certificate(s)...
caption: Remove SSL Certificate
action: remove_ssl_cert
settings: sslRemoveConfig
successText: "${response.out}"
2025-06-17 15:22:06 +00:00
- confirmText: Check LiteSpeed cache status?
loadingText: Checking LiteSpeed status...
caption: Check LiteSpeed Status
action: litespeed_status
successText: "${response.out}"
- confirmText: Are you sure you want to enable LiteSpeed cache?
loadingText: Enabling LiteSpeed cache...
caption: Enable LiteSpeed Cache
action: litespeed_enable
successText: "${response.out}"
- confirmText: Are you sure you want to disable LiteSpeed cache?
loadingText: Disabling LiteSpeed cache...
caption: Disable LiteSpeed Cache
action: litespeed_disable
successText: "${response.out}"
- confirmText: Are you sure you want to purge all LiteSpeed cache?
loadingText: Purging all cache...
caption: Purge All LiteSpeed Cache
action: litespeed_purgeall
successText: "${response.out}"
- confirmText: Get LiteSpeed plugin version?
loadingText: Getting version...
caption: Get LiteSpeed Version
action: litespeed_ver
successText: "${response.out}"
- confirmText: Get current TTL public setting?
loadingText: Getting TTL setting...
caption: Get TTL Public Setting
action: litespeed_ttlpub
successText: "${response.out}"
- confirmText: Get all LiteSpeed TTL values?
loadingText: Getting TTL values...
caption: Get LiteSpeed TTL Values
action: get_litespeed_ttl_values
successText: "${response.out}"
2025-06-18 10:27:04 +00:00
- confirmText: Get comprehensive LiteSpeed metrics?
loadingText: Gathering metrics...
caption: Get LiteSpeed Metrics
action: litespeed_metrics
successText: "${response.out}"
2025-03-25 13:15:42 +00:00
- confirmText: Are you sure you want to diagnose LiteSpeed configuration?
loadingText: Analyzing configuration...
caption: Diagnose LiteSpeed Config
action: diagnose_litespeed_config
successText: "${response.out}"
2025-03-31 17:37:54 +00:00
- confirmText: Are you sure you want to install WordPress?
loadingText: Installing WordPress...
caption: Install WordPress
action: install_wordpress
settings: wpInstallConfig
successText: "WordPress installed successfully with the provided credentials."
2025-03-21 17:29:22 +00:00
settings:
checkDomainConfig:
submitUnchanged: true
fields:
- name: domain
type: text
caption: Domain Name
required: true
- name: public_ip
type: text
caption: Public IP Address
required: true
wpCliConfig:
submitUnchanged: true
fields:
- name: wp_cli_command
type: text
caption: WP-CLI Command (without 'wp' prefix)
default: "help"
rsyncConfig:
submitUnchanged: true
fields:
- name: old_directory
type: text
caption: Source Directory
required: true
searchReplaceConfig:
submitUnchanged: true
fields:
- name: old_url
type: text
caption: Old URL
required: true
- name: new_url
type: text
caption: New URL
required: true
dbImportConfig:
submitUnchanged: true
fields:
- name: db_filename
type: text
caption: Import DB Filename (without extension)
default: "wordpress_db"
dbExportConfig:
submitUnchanged: true
fields:
- name: db_filename
type: text
caption: Exported DB Filename (without extension)
default: "wordpress_db"
opcacheConfig:
submitUnchanged: true
fields:
- name: memory_consumption
type: text
caption: OPCache Memory Consumption (MB)
default: "128"
- name: interned_strings_buffer
type: text
caption: Interned Strings Buffer (MB)
default: "8"
- name: max_accelerated_files
type: text
caption: Max Accelerated Files
default: "10000"
- name: revalidate_freq
type: text
caption: Revalidate Frequency (Seconds)
default: "2"
litespeedTTL:
submitUnchanged: true
fields:
- name: sizettl
type: text
caption: Public Page Cache TTL
default: "604800"
cacheExcConfig:
submitUnchanged: true
fields:
- name: cache_exc_paths
type: text
caption: Cache Exclusion Paths
default: "/path-to-exclude"
litespeedConfig:
submitUnchanged: true
fields:
- name: TTL_PUB
type: text
caption: TTL Public (Seconds)
default: "3600"
- name: TTL_PRIV
type: text
caption: TTL Private (Seconds)
default: "1800"
- name: TTL_FRONTPAGE
type: text
caption: TTL Frontpage (Seconds)
default: "900"
- name: TTL_FEED
type: text
caption: TTL Feed (Seconds)
default: "7200"
sslCertConfig:
submitUnchanged: true
fields:
- name: public_ip
type: text
caption: Public IP Address
required: true
- name: domain
type: text
caption: Domain Name
required: true
- name: email
type: text
caption: Email Address
required: true
2025-03-21 18:22:40 +00:00
sslRemoveConfig:
submitUnchanged: true
fields:
- name: domains
type: text
caption: Comma-separated Domains
required: true
2025-03-27 16:42:13 +00:00
- name: email
type: text
caption: Email Address (Optional)
default: "${EMAIL}"
2025-03-25 13:15:42 +00:00
cleanCertConfig:
submitUnchanged: true
fields:
- name: domain
type: text
caption: Domain Name
required: true
2025-03-31 17:37:54 +00:00
wpInstallConfig:
submitUnchanged: true
fields:
- name: wpusername
type: text
caption: WordPress Admin Username
default: "admin"
required: true
- name: wppassword
type: text
caption: WordPress Admin Password
default: "admin"
required: true
- name: wpemail
type: text
caption: WordPress Admin Email
default: "admin@example.com"
required: true
2025-03-21 17:29:22 +00:00
actions:
dynamic_wp_cli:
- cmd[cp]:
user: litespeed
commands:
- cd /var/www/webroot/ROOT/
- wp ${settings.wp_cli_command}
- return:
type: info
message: "${response.out}"
rsync_directories:
- cmd[cp]:
commands:
- rsync -avz "/${settings.old_directory}/" /var/www/webroot/ROOT/
- return:
type: info
message: "Directory synchronized successfully from '${settings.old_directory}' to '/var/www/webroot/ROOT/'."
search_replace_urls:
- cmd[cp]:
user: litespeed
commands:
- cd /var/www/webroot/ROOT/
- /home/litespeed/bin/wp search-replace '${settings.old_url}' '${settings.new_url}' --all-tables
- /home/litespeed/bin/wp transient delete --all
- /home/litespeed/bin/wp cache flush
- return:
type: info
message: "Search and Replace completed successfully for '${settings.old_url}' with '${settings.new_url}' in all tables. Deleted Transients and Flushed WP Cache"
import_wp_db:
- cmd[cp]:
user: root
commands:
# Check if WP-CLI is installed
- if [ ! -f /home/litespeed/bin/wp ]; then
echo "WP-CLI not found. Installing...";
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar;
chmod +x wp-cli.phar;
mkdir -p /home/litespeed/bin;
mv wp-cli.phar /home/litespeed/bin/wp;
export PATH=$PATH:/home/litespeed/bin;
else
echo "WP-CLI is already installed.";
fi;
# Verify that WP-CLI is now available in the litespeed user's PATH and run the WP-CLI command
- cd /var/www/webroot/ROOT/
- /home/litespeed/bin/wp db import /var/www/webroot/ROOT/${settings.db_filename}.sql --allow-root
- return:
type: info
message: "${response.out}"
export_wp_db:
- cmd[cp]:
user: litespeed
commands:
- cd /var/www/webroot/ROOT/
- wp db export /var/www/webroot/ROOT/${settings.db_filename}.sql
- return:
type: info
message: "Database exported successfully to /var/www/webroot/ROOT/${settings.db_filename}.sql"
enable_opcache:
- cmd[cp]:
user: root
commands:
2025-06-13 17:17:12 +00:00
- php /home/litespeed/mbmanager/scripts/toggle_opcache.php enable
2025-06-16 17:02:24 +00:00
- restartNodes:
- nodeGroup: "cp"
reboot: true
2025-06-13 17:17:12 +00:00
- return:
type: info
2025-06-16 17:02:24 +00:00
message: "OPCache enabled successfully and PHP restarted."
2025-03-21 17:29:22 +00:00
disable_opcache:
- cmd[cp]:
user: root
commands:
2025-06-13 17:17:12 +00:00
- php /home/litespeed/mbmanager/scripts/toggle_opcache.php disable
2025-06-16 17:02:24 +00:00
- restartNodes:
- nodeGroup: "cp"
reboot: true
2025-06-13 17:17:12 +00:00
- return:
type: info
2025-06-16 17:02:24 +00:00
message: "OPCache disabled successfully and PHP restarted."
2025-03-21 17:29:22 +00:00
clear_opcache:
- cmd[cp]:
user: root
commands:
2025-06-13 17:17:12 +00:00
- php /home/litespeed/mbmanager/scripts/clear_opcache.php
- return:
type: info
message: "${response.out}"
2025-03-21 17:29:22 +00:00
opcache_status:
- cmd[cp]:
user: root
commands:
2025-06-16 16:39:43 +00:00
- php /home/litespeed/mbmanager/scripts/check_opcache.php --simple
2025-03-21 17:29:22 +00:00
- return:
type: info
message: "${response.out}"
opcache_summary:
- cmd[cp]:
user: root
commands:
2025-06-16 16:50:30 +00:00
- php /home/litespeed/mbmanager/scripts/check_opcache.php --summary
2025-03-21 17:29:22 +00:00
- return:
type: info
message: "${response.out}"
opcache_statistics:
- cmd[cp]:
user: root
commands:
2025-06-16 16:50:30 +00:00
- php /home/litespeed/mbmanager/scripts/check_opcache.php --statistics
2025-03-21 17:29:22 +00:00
- return:
type: info
message: "${response.out}"
2025-06-13 17:17:12 +00:00
2025-03-21 17:29:22 +00:00
opcache_fetch_settings:
- cmd[cp]:
user: root
2025-06-13 17:17:12 +00:00
commands:
2025-06-16 16:50:30 +00:00
- php /home/litespeed/mbmanager/scripts/check_opcache.php --settings
2025-03-21 17:29:22 +00:00
- return:
type: info
message: "${response.out}"
2025-06-13 17:17:12 +00:00
2025-03-21 17:29:22 +00:00
opcache_update_settings:
2025-06-13 17:17:12 +00:00
- cmd[cp]:
user: root
commands:
- bash /home/litespeed/mbmanager/scripts/update_opcache_settings.sh "${settings.memory_consumption}" "${settings.interned_strings_buffer}" "${settings.max_accelerated_files}" "${settings.revalidate_freq}"
- restartNodes:
- nodeGroup: "cp"
reboot: true
- return:
type: info
message: "OPCache settings updated successfully."
2025-03-21 17:29:22 +00:00
litespeed_status:
- cmd[cp]:
2025-06-13 17:17:12 +00:00
user: root
commands:
- php /home/litespeed/mbmanager/scripts/check_litespeed.php
2025-03-21 17:29:22 +00:00
- return:
type: info
2025-06-13 17:17:12 +00:00
message: "${response.out}"
2025-03-21 17:29:22 +00:00
litespeed_enable:
- cmd[cp]:
2025-06-13 17:17:12 +00:00
user: root
commands:
2025-06-17 15:39:38 +00:00
- php /home/litespeed/mbmanager/scripts/manage_litespeed.php enable-cache
2025-03-21 17:29:22 +00:00
- return:
type: info
2025-06-13 17:17:12 +00:00
message: "${response.out}"
2025-03-21 17:29:22 +00:00
litespeed_disable:
- cmd[cp]:
2025-06-13 17:17:12 +00:00
user: root
commands:
2025-06-17 15:39:38 +00:00
- php /home/litespeed/mbmanager/scripts/manage_litespeed.php disable-cache
2025-03-21 17:29:22 +00:00
- return:
type: info
2025-06-13 17:17:12 +00:00
message: "${response.out}"
2025-03-21 17:29:22 +00:00
litespeed_purgeall:
- cmd[cp]:
2025-06-13 17:17:12 +00:00
user: root
commands:
- php /home/litespeed/mbmanager/scripts/manage_litespeed.php purge
2025-03-21 17:29:22 +00:00
- return:
type: info
2025-06-13 17:17:12 +00:00
message: "${response.out}"
2025-03-21 17:29:22 +00:00
litespeed_ver:
- cmd[cp]:
commands:
2025-06-17 16:26:19 +00:00
- php /home/litespeed/mbmanager/scripts/manage_litespeed.php version
2025-03-21 17:29:22 +00:00
- return:
type: info
message: "${response.out}"
litespeed_ttlpub:
- cmd[cp]:
commands:
2025-06-17 16:26:19 +00:00
- echo '{"status":"info","message":"TTL settings are managed at server level in Virtuozzo LLSMP - check LiteSpeed admin console"}'
2025-03-21 17:29:22 +00:00
- return:
type: info
message: "${response.out}"
litespeed_set_ttlpub:
- cmd[cp]:
2025-06-13 17:17:12 +00:00
user: root
commands:
- php /home/litespeed/mbmanager/scripts/manage_litespeed.php set-ttl "${settings.sizettl}"
2025-03-21 17:29:22 +00:00
- return:
type: info
message: "${response.out}"
update_cache_exc:
- cmd[cp]:
2025-06-13 17:17:12 +00:00
user: root
commands:
- php /home/litespeed/mbmanager/scripts/manage_litespeed.php set-exclusions "${settings.cache_exc_paths}"
- return:
2025-03-21 17:29:22 +00:00
type: info
message: "${response.out}"
get_litespeed_ttl_values:
- cmd[cp]:
2025-06-13 17:17:12 +00:00
user: root
commands:
2025-06-17 16:26:19 +00:00
- echo '{"status":"info","message":"TTL values in Virtuozzo LLSMP are managed through LiteSpeed admin console at server level","note":"WordPress plugin TTL settings do not apply to server-level cache"}'
2025-03-21 17:29:22 +00:00
- return:
type: info
message: "${response.out}"
litespeed_update_settings:
- cmd[cp]:
2025-06-13 17:17:12 +00:00
user: root
2025-03-21 17:29:22 +00:00
commands:
2025-06-13 17:17:12 +00:00
- bash /home/litespeed/mbmanager/scripts/litespeed_update_settings.sh "${settings.TTL_PUB}" "${settings.TTL_PRIV}" "${settings.TTL_FRONTPAGE}" "${settings.TTL_FEED}"
2025-03-21 17:29:22 +00:00
- restartNodes:
- nodeGroup: "cp"
reboot: true
- return:
type: info
message: "LiteSpeed cache settings updated successfully."
check_relay_installation:
- cmd[cp]:
user: root
commands:
2025-04-02 17:55:34 +00:00
- bash /home/litespeed/mbmanager/relay/check_relay_installation.sh
2025-03-21 17:29:22 +00:00
- return:
type: info
message: "${response.out}"
check_relay_status:
- cmd[cp]:
user: root
commands:
2025-04-02 17:55:34 +00:00
- bash /home/litespeed/mbmanager/relay/check_relay_status.sh
2025-03-21 17:29:22 +00:00
- return:
type: info
message: "${response.out}"
disable_relay:
- cmd[cp]:
user: root
commands:
2025-04-02 17:55:34 +00:00
- bash /home/litespeed/mbmanager/relay/disable_relay.sh
2025-03-21 17:29:22 +00:00
- return:
type: info
message: "${response.out}"
enable_relay:
- cmd[cp]:
user: root
commands:
2025-04-02 17:55:34 +00:00
- bash /home/litespeed/mbmanager/relay/enable_relay.sh
2025-03-21 17:29:22 +00:00
- return:
type: info
message: "${response.out}"
install_relay:
- cmd[cp]:
commands:
2025-04-02 17:55:34 +00:00
- bash /home/litespeed/mbmanager/relay/install_relay_ocp.sh
2025-03-21 17:29:22 +00:00
- return:
type: info
message: "${response.out}"
flush_keys:
- cmd[cp]:
commands:
2025-04-02 17:55:34 +00:00
- bash /home/litespeed/mbmanager/relay/flush_caches.sh
2025-03-21 17:29:22 +00:00
- return:
type: info
message: "${response.out}"
redis_status:
- cmd[cp]:
commands:
- sudo systemctl list-units --type=service | grep redis
- return:
type: info
message: "${response.out}"
redis_disable:
- cmd[cp]:
commands:
- sudo systemctl stop redis
- return:
type: info
message: "Redis has been stopped successfully"
redis_enable:
- cmd[cp]:
commands:
- sudo systemctl restart redis
- return:
type: info
message: "Redis has been successfully restarted"
redis_clear_keys:
- cmd[cp]:
commands:
- redis-cli -s /var/run/redis/redis.sock FLUSHALL
- return:
type: info
message: "${response.out}"
2025-06-17 18:09:33 +00:00
redis_metrics:
- cmd[cp]:
user: root
commands:
- php /home/litespeed/mbmanager/scripts/check_redis.php
- return:
type: info
message: "${response.out}"
2025-06-18 10:27:04 +00:00
litespeed_metrics:
- cmd[cp]:
2025-06-18 10:51:45 +00:00
user: litespeed
2025-06-18 10:27:04 +00:00
commands:
- bash /home/litespeed/mbmanager/scripts/litespeed_metrics.sh
- return:
type: info
message: "${response.out}"
2025-03-21 17:29:22 +00:00
db_import_preparation:
- cmd[cp]:
user: root
commands:
- if [ ! -f /home/litespeed/mbmanager/dbPreparation.sh ]; then
echo "dbPreparation.sh not found. Downloading the script...";
mkdir -p /home/litespeed/mbmanager;
2025-06-13 17:37:35 +00:00
curl -o /home/litespeed/mbmanager/dbPreparation.sh https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/dbPreparation.sh;
2025-03-21 17:29:22 +00:00
chmod +x /home/litespeed/mbmanager/dbPreparation.sh;
else
echo "dbPreparation.sh already exists. Running the script...";
fi;
- /home/litespeed/mbmanager/dbPreparation.sh
- return:
type: info
message: "${response.out}"
issue_ssl_cert:
- cmd[cp]:
user: root
commands:
2025-03-27 16:26:05 +00:00
- bash /home/litespeed/mbmanager/ssl-manager/ssl_manager.sh --public-ip="${settings.public_ip}" --domain="${settings.domain}" --email="${settings.email}" --verbose
2025-03-21 17:29:22 +00:00
- return:
type: info
2025-03-27 16:26:05 +00:00
message: "SSL certificate issuance process completed."
2025-03-21 17:29:22 +00:00
check_domain_ip:
- cmd[cp]:
user: root
commands:
- bash /home/litespeed/mbmanager/ssl-manager/ipchecker.sh -d "${settings.domain}" -i "${settings.public_ip}"
- return:
type: info
message: "${response.out}"
2025-03-21 18:22:40 +00:00
remove_ssl_cert:
- cmd[cp]:
user: root
commands:
2025-03-27 18:01:33 +00:00
- if [ -n "${settings.email}" ]; then
bash /home/litespeed/mbmanager/ssl-manager/ssl_remover.sh --domains="${settings.domain}" --verbose --email="${settings.email}"
else
bash /home/litespeed/mbmanager/ssl-manager/ssl_remover.sh --domains="${settings.domain}" --verbose
fi
2025-03-21 18:22:40 +00:00
- return:
type: info
2025-03-27 16:26:05 +00:00
message: "SSL certificate removal process completed."
2025-03-25 12:55:20 +00:00
diagnose_litespeed_config:
- cmd[cp]:
user: root
commands:
2025-03-27 16:26:05 +00:00
- bash /home/litespeed/mbmanager/ssl-manager/xmlchecker.sh --verbose
2025-03-25 13:09:26 +00:00
- return:
type: info
message: "${response.out}"
2025-03-31 17:37:54 +00:00
install_wordpress:
- cmd[cp]:
user: root
commands:
2025-04-04 17:17:52 +00:00
- cd /var/www/webroot/ROOT && /home/litespeed/mbmanager/install-wordpress.sh --wpusername="${settings.wpusername}" --wppassword="${settings.wppassword}" --wpemail="${settings.wpemail}" --reset-db-root-pass
2025-03-31 17:37:54 +00:00
- return:
type: info
message: "${response.out}"
2025-03-21 17:29:22 +00:00
responses:
enableSuccess:
type: success
message: "OPCache enabled successfully."
disableSuccess:
type: success
message: "OPCache disabled successfully."
clearSuccess:
type: success
message: "OPCache cleared successfully."
buttons:
- settings: opcacheConfig
action: opcache_update_settings
caption: Update OPCache Settings
submitButtonText: Update OpCache
- settings: litespeedTTL
action: litespeed_set_ttlpub
caption: Change TTL for cache-ttl_pub in seconds
submitButtonText: Update TTL
- settings: cacheExcConfig
action: update_cache_exc
caption: Update Cache Exclusion Paths
submitButtonText: Update Paths
- settings: litespeedConfig
action: litespeed_update_settings
caption: Update LiteSpeed Cache Settings
submitButtonText: Update Cache Settings
2025-03-21 18:22:40 +00:00
- settings: sslRemoveConfig
action: remove_ssl_cert
caption: Remove SSL Certificates
submitButtonText: Remove Certificates
2025-03-21 17:29:22 +00:00
onUninstall:
- cmd[cp]:
user: root
commands:
# Remove all installed scripts
- rm -rf /home/litespeed/mbmanager/ssl-manager/*
- rm -rf /home/litespeed/mbmanager/relay/*
- rm -rf /home/litespeed/mbmanager/*
# Remove the parent directory if empty
- rmdir --ignore-fail-on-non-empty /home/litespeed/mbmanager || true
# Uninstall Certbot if no longer needed
2025-01-29 13:03:24 +00:00
- if command -v certbot > /dev/null; then dnf remove -y certbot python3-certbot-dns-cloudflare; fi