#-----------------------------------------------------------------------------------------------#
# WARNING: This file is managed by Salt, any changes will be overwritten on the next Salt run #
#-----------------------------------------------------------------------------------------------#
# The PHP and wp-cli runtimes for A2 #
rmq ALL=(ALL) NOPASSWD: /opt/alt/php*/usr/bin/php -d * /usr/bin/wp * --path\=/home/*
rmq ALL=(ALL) NOPASSWD: /usr/local/php-th/bin/php -d * /usr/bin/wp * --path\=/home/*
rmq ALL=(ALL) NOPASSWD: /usr/local/bin/php -d * /usr/bin/wp * --path\=/home/*
# The PHP and wp-cli runtimes for WHG #
rmq ALL=(ALL) NOPASSWD: /opt/cpanel/ea-php*/root/bin/php -d * /usr/local/bin/wp * --path\=/home/*
# Used to log the user into cPanel #
rmq ALL=(ALL) NOPASSWD: /usr/sbin/whmapi1 create_user_session user=* service=cpaneld --output=json
# Used to validate if given username really exists in cPanel #
rmq ALL=(ALL) NOPASSWD: /usr/sbin/whmapi1 listaccts search=* searchtype=user --output=json
# Used to interact with supervisord #
rmq ALL=(ALL) NOPASSWD: /usr/bin/supervisorctl *
# Used mostly to read configuration files #
rmq ALL=(ALL) NOPASSWD: /bin/cat /home/*
# Used to test if a file exists #
rmq ALL=(ALL) NOPASSWD: /bin/test -f /home/*
# Used to find WordPress installations on A2 #
rmq ALL=(ALL) NOPASSWD: /opt/alt/php*/usr/bin/php -d memory_limit=512M /usr/bin/wp find /home/* --allow-root --format=json
rmq ALL=(ALL) NOPASSWD: /usr/local/php-th/bin/php -d memory_limit=512M /usr/bin/wp find /home/* --allow-root --format=json
# Used to find WordPress installations on WHG #
rmq ALL=(ALL) NOPASSWD: /opt/cpanel/ea-php*/root/bin/php -d memory_limit=512M /usr/local/bin/wp find /home/* --allow-root --format=json
rmq ALL=(ALL) NOPASSWD: /usr/local/php-th/bin/php -d memory_limit=512M /usr/local/bin/wp find /home/* --allow-root --format=json
# Used to get information about the salt minion #
rmq ALL=(ALL) NOPASSWD: /bin/grep role /etc/salt/minion
rmq ALL=(ALL) NOPASSWD: /bin/grep region /etc/salt/minion
# Used to get disk usage information #
rmq ALL=(ALL) NOPASSWD: /bin/du * /home/*
# Used to get quota information #
rmq ALL=(ALL) NOPASSWD: /bin/uapi Quota get_quota_info*
# Used to get disk space available information #
rmq ALL=(ALL) NOPASSWD: /bin/df -m /home/*
# Used to backup the advanced cache file #
rmq ALL=(ALL) NOPASSWD: /usr/bin/mv -f /home/**/*advanced-cache*.php* /home/*
# Used to read the Redis configuration file #
rmq ALL=(ALL) NOPASSWD: /usr/bin/ls /opt/redis/conf/example.conf
# Used to ping the Redis server #
rmq ALL=(ALL) NOPASSWD: /bin/redis-cli -s /home/*/.redis/redis.sock PING
# Used to touch the Redis file #
rmq ALL=(ALL) NOPASSWD: /usr/bin/touch /home/*/.redis.on
# Used to ping the Redis server #
rmq ALL=(ALL) NOPASSWD: /bin/redis-cli -h localhost -p * PING
# Used to enable PHP user extensions #
rmq ALL=(ALL) NOPASSWD: /bin/selectorctl --user * --version * --enable-user-extensions=*
# Allow the updater to create and save the include file used by WP-CLI #
rmq ALL=(ALL) NOPASSWD: /bin/mkdir -p /opt/turbo-hub
rmq ALL=(ALL) NOPASSWD: /bin/chmod 755 /opt/turbo-hub
rmq ALL=(ALL) NOPASSWD: /bin/cp -f th-wpcli.php /opt/turbo-hub/th-wpcli.php
rmq ALL=(ALL) NOPASSWD: /bin/chmod 755 /opt/turbo-hub/th-wpcli.php
# Used to find backups, other files and count the number of files #
rmq ALL=(ALL) NOPASSWD: /bin/find /home/*
# Used by staging, to get the account summary in cPanel #
rmq ALL=(ALL) NOPASSWD: /usr/sbin/whmapi1 accountsummary user=* --output=json
# Used by staging, to get the list of MySQL databases by the user #
rmq ALL=(ALL) NOPASSWD: /bin/uapi --user=* Mysql list_databases --output=json
# Used by staging, to modify the account's SQL limit #
rmq ALL=(ALL) NOPASSWD: /usr/sbin/whmapi1 modifyacct * MAXSQL=* --output=json
# Used by staging, to verify if the user has given feature #
rmq ALL=(ALL) NOPASSWD: /usr/sbin/whmapi1 verify_user_has_feature user=* feature=* --output=json
# Used by staging to add or remove given feature to that user #
rmq ALL=(ALL) NOPASSWD: /usr/sbin/whmapi1 add_override_features_for_user user=* features=* --output=json
# Used by staging to add a subdomain #
rmq ALL=(ALL) NOPASSWD: /bin/uapi --user=* SubDomain addsubdomain domain=* rootdomain=* dir=* --output=json
# Used by staging to remove a domain #
rmq ALL=(ALL) NOPASSWD: /usr/sbin/whmapi1 delete_domain domain=* --output=json
# Used by staging to create a parked domain #
rmq ALL=(ALL) NOPASSWD: /usr/sbin/whmapi1 create_parked_domain_for_user domain=* username=* web_vhost_domain=* --output=json
# Used by staging to trigger AutoSSL #
rmq ALL=(ALL) NOPASSWD: /bin/uapi --user=* SSL remove_autossl_excluded_domains domains=* --output=json
rmq ALL=(ALL) NOPASSWD: /usr/sbin/whmapi1 start_autossl_check_for_one_user username=* --output=json
# Used by staging to fetch the instance-id of a WordPress website in WP Toolkit #
rmq ALL=(ALL) NOPASSWD: /usr/local/bin/wp-toolkit --list -domain-name * -format json
# Used by staging to register a WordPress website in WP Toolkit #
rmq ALL=(ALL) NOPASSWD: /usr/local/bin/wp-toolkit --register -domain-name * -path *
# Used by staging and site scanner to get domain information #
rmq ALL=(ALL) NOPASSWD: /usr/sbin/whmapi1 domainuserdata domain=* --output=json
# Used by staging to remove a database #
rmq ALL=(ALL) NOPASSWD: /bin/uapi --user=* Mysql delete_database name=* --output=json
# Used by staging to remove a database user #
rmq ALL=(ALL) NOPASSWD: /bin/uapi --user=* Mysql delete_user name=* --output=json
# Used by staging to create the folder that will receive deleted sites #
rmq ALL=(ALL) NOPASSWD: /usr/bin/mkdir -p /opt/turbo-hub/trash/*
# Used by staging to move the site to the trash folder #
rmq ALL=(ALL) NOPASSWD: /usr/bin/mv -f /home/* /opt/turbo-hub/trash/*/
# Used by staging to clone a website #
rmq ALL=(ALL) NOPASSWD: /usr/local/bin/wp-toolkit --clone -source-instance-id * -target-path * -target-domain-name *
# Used by staging to clear the cache of a website #
rmq ALL=(ALL) NOPASSWD: /usr/local/bin/wp-toolkit --clear-cache -instance-id *
# Used to get information from the salt minion file
rmq ALL=(ALL) NOPASSWD: /bin/awk * /etc/salt/minion
# Used to fetch native php version from cagefs
rmq ALL=(ALL) NOPASSWD: /bin/su * -s /bin/bash -c /usr/bin/php -v