packerTestpipe

This commit is contained in:
martin.cholewa
2025-06-20 10:39:50 +02:00
parent f0f6cc65d2
commit 86a6c0c790
2 changed files with 33 additions and 12 deletions

View File

@ -1,12 +0,0 @@
jobs:
Check-Cert:
runs-on: ubuntu-latest
steps:
- name: Ověření platnosti certifikátu chosesoft.eu
run: |
if echo | openssl s_client -servername chosesoft.eu -connect chosesoft.eu:443 2>/dev/null | openssl x509 -noout -checkend 0; then
echo "✅ Certifikát je stále platný"
else
echo "❌ Certifikát už není platný"
exit 1
fi

View File

@ -0,0 +1,33 @@
name: Check Certificates Expiry
on:
workflow_dispatch:
jobs:
check_certs:
runs-on: ubuntu-latest
steps:
- name: Display certificate expiry dates
run: |
for host in chosesoft.eu nas.chosesoft.eu gitea.chosesoft.eu; do
echo "🔍 Certificate for $host:"
expiry_date=$(echo | openssl s_client -servername "$host" -connect "$host:443" 2>/dev/null \
| openssl x509 -noout -enddate | cut -d= -f2)
if [ -z "$expiry_date" ]; then
echo "❌ Unable to fetch certificate for $host"
echo
continue
fi
expiry_ts=$(date -d "$expiry_date" +%s)
now_ts=$(date +%s)
if [ "$expiry_ts" -gt "$now_ts" ]; then
echo "✅ Valid until: $expiry_date"
else
echo "❌ Expired on: $expiry_date"
fi
echo
done