Browse Source

certbot authenticator nginx

main
pvincent 2 weeks ago
parent
commit
af76368710
  1. 2
      sympa/recipe/sympa.recipe
  2. 2
      sympa/resources/tools/sympa_export.bash
  3. 12
      sympa/resources/tools/sympa_import.bash

2
sympa/recipe/sympa.recipe

@ -13,7 +13,7 @@ postfix postfix/mailname string $(hostname -f)
postfix postfix/main_mailer_type string 'Internet Site' postfix postfix/main_mailer_type string 'Internet Site'
postfix postfix/mynetworks string '127.0.0.0/8' postfix postfix/mynetworks string '127.0.0.0/8'
EOF EOF
DEBIAN_FRONTEND=noninteractive apt-get install -y postfix postgresql nginx fcgiwrap perl-doc micro debconf-utils
DEBIAN_FRONTEND=noninteractive apt-get install -y postfix postgresql nginx fcgiwrap perl-doc micro debconf-utils certbot python3-certbot-nginx
postconf -e "inet_protocols = ipv4" postconf -e "inet_protocols = ipv4"
systemctl restart postfix systemctl restart postfix
echo postfix installed successfully! echo postfix installed successfully!

2
sympa/resources/tools/sympa_export.bash

@ -36,7 +36,7 @@ function export_files {
function export_certbot { function export_certbot {
if [[ -d /etc/letsencrypt/live/$SYMPA_DOMAIN ]]; then if [[ -d /etc/letsencrypt/live/$SYMPA_DOMAIN ]]; then
tar -C / -cf "$temp_dir/certbot.tar" etc/letsencrypt
tar -C / --exclude etc/letsencrypt/cli.ini -cf "$temp_dir/certbot.tar" etc/letsencrypt
fi fi
} }

12
sympa/resources/tools/sympa_import.bash

@ -111,10 +111,20 @@ function import_certbot {
SYMPA_DOMAIN=$(grep '^domain' /etc/sympa/sympa/sympa.conf | cut -f2) SYMPA_DOMAIN=$(grep '^domain' /etc/sympa/sympa/sympa.conf | cut -f2)
if [[ -f "$export_tmp/certbot.tar" ]]; then if [[ -f "$export_tmp/certbot.tar" ]]; then
echo -n "import certbot..."
echo "certbot save previous cli.ini"
cp /etc/letsencrypt/cli.ini "$export_tmp/
echo "import certbot..."
rm -rf /etc/letsencrypt rm -rf /etc/letsencrypt
tar -xf "$export_tmp/certbot.tar" -C / tar -xf "$export_tmp/certbot.tar" -C /
echo OK echo OK
echo "certbot restore previous cli.ini"
mv "$export_tmp/cli.ini /etc/letsencrypt/
echo "convert certbot apache2 authenticator to certbotx nginx authenticator"
/opt/miaou-bash/tools/append_or_replace '^authenticator =.*$' "authenticator = nginx" /etc/letsencrypt/renewal/$SYMPA_DOMAIN.conf
/opt/miaou-bash/tools/append_or_replace '^installer =.*$' "installer = nginx" /etc/letsencrypt/renewal/$SYMPA_DOMAIN.conf
fi fi
# add options-ssl-nginx.conf # add options-ssl-nginx.conf

Loading…
Cancel
Save