From 8624b00ad1921ac65a44460dc03e3a1a123faaf0 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 18 Oct 2016 17:42:49 -0400 Subject: [PATCH 01/12] *Call v-delete-letsencrypt-domain not v-add-letsencrypt-domain --- web/edit/web/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/edit/web/index.php b/web/edit/web/index.php index 83108105f..65b3a623d 100644 --- a/web/edit/web/index.php +++ b/web/edit/web/index.php @@ -267,7 +267,7 @@ if (!empty($_POST['save'])) { // Disable Lets Encrypt support if (( $v_letsencrypt == 'yes' ) && (empty($_POST['v_letsencrypt'])) && (!empty($_POST['v_letsencrypt'])) && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-add-letsencrypt-domain ".$user." ".$v_domain." '' 'no'", $output, $return_var); + exec (VESTA_CMD."v-delete-letsencrypt-domain ".$user." ".$v_domain." '' 'no'", $output, $return_var); check_return_code($return_var,$output); unset($output); $v_letsencrypt = 'no'; From d7a4697ad5a2af0739d05902dc0650eeac306eee Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 18 Oct 2016 17:44:33 -0400 Subject: [PATCH 02/12] *Only update letsencrypt UI if its checked --- web/js/pages/edit_web.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/js/pages/edit_web.js b/web/js/pages/edit_web.js index ae9c28606..ecdba8b34 100644 --- a/web/js/pages/edit_web.js +++ b/web/js/pages/edit_web.js @@ -180,7 +180,9 @@ $(function() { var elm = $(evt.target); App.Actions.WEB.passwordChanged(elm); }); - App.Actions.WEB.toggle_letsencrypt($('input[name=v_letsencrypt]')) + if ($('input[name=v_letsencrypt]').attr('checked')) { + App.Actions.WEB.toggle_letsencrypt($('input[name=v_letsencrypt]')) + } }); function WEBrandom() { From 4f0badee79077654bdac3cf2d0ea8400310d0c69 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 18 Oct 2016 17:47:34 -0400 Subject: [PATCH 03/12] *Remove flawed SSL logic --- web/edit/web/index.php | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/web/edit/web/index.php b/web/edit/web/index.php index 65b3a623d..f57e9761d 100644 --- a/web/edit/web/index.php +++ b/web/edit/web/index.php @@ -274,19 +274,8 @@ if (!empty($_POST['save'])) { $restart_web = 'yes'; $restart_proxy = 'yes'; } - else { - // Delete SSL certificate - if (( $v_ssl == 'yes' ) && (empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) { - exec (VESTA_CMD."v-list-web-domain ".$user." ".$v_domain." json", $output, $return_var); - $data = json_decode(implode('', $output), true); - exec (VESTA_CMD."v-add-letsencrypt-domain ".$user." ".$v_domain." '".$data['ALIAS']."' 'no'", $output, $return_var); - check_return_code($return_var,$output); - unset($output); - $v_ssl = 'no'; - $restart_web = 'yes'; - $restart_proxy = 'yes'; - } - } + + // Enable Lets Encrypt support if (( $v_letsencrypt == 'no' || empty( $v_letsencrypt)) && (!empty($_POST['v_letsencrypt'])) && empty($_SESSION['error_msg'])) { exec (VESTA_CMD."v-list-web-domain ".$user." ".$v_domain." json", $output, $return_var); $data = json_decode(implode('', $output), true); From 5d705da592d70c80aaa2cff2a096c7e1a4cfd6f0 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 18 Oct 2016 17:53:51 -0400 Subject: [PATCH 04/12] *Add original delete SSL logic back --- web/edit/web/index.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web/edit/web/index.php b/web/edit/web/index.php index f57e9761d..4c7377c4e 100644 --- a/web/edit/web/index.php +++ b/web/edit/web/index.php @@ -274,6 +274,17 @@ if (!empty($_POST['save'])) { $restart_web = 'yes'; $restart_proxy = 'yes'; } + else{ + // Delete SSL certificate + if (( $v_ssl == 'yes' ) && (empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) { + exec (VESTA_CMD."v-delete-web-domain-ssl ".$v_username." ".$v_domain." 'no'", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + $v_ssl = 'no'; + $restart_web = 'yes'; + $restart_proxy = 'yes'; + } + } // Enable Lets Encrypt support if (( $v_letsencrypt == 'no' || empty( $v_letsencrypt)) && (!empty($_POST['v_letsencrypt'])) && empty($_SESSION['error_msg'])) { From 1a7c3baade160f90be9cbd7b3d41cfff01dad498 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 18 Oct 2016 18:05:16 -0400 Subject: [PATCH 05/12] *Show if letsencrypt is on --- web/templates/admin/list_web.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web/templates/admin/list_web.html b/web/templates/admin/list_web.html index 233a5f042..a8c31a74b 100644 --- a/web/templates/admin/list_web.html +++ b/web/templates/admin/list_web.html @@ -247,6 +247,18 @@ sort-name="" sort-bandwidth="" sort-dis + + +
+ +
+
:
+
+ +
+
+ +
From 0ee268dc0ba68abf4311281a4cc0a47fac4f534c Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 18 Oct 2016 18:07:12 -0400 Subject: [PATCH 06/12] *Add empty check --- web/templates/admin/list_web.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/templates/admin/list_web.html b/web/templates/admin/list_web.html index a8c31a74b..18164d844 100644 --- a/web/templates/admin/list_web.html +++ b/web/templates/admin/list_web.html @@ -248,7 +248,7 @@ sort-name="" sort-bandwidth="" sort-dis - +
From 53dfc584a2407c4d1abe17cb0219cacba20bfb21 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 18 Oct 2016 18:08:32 -0400 Subject: [PATCH 07/12] *Puts letsencrypt on its own row --- web/templates/admin/list_web.html | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/web/templates/admin/list_web.html b/web/templates/admin/list_web.html index 18164d844..70a953e02 100644 --- a/web/templates/admin/list_web.html +++ b/web/templates/admin/list_web.html @@ -247,18 +247,6 @@ sort-name="" sort-bandwidth="" sort-dis
- - -
- -
-
:
-
- -
-
- -
@@ -278,6 +266,22 @@ sort-name="" sort-bandwidth="" sort-dis + + + +
+ +
+
:
+
+ +
+
+ + + + +
From dc374f5d986a4492673e302d672820f544620297 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 18 Oct 2016 18:11:03 -0400 Subject: [PATCH 08/12] *Fix alignment of letsencrypt --- web/templates/admin/list_web.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/templates/admin/list_web.html b/web/templates/admin/list_web.html index 70a953e02..44ab05942 100644 --- a/web/templates/admin/list_web.html +++ b/web/templates/admin/list_web.html @@ -266,6 +266,7 @@ sort-name="" sort-bandwidth="" sort-dis + @@ -280,8 +281,6 @@ sort-name="" sort-bandwidth="" sort-dis - -
From 54d4d9f60de237750b9b025d18b153afdd48c3cb Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 18 Oct 2016 18:12:13 -0400 Subject: [PATCH 09/12] *Fix markup error --- web/templates/admin/list_web.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/templates/admin/list_web.html b/web/templates/admin/list_web.html index 44ab05942..db3da219a 100644 --- a/web/templates/admin/list_web.html +++ b/web/templates/admin/list_web.html @@ -266,8 +266,8 @@ sort-name="" sort-bandwidth="" sort-dis - +
From f17fcc1f2e94db152f215daf2b996d88ae3341b6 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 18 Oct 2016 18:15:45 -0400 Subject: [PATCH 10/12] *Add letsencrypt to output --- bin/v-list-web-domain | 10 +++++++--- bin/v-list-web-domains | 13 +++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/bin/v-list-web-domain b/bin/v-list-web-domain index a3e162ab6..9a0e81da5 100755 --- a/bin/v-list-web-domain +++ b/bin/v-list-web-domain @@ -31,6 +31,7 @@ json_list() { "STATS_USER": "'$STATS_USER'", "SSL": "'$SSL'", "SSL_HOME": "'$SSL_HOME'", + "LETSENCRYPT": "'$LETSENCRYPT'", "FTP_USER": "'$FTP_USER'", "FTP_PATH": "'$FTP_PATH'", "AUTH_USER": "'$AUTH_USER'", @@ -56,6 +57,9 @@ shell_list() { fi if [ ! -z "$SSL" ] && [ "$SSL" != 'no' ]; then echo "SSL: $SSL / $SSL_HOME" + if [ ! -z "$LETSENCRYPT" ] && [ "$LETSENCRYPT" != 'no' ]; then + echo "LETSENCRYPT: $LETSENCRYPT" + fi fi echo "TEMPLATE: $TPL" if [ ! -z "$WEB_BACKEND" ]; then @@ -84,7 +88,7 @@ shell_list() { # PLAIN list function plain_list() { echo -ne "$DOMAIN\t$IP\t$IP6\t$U_DISK\t$U_BANDWIDTH\t$TPL\t" - echo -ne "$ALIAS\t$STATS\t$STATS_USER\t$SSL\t$SSL_HOME\t" + echo -ne "$ALIAS\t$STATS\t$STATS_USER\t$SSL\t$SSL_HOME\t,$LETSENCRYPT" echo -ne "$FTP_USER\t$FTP_PATH\t$AUTH_USER\t$BACKEND\t$PROXY\t" echo -e "$PROXY_EXT\t$SUSPENDED\t$TIME\t$DATE" } @@ -92,10 +96,10 @@ plain_list() { # CSV list function csv_list() { echo -n "DOMAIN,IP,IP6,U_DISK,U_BANDWIDTH,TPL,ALIAS,STATS,STATS_USER,SSL," - echo -n "SSL_HOME,FTP_USER,FTP_PATH,AUTH_USER,BACKEND,PROXY,PROXY_EXT," + echo -n "SSL_HOME,LETSENCRYPT,FTP_USER,FTP_PATH,AUTH_USER,BACKEND,PROXY,PROXY_EXT," echo "SUSPENDED,TIME,DATE" echo -n "$DOMAIN,$IP,$IP6,$U_DISK,$U_BANDWIDTH,$TPL,\"$ALIAS\",$STATS" - echo -n "\"$STATS_USER\",$SSL,$SSL_HOME,\"$FTP_USER\",\"$FTP_PATH\"," + echo -n "\"$STATS_USER\",$SSL,$SSL_HOME,$LETSENCRYPT,\"$FTP_USER\",\"$FTP_PATH\"," echo -n "\"$AUTH_USER\",$BACKEND,$PROXY,\"$PROXY_EXT\",$SUSPENDED,$TIME," echo "$DATE" } diff --git a/bin/v-list-web-domains b/bin/v-list-web-domains index 48186feeb..290411f43 100755 --- a/bin/v-list-web-domains +++ b/bin/v-list-web-domains @@ -35,6 +35,7 @@ json_list() { "STATS_USER": "'$STATS_USER'", "SSL": "'$SSL'", "SSL_HOME": "'$SSL_HOME'", + "LETSENCRYPT": "'$LETSENCRYPT'", "FTP_USER": "'$FTP_USER'", "FTP_PATH": "'$FTP_PATH'", "AUTH_USER": "'$AUTH_USER'", @@ -58,11 +59,11 @@ json_list() { # SHELL list function shell_list() { IFS=$'\n' - echo "DOMAIN IP TPL SSL DISK BW SPND DATE" - echo "------ -- --- --- ---- -- ---- ----" + echo "DOMAIN IP TPL SSL LETSENCRYPT DISK BW SPND DATE" + echo "------ -- --- --- ----------- ---- -- ---- ----" while read str; do eval $str - echo "$DOMAIN $IP $TPL $SSL $U_DISK $U_BANDWIDTH $SUSPENDED $DATE" + echo "$DOMAIN $IP $TPL $SSL $LETSENCRYPT $U_DISK $U_BANDWIDTH $SUSPENDED $DATE" done < <(cat $USER_DATA/web.conf) } @@ -72,7 +73,7 @@ plain_list() { while read str; do eval $str echo -ne "$DOMAIN\t$IP\t$IP6\t$U_DISK\t$U_BANDWIDTH\t$TPL\t" - echo -ne "$ALIAS\t$STATS\t$STATS_USER\t$SSL\t$SSL_HOME\t" + echo -ne "$ALIAS\t$STATS\t$STATS_USER\t$SSL\t$SSL_HOME\t$LETSENCRYPT\t" echo -ne "$FTP_USER\t$FTP_PATH\t$AUTH_USER\t$BACKEND\t$PROXY\t" echo -e "$PROXY_EXT\t$SUSPENDED\t$TIME\t$DATE" done < <(cat $USER_DATA/web.conf) @@ -82,12 +83,12 @@ plain_list() { csv_list() { IFS=$'\n' echo -n "DOMAIN,IP,IP6,U_DISK,U_BANDWIDTH,TPL,ALIAS,STATS,STATS_USER," - echo -n "SSL,SSL_HOME,FTP_USER,FTP_PATH,AUTH_USER,BACKEND,PROXY," + echo -n "SSL,SSL_HOME,LETSENCRYPT,FTP_USER,FTP_PATH,AUTH_USER,BACKEND,PROXY," echo "PROXY_EXT,SUSPENDED,TIME,DATE" while read str; do eval $str echo -n "$DOMAIN,$IP,$IP6,$U_DISK,$U_BANDWIDTH,$TPL," - echo -n "\"$ALIAS\",$STATS,\"$STATS_USER\",$SSL,$SSL_HOME," + echo -n "\"$ALIAS\",$STATS,\"$STATS_USER\",$SSL,$SSL_HOME,$LETSENCRYPT," echo -n "\"$FTP_USER\",\"$FTP_PATH\",\"$AUTH_USER\",$BACKEND,$PROXY," echo "\"$PROXY_EXT\",$SUSPENDED,$TIME,$DATE" done < <(cat $USER_DATA/web.conf) From 420290bc917fce60214cae88ec1f4fdca3620b95 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 18 Oct 2016 18:21:52 -0400 Subject: [PATCH 11/12] *Fix shell alignment of LETSENCRYPT --- bin/v-list-web-domain | 2 +- bin/v-list-web-domains | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/v-list-web-domain b/bin/v-list-web-domain index 9a0e81da5..e0f9492cb 100755 --- a/bin/v-list-web-domain +++ b/bin/v-list-web-domain @@ -58,7 +58,7 @@ shell_list() { if [ ! -z "$SSL" ] && [ "$SSL" != 'no' ]; then echo "SSL: $SSL / $SSL_HOME" if [ ! -z "$LETSENCRYPT" ] && [ "$LETSENCRYPT" != 'no' ]; then - echo "LETSENCRYPT: $LETSENCRYPT" + echo "LETSENCRYPT: $LETSENCRYPT" fi fi echo "TEMPLATE: $TPL" diff --git a/bin/v-list-web-domains b/bin/v-list-web-domains index 290411f43..a1f11642a 100755 --- a/bin/v-list-web-domains +++ b/bin/v-list-web-domains @@ -59,8 +59,8 @@ json_list() { # SHELL list function shell_list() { IFS=$'\n' - echo "DOMAIN IP TPL SSL LETSENCRYPT DISK BW SPND DATE" - echo "------ -- --- --- ----------- ---- -- ---- ----" + echo "DOMAIN IP TPL SSL LETSENCRYPT DISK BW SPND DATE" + echo "------ -- --- --- ----------- ---- -- ---- ----------" while read str; do eval $str echo "$DOMAIN $IP $TPL $SSL $LETSENCRYPT $U_DISK $U_BANDWIDTH $SUSPENDED $DATE" From c2f39cee39b33cd0746ceb06a09ff2a5f1f9675a Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 18 Oct 2016 18:24:20 -0400 Subject: [PATCH 12/12] *Fix shell alignment of LETSENCRYPT --- bin/v-list-web-domains | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v-list-web-domains b/bin/v-list-web-domains index a1f11642a..319ce922b 100755 --- a/bin/v-list-web-domains +++ b/bin/v-list-web-domains @@ -59,7 +59,7 @@ json_list() { # SHELL list function shell_list() { IFS=$'\n' - echo "DOMAIN IP TPL SSL LETSENCRYPT DISK BW SPND DATE" + echo "DOMAIN IP TPL SSL LETSENCRYPT DISK BW SPND DATE " echo "------ -- --- --- ----------- ---- -- ---- ----------" while read str; do eval $str