joglomedia / LEMPer

LEMPer Stack is terminal-based LEMP / LNMP ( Linux, Nginx, MariaDB, PostgreSQL, MongoDB, Redis, Memcache, PHP, Secure FTP ) auto installer and virtual host manager for Debian & Ubuntu cloud or virtual server (vps) and on-premise (bare metal).
https://lemper.cloud/
GNU General Public License v3.0
216 stars 58 forks source link

[CLI] Rewrite the `lemper-cli` with new structure #92

Open joglomedia opened 3 years ago

joglomedia commented 3 years ago

Proposed command line structure

Firstly, change the command line name from lemper-cli to lemperctl

Create new site / vhost (web app)

lemperctl [site/app] [create/add] example.com --type=wordpress --runtime=php@8.0 \
                --runtime-user=${USER} --install-skeleton --webroot=${HOME}/example.com
Usage:  lemperctl [site/app] [create/add] DOMAIN [OPTIONS] 

Delete existing site / vhost

lemperctl [site/app] [remove/delete] example.com --purge
Options:
  -p, --purge    Force the removal of site artifacts (including web root directory, databases, stack configs, etc)

Disable active site / vhost (from lemper manage <=> update)

lemperctl [site/app] disable example.com 

an alias of

lemperctl [site/app] update example.com --disable

Enable inactive site / vhost

lemperctl [site/app] enable example.com

an alias of

lemperctl [site/app] update example.com --enable

Utility to manage site / vhost

Move lemper manage to lemper update

lemperctl [site/app] update example.com --enable-ssl
Usage:  lemperctl [site/app] update [OPTIONS] DOMAIN [DOMAIN...]
Options:
  --cors-enable          Enable CORS
  --cors-disable         Disable CORS
  --fail2ban-enable    Enable Fail2ban
  --fail2ban-disable   Disable Fail2ban
  --ssl-disable            Disable SSL/HTTPS
  --ssl-enable             Enable SSL/HTTPS
  --ssl-remove            Disable and remove SSL configuration
  --ssl-renew              Renew SSL certificate
  --fastcgi-cache-enable   Enable fastcgi cache
  --fastcgi-cache-disable  Disable fastcgi cache
  --pagespeed-enable   Enable pagespeed nginx module (DEPRECATION issue https://github.com/joglomedia/LEMPer/issues/178)
  --pagespeed-disable   Disable mod-pagespeed nginx module (DEPRECATION)

Manage Stack services

lemperctl stack restart --service=nginx --service=php-fpm --service=mysql
lemperctl stack restart --service=all
Usage:  lemperctl stack [start|stop|restart|reload|status] [OPTIONS]