mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-05-17 12:26:55 +02:00
added workaround for use with advanced filesystem ACLs (as originally suggested in #467)
This commit is contained in:
+12
-5
@@ -340,7 +340,10 @@ init_system() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "+ Generating account key..."
|
echo "+ Generating account key..."
|
||||||
_openssl genrsa -out "${ACCOUNT_KEY}" "${KEYSIZE}"
|
local tmp_account_key="$(_mktemp)"
|
||||||
|
_openssl genrsa -out "${tmp_account_key}" "${KEYSIZE}"
|
||||||
|
cat "${tmp_account_key}" > "${ACCOUNT_KEY}"
|
||||||
|
rm "${tmp_account_key}"
|
||||||
register_new_key="yes"
|
register_new_key="yes"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -929,10 +932,13 @@ sign_domain() {
|
|||||||
if [[ ! -r "${certdir}/privkey.pem" ]] || [[ "${PRIVATE_KEY_RENEW}" = "yes" ]]; then
|
if [[ ! -r "${certdir}/privkey.pem" ]] || [[ "${PRIVATE_KEY_RENEW}" = "yes" ]]; then
|
||||||
echo " + Generating private key..."
|
echo " + Generating private key..."
|
||||||
privkey="privkey-${timestamp}.pem"
|
privkey="privkey-${timestamp}.pem"
|
||||||
|
local tmp_privkey="$(_mktemp)"
|
||||||
case "${KEY_ALGO}" in
|
case "${KEY_ALGO}" in
|
||||||
rsa) _openssl genrsa -out "${certdir}/privkey-${timestamp}.pem" "${KEYSIZE}";;
|
rsa) _openssl genrsa -out "${tmp_privkey}" "${KEYSIZE}";;
|
||||||
prime256v1|secp384r1) _openssl ecparam -genkey -name "${KEY_ALGO}" -out "${certdir}/privkey-${timestamp}.pem";;
|
prime256v1|secp384r1) _openssl ecparam -genkey -name "${KEY_ALGO}" -out "${tmp_privkey}";;
|
||||||
esac
|
esac
|
||||||
|
cat "${tmp_privkey}" > "${certdir}/privkey-${timestamp}.pem"
|
||||||
|
rm "${tmp_privkey}"
|
||||||
fi
|
fi
|
||||||
# move rolloverkey into position (if any)
|
# move rolloverkey into position (if any)
|
||||||
if [[ -r "${certdir}/privkey.pem" && -r "${certdir}/privkey.roll.pem" && "${PRIVATE_KEY_RENEW}" = "yes" && "${PRIVATE_KEY_ROLLOVER}" = "yes" ]]; then
|
if [[ -r "${certdir}/privkey.pem" && -r "${certdir}/privkey.roll.pem" && "${PRIVATE_KEY_RENEW}" = "yes" && "${PRIVATE_KEY_ROLLOVER}" = "yes" ]]; then
|
||||||
@@ -1005,8 +1011,9 @@ sign_domain() {
|
|||||||
tmpchain="$(_mktemp)"
|
tmpchain="$(_mktemp)"
|
||||||
awk '{print >out}; /----END CERTIFICATE-----/{out=tmpchain}' out="${tmpcert}" tmpchain="${tmpchain}" "${certdir}/cert-${timestamp}.pem"
|
awk '{print >out}; /----END CERTIFICATE-----/{out=tmpchain}' out="${tmpcert}" tmpchain="${tmpchain}" "${certdir}/cert-${timestamp}.pem"
|
||||||
mv "${certdir}/cert-${timestamp}.pem" "${certdir}/fullchain-${timestamp}.pem"
|
mv "${certdir}/cert-${timestamp}.pem" "${certdir}/fullchain-${timestamp}.pem"
|
||||||
mv "${tmpcert}" "${certdir}/cert-${timestamp}.pem"
|
cat "${tmpcert}" > "${certdir}/cert-${timestamp}.pem"
|
||||||
mv "${tmpchain}" "${certdir}/chain-${timestamp}.pem"
|
cat "${tmpchain}" > "${certdir}/chain-${timestamp}.pem"
|
||||||
|
rm "${tmpcert}" "${tmpchain}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Update symlinks
|
# Update symlinks
|
||||||
|
|||||||
Reference in New Issue
Block a user