Skip to content

Commit e80b5a7

Browse files
authored
Merge pull request #502 from dduportal/chore/updatecli/fix-cert-expiration
chore(updatecli) fix and improvement of the openvpn-cert-expiration manifest
2 parents ec7f428 + af89eb7 commit e80b5a7

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

updatecli/scripts/cert-expiry-check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# Check if certificate expires within 30 days
3-
set -eu -o pipefail
3+
set -eux -o pipefail
44

55
currentexpirydate="${1}"
66

updatecli/updatecli.d/openvpn-cert-expiration.tpl renamed to updatecli/updatecli.d/cert-expiration.tpl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{{- range $username := splitList "," .certificates }}
22
---
3-
# yamllint disable rule:line-length
43
name: "Check VPN certificate expiration for {{ $username }}"
54

65
scms:
@@ -19,9 +18,7 @@ sources:
1918
name: "Extract expiration date from {{ $username }}'s certificate"
2019
kind: shell
2120
spec:
22-
command: bash ./updatecli/scripts/cert-expiry-extract.sh cert/pki/issued/{{ $username }}.crt
23-
environments:
24-
- name: PATH
21+
command: bash ./updatecli/scripts/cert-expiry-extract.sh cert/pki/issued/{{ $username }}.crt x509
2522

2623
conditions:
2724
checkIfExpiringSoon:
@@ -30,15 +27,14 @@ conditions:
3027
sourceid: certExpiryDate
3128
spec:
3229
command: bash ./updatecli/scripts/cert-expiry-check.sh
33-
environments:
34-
- name: PATH
3530

3631
targets:
3732
markCertExpiring:
3833
name: "Mark {{ $username }}'s certificate as expiring"
3934
kind: file
35+
disablesourceinput: true
4036
spec:
41-
file: cert/pki/issued/{{ $username }}.crt.expiring
37+
file: cert/pki/issued/{{ $username }}.crt
4238
content: |
4339
Certificate for {{ $username }} expires on {{ source "certExpiryDate" }}.
4440
Please renew your VPN certificate as soon as possible.
@@ -63,7 +59,6 @@ actions:
6359
**Note:** This is an automated notification PR.
6460
It is not meant to be merged and can be closed once acknowledged.
6561
labels:
66-
- vpn
6762
- certificate-expiration
6863
- action-required
6964
{{- end }}

0 commit comments

Comments
 (0)