In order to use this script, follow these simple steps:
- Run the following command in /etc/letsencrypt/scripts
cd /etc/letsencrypt/scripts
- Clone the project
git clone https://github.com/javadmsd/certbot-arvancloud.git
-
Type
cd certbot-arvancloud
and press enter. You should now be in the certbot-arvancloud directory -
Type
chmod +x authenticator.sh
andchmod +x cleanup.sh
in the terminal and press enter. This will make the script executable. -
Open the
config.sh
file, fill theAPI_KEY
with your ArvanCloud API token -
Install
certbot
package
sudo apt update
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
certbot --version
- Install
jq
package
sudo apt-get install jq
- Run the following command
certbot certonly --manual --manual-auth-hook ./authenticator.sh --manual-cleanup-hook ./cleanup.sh -d *.example.com
If you do not receive the following message at the end, continue with the steps
Certbot has set up a scheduled task to automatically renew this certificate in the background.
- If Use the command
crontab -e
to open the cron jobs for renew certificates
crontab -e
-
Press
i
on the keyboard to insert a new line. -
Type the following line
certbot renew --manual --manual-auth-hook /etc/letsencrypt/scripts/certbot-arvancloud/authenticator.sh --manual-cleanup-hook /etc/letsencrypt/scripts/certbot-arvancloud/cleanup.sh -d *.example.com >> /etc/letsencrypt/scripts/certbot-arvancloud/certbot.renew.log
-
Press
Esc
. -
Type
:wq
and pressEnter
to save the changes. -
Now the script is ready to be used.