Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Let's Encrypt] Add extended logging of cron task execution #297 #298

Merged
merged 7 commits into from
Jun 14, 2024

Conversation

lazarenkoalexey
Copy link
Contributor

No description provided.


_exp_date_unixtime=$(date --date="$exp_date" "+%s");
_cur_date_unixtime=$(date "+%s");
_delta_time=$(( $_exp_date_unixtime - $_cur_date_unixtime ));

[[ $_delta_time -le $seconds_before_expire ]] && {
echo "$(date) - update required" >> /var/log/letsencrypt.log;
echo "$(date) - update required" >> ${LOG_FILE};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have the stdout redirection at the upper level, so you don't need to do this manually.

@@ -68,16 +69,17 @@ seconds_before_expire=$(( $DAYS_BEFORE_EXPIRE * 24 * 60 * 60 ));
$( [[ -e /usr/bin/python ]] || ln -s /usr/bin/python3 /usr/bin/python )
[[ -f "/var/lib/jelastic/SSL/jelastic.crt" && "$withExtIp" != "false" ]] && exp_date=$(jem ssl checkdomain | python -c "import sys, json; print (json.load(sys.stdin)['expiredate'])");

[ -z "$exp_date" ] && { echo "$(date) - no certificates for update" >> /var/log/letsencrypt.log; exit 0; };
[ -z "$exp_date" ] && { echo "$(date) - no certificates for update" >> ${LOG_FILE}; exit 0; };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have the stdout redirection at the upper level, so you don't need to do this manually.

@@ -10,6 +10,7 @@ GIT=$(which git);
BASE_REPO_URL="https://github.com/jelastic-jps/lets-encrypt"
RAW_REPO_SCRIPS_URL="https://raw.githubusercontent.com/jelastic-jps/lets-encrypt/master/scripts/"
SETTINGS_CUSTOM="/var/lib/jelastic/keys/letsencrypt/settings-custom"
LOG_FILE="/var/log/letsencrypt.log"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

validateLatestVersion
resp=$($WGET --no-check-certificate -qO- "${auto_update_url}");
echo ${resp} >> ${LOG_FILE};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have the stdout redirection at the upper level, so you don't need to do this manually.

scripts/auto-update-ssl-cert.sh Outdated Show resolved Hide resolved
@SlavaKatiukha SlavaKatiukha merged commit d9a26ed into jelastic-jps:master Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants