867 lines
32 KiB
Plaintext
867 lines
32 KiB
Plaintext
type: update
|
|
id: mbadmin
|
|
version: '2.6'
|
|
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
|
|
- mkdir -p /home/litespeed/mbmanager/scripts
|
|
# Download OPCache scripts with verification
|
|
- cd /home/litespeed/mbmanager/scripts
|
|
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/check_opcache.php
|
|
- if [ ! -f check_opcache.php ]; then echo "Failed to download check_opcache.php"; exit 1; fi
|
|
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/toggle_opcache.php
|
|
- if [ ! -f toggle_opcache.php ]; then echo "Failed to download toggle_opcache.php"; exit 1; fi
|
|
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/clear_opcache.php
|
|
- if [ ! -f clear_opcache.php ]; then echo "Failed to download clear_opcache.php"; exit 1; fi
|
|
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/update_opcache_settings.sh
|
|
- if [ ! -f update_opcache_settings.sh ]; then echo "Failed to download update_opcache_settings.sh"; exit 1; fi
|
|
# 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
|
|
- 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
|
|
- 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
|
|
- chmod +x *.php *.sh
|
|
# Download WordPress Installer with path verification
|
|
- cd /home/litespeed/mbmanager
|
|
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/install-wordpress.sh
|
|
- if [ ! -f install-wordpress.sh ]; then echo "Failed to download install-wordpress.sh"; exit 1; fi
|
|
# Download main scripts with verification
|
|
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/litespeed_fetch_settings.sh
|
|
- if [ ! -f litespeed_fetch_settings.sh ]; then echo "Failed to download litespeed_fetch_settings.sh"; exit 1; fi
|
|
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/litespeed_update_settings.sh
|
|
- 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
|
|
- cd /home/litespeed/mbmanager/relay
|
|
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/relay/check_relay_installation.sh
|
|
- if [ ! -f check_relay_installation.sh ]; then echo "Failed to download check_relay_installation.sh"; exit 1; fi
|
|
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/relay/check_relay_status.sh
|
|
- if [ ! -f check_relay_status.sh ]; then echo "Failed to download check_relay_status.sh"; exit 1; fi
|
|
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/relay/disable_relay.sh
|
|
- if [ ! -f disable_relay.sh ]; then echo "Failed to download disable_relay.sh"; exit 1; fi
|
|
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/relay/enable_relay.sh
|
|
- if [ ! -f enable_relay.sh ]; then echo "Failed to download enable_relay.sh"; exit 1; fi
|
|
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/relay/flush_caches.sh
|
|
- if [ ! -f flush_caches.sh ]; then echo "Failed to download flush_caches.sh"; exit 1; fi
|
|
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/relay/install_relay_ocp.sh
|
|
- if [ ! -f install_relay_ocp.sh ]; then echo "Failed to download install_relay_ocp.sh"; exit 1; fi
|
|
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/relay/uninstall_relay.sh
|
|
- 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
|
|
- cd /home/litespeed/mbmanager/ssl-manager
|
|
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/ssl-manager/ssl_manager.sh
|
|
- if [ ! -f ssl_manager.sh ]; then echo "Failed to download ssl_manager.sh"; exit 1; fi
|
|
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/ssl-manager/ipchecker.sh
|
|
- if [ ! -f ipchecker.sh ]; then echo "Failed to download ipchecker.sh"; exit 1; fi
|
|
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/ssl-manager/ssl_remover.sh
|
|
- if [ ! -f ssl_remover.sh ]; then echo "Failed to download ssl_remover.sh"; exit 1; fi
|
|
- curl -OL https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/ssl-manager/xmlchecker.sh
|
|
- if [ ! -f xmlchecker.sh ]; then echo "Failed to download xmlchecker.sh"; exit 1; fi
|
|
- chmod +x *.sh
|
|
# 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
|
|
|
|
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}"
|
|
- confirmText: Get Redis metrics?
|
|
loadingText: Getting Redis metrics...
|
|
caption: Get Redis Metrics
|
|
action: redis_metrics
|
|
successText: "${response.out}"
|
|
- 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}"
|
|
- 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}"
|
|
- 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}"
|
|
- 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}"
|
|
- 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}"
|
|
- confirmText: Get comprehensive LiteSpeed metrics?
|
|
loadingText: Gathering metrics...
|
|
caption: Get LiteSpeed Metrics
|
|
action: litespeed_metrics
|
|
successText: "${response.out}"
|
|
- confirmText: Are you sure you want to diagnose LiteSpeed configuration?
|
|
loadingText: Analyzing configuration...
|
|
caption: Diagnose LiteSpeed Config
|
|
action: diagnose_litespeed_config
|
|
successText: "${response.out}"
|
|
- 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."
|
|
|
|
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
|
|
sslRemoveConfig:
|
|
submitUnchanged: true
|
|
fields:
|
|
- name: domains
|
|
type: text
|
|
caption: Comma-separated Domains
|
|
required: true
|
|
- name: email
|
|
type: text
|
|
caption: Email Address (Optional)
|
|
default: "${EMAIL}"
|
|
cleanCertConfig:
|
|
submitUnchanged: true
|
|
fields:
|
|
- name: domain
|
|
type: text
|
|
caption: Domain Name
|
|
required: true
|
|
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
|
|
|
|
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:
|
|
- php /home/litespeed/mbmanager/scripts/toggle_opcache.php enable
|
|
- restartNodes:
|
|
- nodeGroup: "cp"
|
|
reboot: true
|
|
- return:
|
|
type: info
|
|
message: "OPCache enabled successfully and PHP restarted."
|
|
|
|
disable_opcache:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- php /home/litespeed/mbmanager/scripts/toggle_opcache.php disable
|
|
- restartNodes:
|
|
- nodeGroup: "cp"
|
|
reboot: true
|
|
- return:
|
|
type: info
|
|
message: "OPCache disabled successfully and PHP restarted."
|
|
|
|
clear_opcache:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- php /home/litespeed/mbmanager/scripts/clear_opcache.php
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
|
|
opcache_status:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- php /home/litespeed/mbmanager/scripts/check_opcache.php --simple
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
|
|
opcache_summary:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- php /home/litespeed/mbmanager/scripts/check_opcache.php --summary
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
|
|
opcache_statistics:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- php /home/litespeed/mbmanager/scripts/check_opcache.php --statistics
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
|
|
opcache_fetch_settings:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- php /home/litespeed/mbmanager/scripts/check_opcache.php --settings
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
|
|
opcache_update_settings:
|
|
- 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."
|
|
litespeed_status:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- php /home/litespeed/mbmanager/scripts/check_litespeed.php
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
litespeed_enable:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- php /home/litespeed/mbmanager/scripts/manage_litespeed.php enable-cache
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
litespeed_disable:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- php /home/litespeed/mbmanager/scripts/manage_litespeed.php disable-cache
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
litespeed_purgeall:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- php /home/litespeed/mbmanager/scripts/manage_litespeed.php purge
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
litespeed_ver:
|
|
- cmd[cp]:
|
|
commands:
|
|
- php /home/litespeed/mbmanager/scripts/manage_litespeed.php version
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
litespeed_ttlpub:
|
|
- cmd[cp]:
|
|
commands:
|
|
- echo '{"status":"info","message":"TTL settings are managed at server level in Virtuozzo LLSMP - check LiteSpeed admin console"}'
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
litespeed_set_ttlpub:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- php /home/litespeed/mbmanager/scripts/manage_litespeed.php set-ttl "${settings.sizettl}"
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
update_cache_exc:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- php /home/litespeed/mbmanager/scripts/manage_litespeed.php set-exclusions "${settings.cache_exc_paths}"
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
get_litespeed_ttl_values:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- 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"}'
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
litespeed_update_settings:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- bash /home/litespeed/mbmanager/scripts/litespeed_update_settings.sh "${settings.TTL_PUB}" "${settings.TTL_PRIV}" "${settings.TTL_FRONTPAGE}" "${settings.TTL_FEED}"
|
|
- restartNodes:
|
|
- nodeGroup: "cp"
|
|
reboot: true
|
|
- return:
|
|
type: info
|
|
message: "LiteSpeed cache settings updated successfully."
|
|
check_relay_installation:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- bash /home/litespeed/mbmanager/relay/check_relay_installation.sh
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
check_relay_status:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- bash /home/litespeed/mbmanager/relay/check_relay_status.sh
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
disable_relay:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- bash /home/litespeed/mbmanager/relay/disable_relay.sh
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
enable_relay:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- bash /home/litespeed/mbmanager/relay/enable_relay.sh
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
install_relay:
|
|
- cmd[cp]:
|
|
commands:
|
|
- bash /home/litespeed/mbmanager/relay/install_relay_ocp.sh
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
flush_keys:
|
|
- cmd[cp]:
|
|
commands:
|
|
- bash /home/litespeed/mbmanager/relay/flush_caches.sh
|
|
- 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}"
|
|
redis_metrics:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- php /home/litespeed/mbmanager/scripts/check_redis.php
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
litespeed_metrics:
|
|
- cmd[cp]:
|
|
user: litespeed
|
|
commands:
|
|
- bash /home/litespeed/mbmanager/scripts/litespeed_metrics.sh
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
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;
|
|
curl -o /home/litespeed/mbmanager/dbPreparation.sh https://deploy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/dbPreparation.sh;
|
|
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:
|
|
- bash /home/litespeed/mbmanager/ssl-manager/ssl_manager.sh --public-ip="${settings.public_ip}" --domain="${settings.domain}" --email="${settings.email}" --verbose
|
|
- return:
|
|
type: info
|
|
message: "SSL certificate issuance process completed."
|
|
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}"
|
|
remove_ssl_cert:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- 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
|
|
- return:
|
|
type: info
|
|
message: "SSL certificate removal process completed."
|
|
diagnose_litespeed_config:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- bash /home/litespeed/mbmanager/ssl-manager/xmlchecker.sh --verbose
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
install_wordpress:
|
|
- cmd[cp]:
|
|
user: root
|
|
commands:
|
|
- cd /var/www/webroot/ROOT && /home/litespeed/mbmanager/install-wordpress.sh --wpusername="${settings.wpusername}" --wppassword="${settings.wppassword}" --wpemail="${settings.wpemail}" --reset-db-root-pass
|
|
- return:
|
|
type: info
|
|
message: "${response.out}"
|
|
|
|
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
|
|
- settings: sslRemoveConfig
|
|
action: remove_ssl_cert
|
|
caption: Remove SSL Certificates
|
|
submitButtonText: Remove Certificates
|
|
|
|
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
|
|
- if command -v certbot > /dev/null; then dnf remove -y certbot python3-certbot-dns-cloudflare; fi |