mirror of
https://github.com/muerwre/muerwre.github.io.git
synced 2025-04-25 02:46:39 +07:00
1 line
No EOL
12 KiB
JSON
1 line
No EOL
12 KiB
JSON
{"_path":"/linux/certbot-well-known-auto-renew","_dir":"linux","_draft":false,"_partial":false,"_locale":"en","_empty":false,"title":"Certbot Well Known Auto Renew","description":"This is translation of article from clsv.ru, which explains how to automate certbot's well-known, also known as HTTP challenge for wildcard certs renewal.","excerpt":{"type":"root","children":[{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"This is translation of article from "},{"type":"element","tag":"a","props":{"href":"https://clsv.ru/linux/lets_encrypt_eto_legko_i_prosto_60","rel":["nofollow"]},"children":[{"type":"text","value":"clsv.ru"}]},{"type":"text","value":", which explains how to automate certbot's well-known, also known as HTTP challenge for wildcard certs renewal."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You'll need 4 scripts:"}]},{"type":"element","tag":"ol","props":{},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Authentication script, which will write authentication file:"}]}]},{"type":"element","tag":"code","props":{"code":"#!/bin/bash\necho $CERTBOT_VALIDATION > /var/www/html/.well-known/$CERTBOT_TOKEN\n","language":"shell"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"#!/bin/bash\necho $CERTBOT_VALIDATION > /var/www/html/.well-known/$CERTBOT_TOKEN\n"}]}]}]},{"type":"element","tag":"ol","props":{"start":2},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Cleanup script, that will delete that"}]}]},{"type":"element","tag":"code","props":{"code":"#!/bin/bash\nrm -f /var/www/html/.well-known/$CERTBOT_TOKEN\n","language":"shell"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"#!/bin/bash\nrm -f /var/www/html/.well-known/$CERTBOT_TOKEN\n"}]}]}]},{"type":"element","tag":"ol","props":{"start":3},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Initial cert acquiring script:"}]}]},{"type":"element","tag":"code","props":{"code":"certbot certonly \\\n --preferred-challenges=http --manual \\\n --manual-auth-hook /path/to/auth.sh \\\n --manual-cleanup-hook /oath/to/clean.sh\n -d \"yourhost.org,*.yourhost.org\" \\\n --manual-public-ip-logging-ok\n","language":"shell"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"certbot certonly \\\n --preferred-challenges=http --manual \\\n --manual-auth-hook /path/to/auth.sh \\\n --manual-cleanup-hook /oath/to/clean.sh\n -d \"yourhost.org,*.yourhost.org\" \\\n --manual-public-ip-logging-ok\n"}]}]}]},{"type":"element","tag":"ol","props":{"start":4},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Renewal script itself, to put it in crontab (or /etc/cron.weekly)"}]}]},{"type":"element","tag":"code","props":{"code":"certbot renew --manual-public-ip-logging-ok \\\n --manual-auth-hook /path/to/auth.sh \\\n --manual-cleanup-hook /path/to/clean.sh\n\nsystemctl reload nginx\n","language":"shell"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"certbot renew --manual-public-ip-logging-ok \\\n --manual-auth-hook /path/to/auth.sh \\\n --manual-cleanup-hook /path/to/clean.sh\n\nsystemctl reload nginx\n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Don't forget to configure your http server to serve "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":".well-known"}]},{"type":"text","value":"."}]}]},"body":{"type":"root","children":[{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"This is translation of article from "},{"type":"element","tag":"a","props":{"href":"https://clsv.ru/linux/lets_encrypt_eto_legko_i_prosto_60","rel":["nofollow"]},"children":[{"type":"text","value":"clsv.ru"}]},{"type":"text","value":", which explains how to automate certbot's well-known, also known as HTTP challenge for wildcard certs renewal."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You'll need 4 scripts:"}]},{"type":"element","tag":"ol","props":{},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Authentication script, which will write authentication file:"}]}]},{"type":"element","tag":"code","props":{"code":"#!/bin/bash\necho $CERTBOT_VALIDATION > /var/www/html/.well-known/$CERTBOT_TOKEN\n","language":"shell"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-30b3d5"},"children":[{"type":"text","value":"#!/bin/bash"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-5e1d2f"},"children":[{"type":"text","value":"echo"}]},{"type":"element","tag":"span","props":{"class":"ct-722310"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-0f1e10"},"children":[{"type":"text","value":"$"}]},{"type":"element","tag":"span","props":{"class":"ct-61baa0"},"children":[{"type":"text","value":"CERTBOT_VALIDATION"}]},{"type":"element","tag":"span","props":{"class":"ct-722310"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-d4cb39"},"children":[{"type":"text","value":">"}]},{"type":"element","tag":"span","props":{"class":"ct-722310"},"children":[{"type":"text","value":" /var/www/html/.well-known/"}]},{"type":"element","tag":"span","props":{"class":"ct-0f1e10"},"children":[{"type":"text","value":"$"}]},{"type":"element","tag":"span","props":{"class":"ct-61baa0"},"children":[{"type":"text","value":"CERTBOT_TOKEN"}]}]}]}]}]},{"type":"element","tag":"ol","props":{"start":2},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Cleanup script, that will delete that"}]}]},{"type":"element","tag":"code","props":{"code":"#!/bin/bash\nrm -f /var/www/html/.well-known/$CERTBOT_TOKEN\n","language":"shell"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-30b3d5"},"children":[{"type":"text","value":"#!/bin/bash"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-722310"},"children":[{"type":"text","value":"rm -f /var/www/html/.well-known/"}]},{"type":"element","tag":"span","props":{"class":"ct-0f1e10"},"children":[{"type":"text","value":"$"}]},{"type":"element","tag":"span","props":{"class":"ct-61baa0"},"children":[{"type":"text","value":"CERTBOT_TOKEN"}]}]}]}]}]},{"type":"element","tag":"ol","props":{"start":3},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Initial cert acquiring script:"}]}]},{"type":"element","tag":"code","props":{"code":"certbot certonly \\\n --preferred-challenges=http --manual \\\n --manual-auth-hook /path/to/auth.sh \\\n --manual-cleanup-hook /oath/to/clean.sh\n -d \"yourhost.org,*.yourhost.org\" \\\n --manual-public-ip-logging-ok\n","language":"shell"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-722310"},"children":[{"type":"text","value":"certbot certonly \\"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-722310"},"children":[{"type":"text","value":" --preferred-challenges=http --manual \\"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-722310"},"children":[{"type":"text","value":" --manual-auth-hook /path/to/auth.sh \\"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-722310"},"children":[{"type":"text","value":" --manual-cleanup-hook /oath/to/clean.sh"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-722310"},"children":[{"type":"text","value":" -d "}]},{"type":"element","tag":"span","props":{"class":"ct-8f08f4"},"children":[{"type":"text","value":"\"yourhost.org,*.yourhost.org\""}]},{"type":"element","tag":"span","props":{"class":"ct-722310"},"children":[{"type":"text","value":" \\"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-722310"},"children":[{"type":"text","value":" --manual-public-ip-logging-ok"}]}]}]}]}]},{"type":"element","tag":"ol","props":{"start":4},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Renewal script itself, to put it in crontab (or /etc/cron.weekly)"}]}]},{"type":"element","tag":"code","props":{"code":"certbot renew --manual-public-ip-logging-ok \\\n --manual-auth-hook /path/to/auth.sh \\\n --manual-cleanup-hook /path/to/clean.sh\n\nsystemctl reload nginx\n","language":"shell"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-722310"},"children":[{"type":"text","value":"certbot renew --manual-public-ip-logging-ok \\"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-722310"},"children":[{"type":"text","value":" --manual-auth-hook /path/to/auth.sh \\"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-722310"},"children":[{"type":"text","value":" --manual-cleanup-hook /path/to/clean.sh"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-722310"},"children":[{"type":"text","value":"systemctl reload nginx"}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Don't forget to configure your http server to serve "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":".well-known"}]},{"type":"text","value":"."}]},{"type":"element","tag":"style","children":[{"type":"text","value":".ct-8f08f4{color:#A5D6FF}.ct-d4cb39{color:#FF7B72}.ct-61baa0{color:#C9D1D9}.ct-0f1e10{color:#C9D1D9}.ct-722310{color:#C9D1D9}.ct-5e1d2f{color:#79C0FF}.ct-30b3d5{color:#8B949E}.light .ct-30b3d5{color:#93A1A1}.light .ct-5e1d2f{color:#268BD2}.light .ct-722310{color:#657B83}.light .ct-0f1e10{color:#859900}.light .ct-61baa0{color:#268BD2}.light .ct-d4cb39{color:#859900}.light .ct-8f08f4{color:#2AA198}"}]}],"toc":{"title":"","searchDepth":2,"depth":2,"links":[]}},"_type":"markdown","_id":"content:Linux:Certbot well-known auto renew.md","_source":"content","_file":"Linux/Certbot well-known auto renew.md","_extension":"md"} |