mirror of
https://github.com/zulip/zulip.git
synced 2025-10-29 11:03:54 +00:00
certbot-auto doesn’t work on Ubuntu 20.04, and won’t be updated; we migrate to instead using the certbot package shipped with the OS instead. Also made sure that sure certbot gets installed when running zulip-puppet-apply, to handle existing systems.
23 lines
674 B
Bash
Executable File
23 lines
674 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
zulip_conf_get_boolean() {
|
|
# Get a boolean flag from zulip.conf, using the Python
|
|
# `configparser` library's conventions for what counts as true.
|
|
# Treat absent and invalid values as false.
|
|
value=$(crudini --get /etc/zulip/zulip.conf "$1" "$2" 2>/dev/null)
|
|
case "$(echo "$value" | tr '[:upper:]' '[:lower:]')" in
|
|
1|yes|true|on) return 0 ;;
|
|
*) return 1 ;;
|
|
esac
|
|
}
|
|
|
|
if ! zulip_conf_get_boolean certbot auto_renew; then
|
|
exit 0
|
|
fi
|
|
|
|
deploy_hook="${ZULIP_CERTBOT_DEPLOY_HOOK:-service nginx reload}"
|
|
|
|
certbot renew --quiet \
|
|
--webroot --webroot-path=/var/lib/zulip/certbot-webroot/ \
|
|
--deploy-hook "$deploy_hook"
|