mirror of
https://github.com/logos-messaging/logos-messaging-nim-compose.git
synced 2026-02-16 22:13:17 +00:00
make sure openssl is installed in node apk when wss
This commit is contained in:
parent
08be7d0a44
commit
d26ba09d04
@ -56,6 +56,8 @@ fi
|
||||
if [ -n "${DOMAIN}" ]; then
|
||||
## A domain has been either set or inferred. Let's try to use it for websocket secure support.
|
||||
|
||||
apk add --no-cache openssl
|
||||
|
||||
LETSENCRYPT_PATH="/etc/letsencrypt/live/${DOMAIN}"
|
||||
CERT="${LETSENCRYPT_PATH}/fullchain.pem"
|
||||
KEY="${LETSENCRYPT_PATH}/privkey.pem"
|
||||
@ -63,12 +65,10 @@ if [ -n "${DOMAIN}" ]; then
|
||||
echo "[INFO] Waiting for a valid TLS certificate for ${DOMAIN}..."
|
||||
|
||||
while true; do
|
||||
MIN_VALIDITY=3600 # 1 hour
|
||||
|
||||
if [ ! -f "${CERT}" ] || [ ! -f "${KEY}" ]; then
|
||||
echo "[INFO] Certificate files not found yet. Waiting..."
|
||||
elif ! openssl x509 -checkend "${MIN_VALIDITY}" -noout -in "${CERT}" >/dev/null 2>&1; then
|
||||
echo "[WARN] Certificate is invalid, expired, or expiring soon. Waiting..."
|
||||
elif ! openssl x509 -checkend 0 -noout -in "${CERT}" >/dev/null 2>&1; then
|
||||
echo "[WARN] Certificate exists but is expired. Waiting for renewal..."
|
||||
else
|
||||
echo "[INFO] Valid TLS certificate detected."
|
||||
break
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user