-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path80_status.sh
More file actions
executable file
·43 lines (37 loc) · 1.88 KB
/
80_status.sh
File metadata and controls
executable file
·43 lines (37 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
set -euo pipefail
source ./90_lib.sh; load_env
first_creds(){ # $1 = plain file path; echoes user:pass or empty
local f="$1"; [[ -f "$f" ]] && head -n1 "$f" | tr -d '
' || true
}
log "Versions"; nginx -v 2>&1 || true; certbot --version || true
log "Open ports (nginx, turn)"; ss -luntp | awk 'NR==1 || /:80 |:443 |:3478|:5349/' || true
if [[ "${VDO_ENABLE}" == "true" ]]; then
log "VDO: ${VDO_DOMAIN}"; report_cert "${VDO_DOMAIN}" || true
info "HTTP: $(curl_head https://${VDO_DOMAIN})"
if [[ "${VDO_AUTH_ENABLE:-false}" == "true" ]]; then
CREDS=$(first_creds /etc/nginx/.htpasswd-vdo.plain || true)
[[ -n "$CREDS" ]] && info "HTTP (auth): $(curl -skI -u "$CREDS" https://${VDO_DOMAIN} | head -n1)" || true
fi
fi
if [[ "${TURN_ENABLE}" == "true" ]]; then
log "TURN: ${TURN_DOMAIN}"; systemctl status coturn --no-pager --lines=0 || true
info "TLS: $(echo | openssl s_client -connect ${TURN_DOMAIN}:5349 -servername ${TURN_DOMAIN} 2>/dev/null | openssl x509 -noout -subject -issuer -enddate || true)"
fi
if [[ "${BBOX_ENABLE}" == "true" ]]; then
log "BBox: ${BBOX_DOMAIN}"; report_cert "${BBOX_DOMAIN}" || true
info "HTTP: $(curl_head https://${BBOX_DOMAIN})"
if [[ "${BBOX_AUTH_ENABLE:-false}" == "true" ]]; then
CREDS=$(first_creds /etc/nginx/.htpasswd-bbox.plain || true)
[[ -n "$CREDS" ]] && info "HTTP (auth): $(curl -skI -u "$CREDS" https://${BBOX_DOMAIN} | head -n1)" || true
fi
fi
if [[ "${MON_ENABLE}" == "true" ]]; then
log "Grafana: ${MON_DOMAIN}"; systemctl status grafana-server --no-pager --lines=0 || true; report_cert "${MON_DOMAIN}" || true
info "HTTP: $(curl_head https://${MON_DOMAIN}/login)"
if [[ "${MON_AUTH_ENABLE:-false}" == "true" ]]; then
CREDS=$(first_creds /etc/nginx/.htpasswd-grafana.plain || true)
[[ -n "$CREDS" ]] && info "HTTP (auth): $(curl -skI -u "$CREDS" https://${MON_DOMAIN}/login | head -n1)" || true
fi
fi