packerTestpipe
This commit is contained in:
@ -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
|
|
33
.gitea/workflows/packer.yaml
Normal file
33
.gitea/workflows/packer.yaml
Normal 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
|
Reference in New Issue
Block a user