WordPress Auto Installer Package Update? — CyberPanel - WebHosting Control Panel for OpenLiteSpeed
CyberLoader

WordPress Auto Installer Package Update?

Hi! I just started using cyberpanel and it's pretty slick. I'm wondering anyone knows if there is a way to edit the WordPress auto installer package? I'd like it to include certain plugins (such as lscache). If you've done this or you can point me in the right direction, that would be extremely helpful. Thanks!

Comments

  • See these files:

    https://github.com/usmannasir/cyberpanel/blob/21bcc7f5a0cf9b6309bf872c600fec94ea752a3e/websiteFunctions/website.py#L1754

    https://github.com/usmannasir/cyberpanel/blob/stable/plogical/applicationInstaller.py#L231


    This uses the wp cli to install these plugins.
    https://github.com/usmannasir/cyberpanel/blob/21bcc7f5a0cf9b6309bf872c600fec94ea752a3e/plogical/applicationInstaller.py#L364

    command = "wp plugin install litespeed-cache --allow-root --path=" + finalPath

    So you would need to splice in additional commands into this file for your install and rebuild the cyberpanel cache so it sees the new code.

    Updating and modding core files is similar to skin development:
    https://blog.cyberpanel.net/2019/01/01/skin-customization-for-cyberpanel/

    The difference is you would use this to upgrade/update cache
    wget -O /usr/local/CyberCP/upgrade.sh https://github.com/usmannasir/cyberpanel/blob/stable/upgrade.sh;chmod +x /usr/local/CyberCP/upgrade.sh;

    Then run this and give it a few minutes to clear cache and restart cyberpanel daemon
    bash /usr/local/CyberCP/upgrade.sh


    I recommend backing up the original file before making changes on the server especially if it's a production server. Python is very picky about indentation so make sure you're following the formatting so you don't get a Cyberpanel :8090 500 error due to this

    Debugging in case you get errors.

    Debugging
    Cyberpanel
    /usr/local/CyberCP/CyberCP/settings.py

    Disable Debugging
    sed -i 's|^DEBUG.*|DEBUG = False|g' /usr/local/CyberCP/CyberCP/settings.py && service lscpd restart

    Enable Debugging
    sed -i 's|^DEBUG.*|DEBUG = True|g' /usr/local/CyberCP/CyberCP/settings.py && service lscpd restart

    Cyberpanel Control Panel errorlog
    /usr/local/lscp/cyberpanel/logs/error.log

    Cyberpanel Control Panel stderr.log
    /usr/local/lscp/cyberpanel/logs/stderr.log

    Cyberpanel Control Panel logs and rotated logs.
    /usr/local/lscp/logs/

    Hopefully, that helps you on your quest. Please make sure to submit any code you think might also help cyberpanel as a pull request on Github so we can incorporate it for all to benefit.

    If modding that file is a little scary you could probably build a hook upon install that fires off the raw wp cli install command as the ssh user after install.
    https://wp-cli.org/
  • Realized your needs make for a good feature request and submitted one regarding this here:
    https://forums.cyberpanel.net/discussion/3833/cyberpanel-application-installer-hook-to-allow-for-upgrade-safe-custom-preferences/
Sign In or Register to comment.
CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion