From 9d6aee6f78997a1b5ea38a581de014c9d32f9d56 Mon Sep 17 00:00:00 2001 From: Mermouy Date: Sat, 15 Mar 2014 02:20:48 +0100 Subject: [PATCH 1/4] Modified the config nginx templates files to use relative path --- usr/share/easyengine/nginx/html/basic.conf | 2 +- usr/share/easyengine/nginx/mysql/basic.conf | 2 +- usr/share/easyengine/nginx/php/basic.conf | 2 +- usr/share/easyengine/nginx/wp/basic.conf | 4 ++-- usr/share/easyengine/nginx/wp/w3tc.conf | 2 +- usr/share/easyengine/nginx/wp/wpfc.conf | 4 ++-- usr/share/easyengine/nginx/wp/wpsc.conf | 4 ++-- usr/share/easyengine/nginx/wpsubdir/basic.conf | 4 ++-- usr/share/easyengine/nginx/wpsubdir/w3tc.conf | 4 ++-- usr/share/easyengine/nginx/wpsubdir/wpfc.conf | 4 ++-- usr/share/easyengine/nginx/wpsubdir/wpsc.conf | 4 ++-- usr/share/easyengine/nginx/wpsubdomain/basic.conf | 4 ++-- usr/share/easyengine/nginx/wpsubdomain/w3tc.conf | 4 ++-- usr/share/easyengine/nginx/wpsubdomain/wpfc.conf | 4 ++-- usr/share/easyengine/nginx/wpsubdomain/wpsc.conf | 4 ++-- 15 files changed, 26 insertions(+), 26 deletions(-) diff --git a/usr/share/easyengine/nginx/html/basic.conf b/usr/share/easyengine/nginx/html/basic.conf index 36b2ecc9..fe26d276 100644 --- a/usr/share/easyengine/nginx/html/basic.conf +++ b/usr/share/easyengine/nginx/html/basic.conf @@ -13,6 +13,6 @@ server { try_files $uri $uri/ /index.html; } - include /etc/nginx/common/locations.conf; + include common/locations.conf; } diff --git a/usr/share/easyengine/nginx/mysql/basic.conf b/usr/share/easyengine/nginx/mysql/basic.conf index 601d6d7b..052a85c6 100644 --- a/usr/share/easyengine/nginx/mysql/basic.conf +++ b/usr/share/easyengine/nginx/mysql/basic.conf @@ -19,6 +19,6 @@ server { fastcgi_pass php; } - include /etc/nginx/common/locations.conf; + include common/locations.conf; } diff --git a/usr/share/easyengine/nginx/php/basic.conf b/usr/share/easyengine/nginx/php/basic.conf index 68efb89c..73306b92 100644 --- a/usr/share/easyengine/nginx/php/basic.conf +++ b/usr/share/easyengine/nginx/php/basic.conf @@ -19,6 +19,6 @@ server { fastcgi_pass php; } - include /etc/nginx/common/locations.conf; + include common/locations.conf; } diff --git a/usr/share/easyengine/nginx/wp/basic.conf b/usr/share/easyengine/nginx/wp/basic.conf index 4b152792..d8a11e3e 100644 --- a/usr/share/easyengine/nginx/wp/basic.conf +++ b/usr/share/easyengine/nginx/wp/basic.conf @@ -19,7 +19,7 @@ server { fastcgi_pass php; } - include /etc/nginx/common/wpcommon.conf; - include /etc/nginx/common/locations.conf; + include common/wpcommon.conf; + include common/locations.conf; } diff --git a/usr/share/easyengine/nginx/wp/w3tc.conf b/usr/share/easyengine/nginx/wp/w3tc.conf index e736f462..10149081 100644 --- a/usr/share/easyengine/nginx/wp/w3tc.conf +++ b/usr/share/easyengine/nginx/wp/w3tc.conf @@ -46,6 +46,6 @@ server { } include /etc/nginx/common/wpcommon.conf; - include /etc/nginx/common/locations.conf; + include common/locations.conf; } diff --git a/usr/share/easyengine/nginx/wp/wpfc.conf b/usr/share/easyengine/nginx/wp/wpfc.conf index aca19db6..5d343a74 100644 --- a/usr/share/easyengine/nginx/wp/wpfc.conf +++ b/usr/share/easyengine/nginx/wp/wpfc.conf @@ -54,6 +54,6 @@ server { fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1"; } - include /etc/nginx/common/wpcommon.conf; - include /etc/nginx/common/locations.conf; + include common/wpcommon.conf; + include common/locations.conf; } diff --git a/usr/share/easyengine/nginx/wp/wpsc.conf b/usr/share/easyengine/nginx/wp/wpsc.conf index 8e89602e..41ea856f 100644 --- a/usr/share/easyengine/nginx/wp/wpsc.conf +++ b/usr/share/easyengine/nginx/wp/wpsc.conf @@ -41,6 +41,6 @@ server { fastcgi_pass php; } - include /etc/nginx/common/wpcommon.conf; - include /etc/nginx/common/locations.conf; + include common/wpcommon.conf; + include common/locations.conf; } diff --git a/usr/share/easyengine/nginx/wpsubdir/basic.conf b/usr/share/easyengine/nginx/wpsubdir/basic.conf index d62ecced..938a44a3 100644 --- a/usr/share/easyengine/nginx/wpsubdir/basic.conf +++ b/usr/share/easyengine/nginx/wpsubdir/basic.conf @@ -37,7 +37,7 @@ server { fastcgi_pass php; } - include /etc/nginx/common/wpcommon.conf; - include /etc/nginx/common/locations.conf; + include common/wpcommon.conf; + include common/locations.conf; } diff --git a/usr/share/easyengine/nginx/wpsubdir/w3tc.conf b/usr/share/easyengine/nginx/wpsubdir/w3tc.conf index ca454cd8..192bc9ab 100644 --- a/usr/share/easyengine/nginx/wpsubdir/w3tc.conf +++ b/usr/share/easyengine/nginx/wpsubdir/w3tc.conf @@ -63,7 +63,7 @@ server { fastcgi_pass php; } - include /etc/nginx/common/wpcommon.conf; - include /etc/nginx/common/locations.conf; + include common/wpcommon.conf; + include common/locations.conf; } diff --git a/usr/share/easyengine/nginx/wpsubdir/wpfc.conf b/usr/share/easyengine/nginx/wpsubdir/wpfc.conf index aba038ef..4bb901b5 100644 --- a/usr/share/easyengine/nginx/wpsubdir/wpfc.conf +++ b/usr/share/easyengine/nginx/wpsubdir/wpfc.conf @@ -72,6 +72,6 @@ server { fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1"; } - include /etc/nginx/common/wpcommon.conf; - include /etc/nginx/common/locations.conf; + include common/wpcommon.conf; + include common/locations.conf; } diff --git a/usr/share/easyengine/nginx/wpsubdir/wpsc.conf b/usr/share/easyengine/nginx/wpsubdir/wpsc.conf index fe6607ff..56694d53 100644 --- a/usr/share/easyengine/nginx/wpsubdir/wpsc.conf +++ b/usr/share/easyengine/nginx/wpsubdir/wpsc.conf @@ -59,7 +59,7 @@ server { fastcgi_pass php; } - include /etc/nginx/common/wpcommon.conf; - include /etc/nginx/common/locations.conf; + include common/wpcommon.conf; + include common/locations.conf; } diff --git a/usr/share/easyengine/nginx/wpsubdomain/basic.conf b/usr/share/easyengine/nginx/wpsubdomain/basic.conf index aa481f44..fba6b628 100644 --- a/usr/share/easyengine/nginx/wpsubdomain/basic.conf +++ b/usr/share/easyengine/nginx/wpsubdomain/basic.conf @@ -25,7 +25,7 @@ server { fastcgi_pass php; } - include /etc/nginx/common/wpcommon.conf; - include /etc/nginx/common/locations.conf; + include common/wpcommon.conf; + include common/locations.conf; } diff --git a/usr/share/easyengine/nginx/wpsubdomain/w3tc.conf b/usr/share/easyengine/nginx/wpsubdomain/w3tc.conf index 0d8ae361..8308fec7 100644 --- a/usr/share/easyengine/nginx/wpsubdomain/w3tc.conf +++ b/usr/share/easyengine/nginx/wpsubdomain/w3tc.conf @@ -51,7 +51,7 @@ server { fastcgi_pass php; } - include /etc/nginx/common/wpcommon.conf; - include /etc/nginx/common/locations.conf; + include common/wpcommon.conf; + include common/locations.conf; } diff --git a/usr/share/easyengine/nginx/wpsubdomain/wpfc.conf b/usr/share/easyengine/nginx/wpsubdomain/wpfc.conf index 25b4f3ad..8c7b5186 100644 --- a/usr/share/easyengine/nginx/wpsubdomain/wpfc.conf +++ b/usr/share/easyengine/nginx/wpsubdomain/wpfc.conf @@ -60,6 +60,6 @@ server { fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1"; } - include /etc/nginx/common/wpcommon.conf; - include /etc/nginx/common/locations.conf; + include common/wpcommon.conf; + include common/locations.conf; } diff --git a/usr/share/easyengine/nginx/wpsubdomain/wpsc.conf b/usr/share/easyengine/nginx/wpsubdomain/wpsc.conf index 9830d12c..a1afa690 100644 --- a/usr/share/easyengine/nginx/wpsubdomain/wpsc.conf +++ b/usr/share/easyengine/nginx/wpsubdomain/wpsc.conf @@ -50,7 +50,7 @@ server { fastcgi_param SERVER_NAME $http_host; } - include /etc/nginx/common/wpcommon.conf; - include /etc/nginx/common/locations.conf; + include common/wpcommon.conf; + include common/locations.conf; } From 74f7e1843722d0a857a589198aee2f104c97c449 Mon Sep 17 00:00:00 2001 From: Mermouy Date: Sat, 15 Mar 2014 02:59:30 +0100 Subject: [PATCH 2/4] Added ee site edit command --- etc/bash_completion.d/ee | 9 ++++++++- usr/local/sbin/easyengine | 33 +++++++++++++++++++++++++++++---- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/etc/bash_completion.d/ee b/etc/bash_completion.d/ee index 36120b28..f51eb9e7 100644 --- a/etc/bash_completion.d/ee +++ b/etc/bash_completion.d/ee @@ -33,7 +33,7 @@ EEAUTO() ;; site) - COMPREPLY=( $( compgen -W "list show info create enable disable delete" -- $CURRENT ) ) + COMPREPLY=( $( compgen -W "list show info create enable disable delete edit" -- $CURRENT ) ) return 0 ;; @@ -54,6 +54,13 @@ EEAUTO() fi return 0 ;; + edit) + if [ "$EECOMMON" = "site" ] + then + COMPREPLY=( $( compgen -W '$(command find /etc/nginx/sites-available/ -type f -printf "%P " 2>/dev/null)' -- $CURRENT ) ) + fi + return 0 + ;; disable) COMPREPLY=( $( compgen -W '$(command find /etc/nginx/sites-enabled/ -type l -printf "%P " 2>/dev/null)' -- $CURRENT ) ) diff --git a/usr/local/sbin/easyengine b/usr/local/sbin/easyengine index 553cd92e..366b5083 100644 --- a/usr/local/sbin/easyengine +++ b/usr/local/sbin/easyengine @@ -844,6 +844,13 @@ EESITEINFO() echo -e "\033[34m$DOMAIN Database:\t\t \033[37m$WPDBNAME\e[0m" } +EESITEEDIT() +{ + # Run default editor on /etc/nginx/sites-available/$DOMAIN + sensible-editor /etc/nginx/sites-available/$DOMAIN + echo -e "\033[34VirtualHost updated..\e[0m" +} + NGINXBUCKETSIZE() { nginx -t 2>&1 | grep server_names_hash_bucket_size &>> $INSTALLLOG @@ -884,7 +891,7 @@ PHPRESTART() -# EE Domian Functions +# EE Domain Functions EESITENAME() { # Check SITENAME Is Empty Or Not @@ -2187,7 +2194,25 @@ then EEGITMESSAGE="Delete Website With $SITEDELETEARG Option: $DOMAIN" EEGITCOMMIT - fi + elif [ "$2" = "edit" ] + then + + # Check SITENAME Is Empty Or Not + SITENAMECHECK=$3 + EESITENAME + + # Run editor + EESITEEDIT + + # Reload Nginx Configuration + NGINXRELOAD + + # Take Nginx Configuration In Git Version Control + EEGITDIR=/etc/nginx + EEGITMESSAGE="Edited Website: $DOMAIN" + EEGITCOMMIT + + fi else echo -e "\033[34mList Of Available Commands:\e[0m" @@ -2197,9 +2222,9 @@ then echo -e "\tcreate:\t Create A New HTML PHP MySQL & WordPress Website" echo -e "\tdelete:\t Delete Existing Website" echo -e "\tenable:\t Enable Website" - echo -e "\tdisable: Disable Website" - fi + echo -e "\tedit: Manually Edit Website" + fi elif [ "$1" = "update" ] then From 523deb3bfdd562dbe5828c787b3a3362d9062679 Mon Sep 17 00:00:00 2001 From: Mermouy Date: Sun, 16 Mar 2014 16:34:20 +0100 Subject: [PATCH 3/4] Ee site edit added. Updated forgotten line about include relative path --- usr/share/easyengine/nginx/wp/w3tc.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/share/easyengine/nginx/wp/w3tc.conf b/usr/share/easyengine/nginx/wp/w3tc.conf index 10149081..6dd96ca9 100644 --- a/usr/share/easyengine/nginx/wp/w3tc.conf +++ b/usr/share/easyengine/nginx/wp/w3tc.conf @@ -45,7 +45,7 @@ server { fastcgi_pass php; } - include /etc/nginx/common/wpcommon.conf; + include common/wpcommon.conf; include common/locations.conf; } From 9dd4f5f614858bea376cf56c006b8410659d073c Mon Sep 17 00:00:00 2001 From: Mermouy Date: Sun, 16 Mar 2014 16:46:30 +0100 Subject: [PATCH 4/4] Corrected missing fi --- usr/local/sbin/easyengine | 1 + 1 file changed, 1 insertion(+) diff --git a/usr/local/sbin/easyengine b/usr/local/sbin/easyengine index 366b5083..d58d973e 100644 --- a/usr/local/sbin/easyengine +++ b/usr/local/sbin/easyengine @@ -2193,6 +2193,7 @@ then EEGITDIR=/etc/nginx EEGITMESSAGE="Delete Website With $SITEDELETEARG Option: $DOMAIN" EEGITCOMMIT + fi elif [ "$2" = "edit" ] then