Browse Source

delete methods updating the vhost after cert installation is completed

pull/63/head
Nicolas Roman 2 years ago
parent
commit
f3fa182dc7
  1. 8
      inc/webadmin-letsencrypt.php
  2. 18
      lib/letsencrypt.php
  3. 25
      scripts/web-add.sh

8
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é.<br>
Merci de contacter un administrateur pour continuer.";
break;
}
break;
}
}

18
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

25
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"

Loading…
Cancel
Save