From f3fa182dc713fd3c3b5f43a1f8d70ce70543c15a Mon Sep 17 00:00:00 2001 From: Nicolas Roman Date: Wed, 17 Jul 2019 17:20:32 +0200 Subject: [PATCH] delete methods updating the vhost after cert installation is completed --- inc/webadmin-letsencrypt.php | 8 -------- lib/letsencrypt.php | 18 ------------------ scripts/web-add.sh | 25 ------------------------- 3 files changed, 51 deletions(-) diff --git a/inc/webadmin-letsencrypt.php b/inc/webadmin-letsencrypt.php index 9237b23..b33bf87 100644 --- a/inc/webadmin-letsencrypt.php +++ b/inc/webadmin-letsencrypt.php @@ -142,14 +142,6 @@ if (isset($_POST['submit'])) { break; } - $updatedVhostConfig = $letsencrypt->setSSLPortVhost($params[1]); - - if (!$updatedVhostConfig) { - $errorMessage = "Erreur : La modification de la configuration de l'hôte virtuel a échoué.
- Merci de contacter un administrateur pour continuer."; - break; - } - break; } } diff --git a/lib/letsencrypt.php b/lib/letsencrypt.php index 99de7f9..8c0d2d4 100644 --- a/lib/letsencrypt.php +++ b/lib/letsencrypt.php @@ -66,24 +66,6 @@ class LetsEncrypt return false; } - /** - * add the 443 port to the vhost configuration - * @param string $vhost - * @return boolean - */ - public function setSSLPortVhost($vhost) - { - $cmd = 'web-add.sh update-ssl-vhost-configuration ' . $vhost; - - sudoexec($cmd, $data_output, $exec_return); - - if ($exec_return == 0) { - return true; - } - - return false; - } - /** * perform a cURL call on the remote resource * the cURL call follows redirections diff --git a/scripts/web-add.sh b/scripts/web-add.sh index 9c174a4..933c214 100755 --- a/scripts/web-add.sh +++ b/scripts/web-add.sh @@ -171,10 +171,6 @@ generate-ssl-certificate LOGIN [TRUE | FALSE] Generate the Let's Encrypt certificate Run in TEST mode if TRUE -update-ssl-vhost-configuration LOGIN - - Add the 443 port to the vhost configuration and reload the service - EOT } @@ -873,9 +869,6 @@ arg_processing() { generate-ssl-certificate) op_generatesslcertificate "$@" ;; - update-ssl-vhost-configuration) - op_updatesslvhost "$@" - ;; *) usage ;; @@ -918,24 +911,6 @@ op_generatesslcertificate() { fi } -op_updatesslvhost() { - if [ $# -eq 1 ]; then - vhostfile="/etc/apache2/sites-available/$1.conf" - - sed -i "s/:80>/:80 *:443>/" "$vhostfile" - - configtest_out=$(apache2ctl configtest) - configtest_rc=$? - - if [ "$configtest_rc" = "0" ]; then - /etc/init.d/apache2 force-reload >/dev/null - else - echo $configtest_out >&2 - fi - else usage - fi -} - op_managehttpchallengefile() { if [ $# -eq 1 ]; then folder="/var/lib/letsencrypt/.well-known"