If using Let's Encrypt certificates, the max lifetime is 3 months, so it'll
show green if the expiration is >2 months out, yellow if it's >1.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>
done
done
+# Sets TLS certificate expiration thresholds
+TLS_EXPIRATION_YELLOW=5184000 # > 2 months
+TLS_EXPIRATION_GREEN=15552000 # > 6 months
+if [[ "${SSL_MODE}" == "lets-encrypt" ]]; then
+ TLS_EXPIRATION_YELLOW=2592000 # > 1 months
+ TLS_EXPIRATION_GREEN=5184000 # > 2 months
+fi
+
# Auto-detects load-balancing mode
if [ -z "${ROLE2NODES['balancer']:-}" ]; then
ENABLE_BALANCER="no"
},
{
"color": "semi-dark-yellow",
- "value": 12096000
+ "value": __TLS_EXPIRATION_YELLOW__
},
{
"color": "semi-dark-green",
- "value": 25920000
+ "value": __TLS_EXPIRATION_GREEN__
}
]
}
# "ArvadosPromDataSource" is the hardcoded UID for Prometheus' datasource
# in Grafana.
for f in $(ls "${GRAFANA_DASHBOARDS_DIR}"/*.json); do
- sed 's#${DS_PROMETHEUS}#ArvadosPromDataSource#g' \
+ sed "s#__TLS_EXPIRATION_YELLOW__#${TLS_EXPIRATION_YELLOW}#g;
+ s#__TLS_EXPIRATION_GREEN__#${TLS_EXPIRATION_GREEN}#g;
+ s#\${DS_PROMETHEUS}#ArvadosPromDataSource#g" \
"${f}" > "${GRAFANA_DASHBOARDS_DEST_DIR}"/$(basename "${f}")
done