File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,8 +52,8 @@ This script:
5252- Registers/requests a certificate with certbot (` amiiboapi.org,www.amiiboapi.org ` by default)
5353- Copies ` fullchain.pem ` and ` privkey.pem ` from ` /etc/letsencrypt/live/amiiboapi.org/ ` into the project root
5454- Sets file permissions to read/write for owner+group (` 660 ` ) on both certificate files
55- - Installs ` /etc/cron.d/amiiboapi-certbot ` to run daily renewal checks
56- - ` certbot renew ` renews 90-day certificates when they have 30 days or less remaining
55+ - Installs ` /etc/cron.d/amiiboapi-certbot ` to run renewal checks twice daily
56+ - ` certbot renew ` renews certificates ( 90-day validity) when they have 30 days or less remaining
5757
5858> [ !IMPORTANT]
5959> ` certbot --standalone ` needs port ` 80 ` available. Stop any process using port ` 80 ` before running issuance if needed.
Original file line number Diff line number Diff line change @@ -72,13 +72,13 @@ renew_certificate() {
7272
7373install_renewal_schedule () {
7474 local cron_cmd cron_line
75- if [[ " $SCRIPT_PATH " == * " " * || " $LOG_FILE " == * " " * ]]; then
76- echo " SCRIPT_PATH and LOG_FILE must not contain spaces for cron setup." >&2
75+ if [[ ! " $SCRIPT_PATH " =~ ^[A-Za-z0-9._/-]+$ || ! " $LOG_FILE " =~ ^[A-Za-z0-9._/-]+$ ]]; then
76+ echo " SCRIPT_PATH and LOG_FILE contain unsupported characters for cron setup." >&2
7777 exit 1
7878 fi
7979
8080 cron_cmd=" /bin/bash \" $SCRIPT_PATH \" renew >> \" $LOG_FILE \" 2>&1"
81- cron_line=" 0 3 * * * root $cron_cmd "
81+ cron_line=" 0 3,15 * * * root $cron_cmd "
8282
8383 run_as_root touch " $LOG_FILE "
8484 run_as_root chmod 644 " $LOG_FILE "
You can’t perform that action at this time.
0 commit comments