Plugin for LetsEncrypt domains overview

Also on github?
Not yet, but in the plugin i included the console/terminal script. Described it in the first post;

After installation of the plugin you can also run a console script for example in /root:

Code:
ln -s /usr/local/directadmin/plugins/letsencrypt_domains/admin/letsencrypt_show_all.sh letsencrypt_show_all.sh

If you now login to your system you can run letsencrypt_show_all.sh and always have access to the latest version:

Code:
cd /root
./letsencrypt_show_all.sh
 
Thanks for this plugin @Erulezz!

A little modification to letsencrypt_domains.sh and letsencrypt_show_all.sh file.. ..nice to know who's the owner of a domain, or skip suspended accounts and domains?

Code:
for certificate in `ls -1 /usr/local/directadmin/data/users/*/domains/*.cert.creation_time`;
do
    creation_time=`basename ${certificate}`;
    dirname=`dirname ${certificate}`;
    domain=${creation_time%.cert.creation_time};


Add:
Code:
    owner=`grep ^${domain} /etc/virtual/domainowners | cut -d ":" -f2 | sed 's/ //g'`;
    suspended1=`grep ^suspended= /usr/local/directadmin/data/users/${owner}/user.conf | cut -d "=" -f 2`;
    suspended2=`grep ^suspended= /usr/local/directadmin/data/users/${owner}/domains/${domain}.conf | cut -d "=" -f 2`;
    ssl=`grep ^ssl= /usr/local/directadmin/data/users/${owner}/domains/${domain}.conf | cut -d "=" -f 2`;
    if [[ "${suspended1}" == "yes" ]] || [[ "${suspended2}" == "yes" ]] || [[ "${ssl}" != "ON" ]];
    then
        continue;
    else


Code:
        if [ -e "${dirname}/${domain}.cert.creation_time" ] && [ -e "${dirname}/${domain}.cert" ] && [ -e "${dirname}/${domain}.key" ];
        then
        ledomains=$[ledomains + 1];

        csr_name=`grep ^NAME= ${dirname}/${domain}.csr_info | cut -d "=" -f 2`;
        alt_names=`openssl x509 -text -noout -in ${dirname}/${domain}.cert | grep "DNS" | cut -c 20- | tr -d 'DNS:'`;
        signature_algorithm=`openssl x509 -text -noout -in ${dirname}/${domain}.cert | grep -m 1 "Signature Algorithm" | tr -d ' '`;
        public_key=`openssl x509 -text -noout -in ${dirname}/${domain}.cert | grep -m 1 "Public-Key:" | tr -d ' '`;
        created=`cat ${dirname}/${domain}.cert.creation_time`;
        created_date=`LC_ALL=en_US.utf8 date -d @$created`;
        renewal_date=`LC_ALL=en_US.utf8 date -d "$created_date+$letsencrypt_renewal_days days"`;
        renewal_days=$(expr '(' $created + 5184000 - $(LC_ALL=en_US.utf8 date +%s) ')' / 86400)


Add:
Code:
        echo "  ${bold}$owner${normal}";


Code:
        echo "  ${bold}$domain${normal}";
        echo "    CSR Name: $csr_name";
        echo "    Alternative Names: $alt_names";
        echo "    $signature_algorithm - $public_key";
        echo "    Created: $created_date - (Timestamp: $created)";
        echo "    Renewal: $renewal_date";
        echo "    Renewal in ~ $renewal_days days.";
        echo "";

        fi;


Add:
Code:
    fi;


Code:
done;
 
Another issue, only by SSH there was a view, index.html with shell_exec enabled didn't shows any content at all but exec does! I've changed the following;

Code:
<?php
exec('/usr/local/directadmin/plugins/letsencrypt_domains/admin/letsencrypt_info.sh', $info);
exec('/usr/local/directadmin/plugins/letsencrypt_domains/admin/letsencrypt_hostname.sh', $hostname);
exec('/usr/local/directadmin/plugins/letsencrypt_domains/admin/letsencrypt_domains.sh', $domains);
?>

<div class="letsencrypt_domains">
<?=implode("\n", $info); ?>
<br>
<?=implode("\n", $hostname); ?>
<br>
<?=implode("\n", $domains); ?>
</div>
 
Back
Top