-
Notifications
You must be signed in to change notification settings - Fork 39
418 lines (368 loc) · 19.3 KB
/
ca_handler_tests_cmp.yml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
name: CA handler tests - CMPv2
on:
push:
pull_request:
branches: [ devel ]
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 2 * * 6'
jobs:
cmp_handler_tests:
name: "cmp_handler_tests"
runs-on: ubuntu-latest
strategy:
max-parallel: 2
fail-fast: false
matrix:
websrv: ['apache2', 'nginx']
dbhandler: ['wsgi', 'django']
steps:
- name: "checkout GIT"
uses: actions/checkout@v4
- name: "Get runner ip"
run: |
echo RUNNER_IP=$(ip addr show eth0 | grep -i "inet " | cut -d ' ' -f 6 | cut -d '/' -f 1) >> $GITHUB_ENV
echo RUNNER_PATH=$(pwd | sed 's_/_\\/_g') >> $GITHUB_ENV
- run: echo "runner IP is ${{ env.RUNNER_IP }}"
- name: "Build container"
uses: ./.github/actions/container_prep
with:
DB_HANDLER: ${{ matrix.dbhandler }}
WEB_SRV: ${{ matrix.websrv }}
- name: "Create ssh environment on ramdisk"
run: |
sudo mkdir -p /tmp/rd
sudo mount -t tmpfs -o size=5M none /tmp/rd
sudo echo "$SSH_KEY" > /tmp/rd/ak.tmp
sudo chmod 600 /tmp/rd/ak.tmp
sudo echo "$KNOWN_HOSTS" > /tmp/rd/known_hosts
env:
SSH_KEY: ${{ secrets.WCCE_SSH_ACCESS_KEY }}
KNOWN_HOSTS: ${{ secrets.WCCE_SSH_KNOWN_HOSTS }}
- name: "Setup ssh forwarder"
run: |
docker run -d --rm --network acme --name=ssh-forwarder.acme -e "MAPPINGS=8086:$CMP_HOST:8086" -e "SSH_HOST=$SSH_HOST" -e "SSH_PORT=$SSH_PORT" -e "SSH_USER=$SSH_USER" -p 443:443 -p 445:445 -p 88:88 -v "/tmp/rd/ak.tmp:/ssh_key:ro" davidlor/ssh-port-forward-client:dev
env:
SSH_USER: ${{ secrets.CMP_SSH_USER }}
SSH_HOST: ${{ secrets.CMP_SSH_HOST }}
SSH_PORT: ${{ secrets.CMP_SSH_PORT }}
CMP_HOST: ${{ secrets.CMP_HOST }}
- name: "Setup a2c with cmp_ca_handler with key-cert authentication"
run: |
sudo touch examples/Docker/data/ca_bundle.pem
sudo touch examples/Docker/data/ra_cert.pem
sudo touch examples/Docker/data/ra_key.pem
sudo chmod 777 examples/Docker/data/*.pem
sudo echo "$CMP_TRUSTED" > examples/Docker/data/ca_bundle.pem
sudo echo "$CMP_RA_CERT" > examples/Docker/data/ra_cert.pem
sudo echo "$CMP_RA_KEY" > examples/Docker/data/ra_key.pem
sudo touch examples/Docker/data/acme_srv.cfg
sudo chmod 777 examples/Docker/data/acme_srv.cfg
sudo head -n -8 .github/openssl_ca_handler.py_acme_srv_default_handler.cfg > examples/Docker/data/acme_srv.cfg
sudo echo "handler_file: /var/www/acme2certifier/examples/ca_handler/cmp_ca_handler.py" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_path: pkix/" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_ignore_keyusage: True" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_msg_timeout: 3" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_total_timeout: 5" >> examples/Docker/data/acme_srv.cfg
# sudo echo "cmp_server: $RUNNER_IP:8086" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_server: ssh-forwarder.acme:8086" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_cert: volume/ra_cert.pem" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_key: volume/ra_key.pem" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_trusted: volume/ca_bundle.pem" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_recipient: $CMP_RECIPIENT" >> examples/Docker/data/acme_srv.cfg
cd examples/Docker/
docker-compose restart
env:
RUNNER_IP: ${{ env.RUNNER_IP }}
CMP_RECIPIENT: ${{ secrets.CMP_RECIPIENT }}
CMP_RA_KEY: ${{ secrets.CMP_RA_KEY }}
CMP_RA_CERT: ${{ secrets.CMP_RA_CERT }}
CMP_TRUSTED: ${{ secrets.CMP_TRUSTED }}
- name: "Sleep for 10s"
uses: juliangruber/[email protected]
with:
time: 10s
- name: "Test http://acme-srv/directory is accessible"
run: docker run -i --rm --network acme curlimages/curl -f http://acme-srv/directory
- name: "Test if https://acme-srv/directory is accessible"
run: docker run -i --rm --network acme curlimages/curl --insecure -f https://acme-srv/directory
- name: "Enroll acme.sh"
run: |
docker run --rm -i -v "$(pwd)/acme-sh":/acme.sh --network acme --name=acme-sh neilpang/acme.sh:latest --issue --server http://acme-srv --accountemail '[email protected]' -d acme-sh.acme --alpn --standalone --debug 3 --output-insecure --force
awk 'BEGIN {c=0;} /BEGIN CERT/{c++} { print > "cert-" c ".pem"}' < acme-sh/acme-sh.acme_ecc/ca.cer
openssl verify -CAfile cert-2.pem -untrusted cert-1.pem acme-sh/acme-sh.acme_ecc/acme-sh.acme.cer
sudo rm -rf acme-sh/*
- name: "Setup a2c with cmp_ca_handler with PSK refnum authentication"
run: |
sudo touch examples/Docker/data/ca_bundle.pem
sudo touch examples/Docker/data/ra_cert.pem
sudo chmod 777 examples/Docker/data/*.pem
sudo echo "$CMP_TRUSTED" > examples/Docker/data/ca_bundle.pem
sudo echo "$CMP_RA_CERT" > examples/Docker/data/ra_cert.pem
sudo touch examples/Docker/data/acme_srv.cfg
sudo chmod 777 examples/Docker/data/acme_srv.cfg
sudo head -n -8 .github/openssl_ca_handler.py_acme_srv_default_handler.cfg > examples/Docker/data/acme_srv.cfg
sudo echo "handler_file: /var/www/acme2certifier/examples/ca_handler/cmp_ca_handler.py" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_path: pkix/" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_ignore_keyusage: True" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_msg_timeout: 3" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_total_timeout: 5" >> examples/Docker/data/acme_srv.cfg
# sudo echo "cmp_server: $RUNNER_IP:8086" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_server: ssh-forwarder.acme:8086" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_cert: volume/ra_cert.pem" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_trusted: volume/ca_bundle.pem" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_recipient: $CMP_RECIPIENT" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_ref: $CMP_REF" >> examples/Docker/data/acme_srv.cfg
sudo echo "cmp_secret: $CMP_SECRET" >> examples/Docker/data/acme_srv.cfg
cd examples/Docker/
docker-compose restart
env:
RUNNER_IP: ${{ env.RUNNER_IP }}
CMP_RECIPIENT: ${{ secrets.CMP_RECIPIENT }}
CMP_RA_CERT: ${{ secrets.CMP_RA_CERT }}
CMP_TRUSTED: ${{ secrets.CMP_TRUSTED }}
CMP_REF: ${{ secrets.CMP_REF }}
CMP_SECRET: ${{ secrets.CMP_SECRET }}
- name: "Sleep for 10s"
uses: juliangruber/[email protected]
with:
time: 10s
- name: "Sleep for 10s"
uses: juliangruber/[email protected]
with:
time: 10s
- name: "Test http://acme-srv/directory is accessible"
run: docker run -i --rm --network acme curlimages/curl -f http://acme-srv/directory
- name: "Test if https://acme-srv/directory is accessible"
run: docker run -i --rm --network acme curlimages/curl --insecure -f https://acme-srv/directory
- name: "Enroll acme.sh"
run: |
docker run --rm -i -v "$(pwd)/acme-sh":/acme.sh --network acme --name=acme-sh neilpang/acme.sh:latest --issue --server http://acme-srv --accountemail '[email protected]' -d acme-sh.acme --alpn --standalone --debug 3 --output-insecure --force
awk 'BEGIN {c=0;} /BEGIN CERT/{c++} { print > "cert-" c ".pem"}' < acme-sh/acme-sh.acme_ecc/ca.cer
openssl verify -CAfile cert-2.pem -untrusted cert-1.pem acme-sh/acme-sh.acme_ecc/acme-sh.acme.cer
- name: "Check container configuration"
uses: ./.github/actions/container_check
with:
DB_HANDLER: ${{ matrix.dbhandler }}
WEB_SRV: ${{ matrix.websrv }}
- name: "[ * ] collecting test logs"
if: ${{ failure() }}
run: |
mkdir -p ${{ github.workspace }}/artifact/upload
sudo cp -rp examples/Docker/data/ ${{ github.workspace }}/artifact/data/
sudo cp -rp acme-sh/ ${{ github.workspace }}/artifact/acme-sh/
sudo cp -rp certbot/ ${{ github.workspace }}/artifact/certbot/
sudo cp -rp lego/ ${{ github.workspace }}/artifact/lego/
cd examples/Docker
docker-compose logs > ${{ github.workspace }}/artifact/docker-compose.log
sudo tar -C ${{ github.workspace }}/artifact/ -cvzf ${{ github.workspace }}/artifact/upload/artifact.tar.gz docker-compose.log data acme-sh certbot lego
- name: "[ * ] uploading artificates"
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: cmp_handler_tests-${{ matrix.websrv }}-${{ matrix.dbhandler }}.tar.gz.tar.gz
path: ${{ github.workspace }}/artifact/upload/
rpm_cmp_handler_tests_keycert:
name: "rpm_cmp_handler_tests_keycert"
runs-on: ubuntu-latest
steps:
- name: "checkout GIT"
uses: actions/checkout@v4
- name: "Prepare Alma environment"
uses: ./.github/actions/rpm_prep
with:
GH_SBOM_USER: ${{ secrets.GH_SBOM_USER }}
GH_SBOM_TOKEN: ${{ secrets.GH_SBOM_TOKEN }}
RH_VERSION: 9
- name: "Get runner ip"
run: |
echo RUNNER_IP=$(ip addr show eth0 | grep -i "inet " | cut -d ' ' -f 6 | cut -d '/' -f 1) >> $GITHUB_ENV
echo RUNNER_PATH=$(pwd | sed 's_/_\\/_g') >> $GITHUB_ENV
- run: echo "runner IP is ${{ env.RUNNER_IP }}"
- name: "Create ssh environment on ramdisk"
run: |
sudo mkdir -p /tmp/rd
sudo mount -t tmpfs -o size=5M none /tmp/rd
sudo echo "$SSH_KEY" > /tmp/rd/ak.tmp
sudo chmod 600 /tmp/rd/ak.tmp
sudo echo "$KNOWN_HOSTS" > /tmp/rd/known_hosts
env:
SSH_KEY: ${{ secrets.WCCE_SSH_ACCESS_KEY }}
KNOWN_HOSTS: ${{ secrets.WCCE_SSH_KNOWN_HOSTS }}
- name: "Setup ssh forwarder"
run: |
docker run -d --rm --network acme --name=ssh-forwarder.acme -e "MAPPINGS=8086:$CMP_HOST:8086" -e "SSH_HOST=$SSH_HOST" -e "SSH_PORT=$SSH_PORT" -e "SSH_USER=$SSH_USER" -p 443:443 -p 445:445 -p 88:88 -v "/tmp/rd/ak.tmp:/ssh_key:ro" davidlor/ssh-port-forward-client:dev
env:
SSH_USER: ${{ secrets.CMP_SSH_USER }}
SSH_HOST: ${{ secrets.CMP_SSH_HOST }}
SSH_PORT: ${{ secrets.CMP_SSH_PORT }}
CMP_HOST: ${{ secrets.CMP_HOST }}
- name: "Sleep for 5s"
uses: juliangruber/[email protected]
with:
time: 5s
- name: "Setup a2c with cmp_ca_handler"
run: |
sudo mkdir data/acme_ca
sudo cp test/ca/root-ca-cert.pem data/acme_ca
sudo cp test/ca/sub-ca-cert.pem data/acme_ca
sudo touch data/acme_ca/ca_bundle.pem
sudo touch data/acme_ca/ra_cert.pem
sudo touch data/acme_ca/ra_key.pem
sudo chmod 777 data/acme_ca/*.pem
sudo echo "$CMP_TRUSTED" > data/acme_ca/ca_bundle.pem
sudo echo "$CMP_RA_CERT" > data/acme_ca/ra_cert.pem
sudo echo "$CMP_RA_KEY" > data/acme_ca/ra_key.pem
sudo touch data/acme_srv.cfg
sudo chmod 777 data/acme_srv.cfg
sudo head -n -8 .github/openssl_ca_handler.py_acme_srv_default_handler.cfg > data/acme_srv.cfg
sudo echo "handler_file: /opt/acme2certifier/examples/ca_handler/cmp_ca_handler.py" >> data/acme_srv.cfg
sudo echo "cmp_path: pkix/" >> data/acme_srv.cfg
sudo echo "cmp_ignore_keyusage: True" >> data/acme_srv.cfg
sudo echo "cmp_msg_timeout: 3" >> data/acme_srv.cfg
sudo echo "cmp_total_timeout: 5" >> data/acme_srv.cfg
sudo echo "cmp_server: ssh-forwarder.acme:8086" >> data/acme_srv.cfg
sudo echo "cmp_cert: /opt/acme2certifier/volume/acme_ca/ra_cert.pem" >> data/acme_srv.cfg
sudo echo "cmp_key: /opt/acme2certifier/volume/acme_ca/ra_key.pem" >> data/acme_srv.cfg
sudo echo "cmp_trusted: /opt/acme2certifier/volume/acme_ca/ca_bundle.pem" >> data/acme_srv.cfg
sudo echo "cmp_recipient: $CMP_RECIPIENT" >> data/acme_srv.cfg
env:
RUNNER_IP: ${{ env.RUNNER_IP }}
CMP_RECIPIENT: ${{ secrets.CMP_RECIPIENT }}
CMP_RA_KEY: ${{ secrets.CMP_RA_KEY }}
CMP_RA_CERT: ${{ secrets.CMP_RA_CERT }}
CMP_TRUSTED: ${{ secrets.CMP_TRUSTED }}
- name: "Execute install scipt"
run: |
docker exec acme-srv sh /tmp/acme2certifier/rpm_tester.sh
- name: "Sleep for 10s"
uses: juliangruber/[email protected]
with:
time: 10s
- name: "Test http://acme-srv/directory is accessible"
run: docker run -i --rm --network acme curlimages/curl -f http://acme-srv/directory
- name: "Test if https://acme-srv/directory is accessible"
run: docker run -i --rm --network acme curlimages/curl --insecure -f https://acme-srv/directory
- name: "Enroll acme.sh"
run: |
docker run --rm -i -v "$(pwd)/acme-sh":/acme.sh --network acme --name=acme-sh neilpang/acme.sh:latest --issue --server http://acme-srv --accountemail '[email protected]' -d acme-sh.acme --alpn --standalone --debug 3 --output-insecure --force
awk 'BEGIN {c=0;} /BEGIN CERT/{c++} { print > "cert-" c ".pem"}' < acme-sh/acme-sh.acme_ecc/ca.cer
openssl verify -CAfile cert-2.pem -untrusted cert-1.pem acme-sh/acme-sh.acme_ecc/acme-sh.acme.cer
- name: "[ * ] collecting test logs"
if: ${{ failure() }}
run: |
mkdir -p ${{ github.workspace }}/artifact/upload
docker exec acme-srv tar cvfz /tmp/acme2certifier/a2c.tgz /opt/acme2certifier
sudo cp -rp data/ ${{ github.workspace }}/artifact/data/
sudo rm ${{ github.workspace }}/artifact/data/*.rpm
sudo cp -rp acme-sh/ ${{ github.workspace }}/artifact/acme-sh/
docker exec acme-srv cat /var/log/messages > ${{ github.workspace }}/artifact/acme-srv.log
sudo tar -C ${{ github.workspace }}/artifact/ -cvzf ${{ github.workspace }}/artifact/upload/artifact.tar.gz data acme-srv.log acme-sh
- name: "[ * ] uploading artificates"
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: rpm_cmp_handler_tests_keycert.tar.gz
path: ${{ github.workspace }}/artifact/upload/
rpm_cmp_handler_tests_refpsk:
name: "rpm_cmp_handler_tests_refpsk"
runs-on: ubuntu-latest
steps:
- name: "checkout GIT"
uses: actions/checkout@v4
- name: "Prepare Alma environment"
uses: ./.github/actions/rpm_prep
with:
GH_SBOM_USER: ${{ secrets.GH_SBOM_USER }}
GH_SBOM_TOKEN: ${{ secrets.GH_SBOM_TOKEN }}
RH_VERSION: 9
- name: "Get runner ip"
run: |
echo RUNNER_IP=$(ip addr show eth0 | grep -i "inet " | cut -d ' ' -f 6 | cut -d '/' -f 1) >> $GITHUB_ENV
echo RUNNER_PATH=$(pwd | sed 's_/_\\/_g') >> $GITHUB_ENV
- run: echo "runner IP is ${{ env.RUNNER_IP }}"
- name: "Create ssh environment on ramdisk"
run: |
sudo mkdir -p /tmp/rd
sudo mount -t tmpfs -o size=5M none /tmp/rd
sudo echo "$SSH_KEY" > /tmp/rd/ak.tmp
sudo chmod 600 /tmp/rd/ak.tmp
sudo echo "$KNOWN_HOSTS" > /tmp/rd/known_hosts
env:
SSH_KEY: ${{ secrets.WCCE_SSH_ACCESS_KEY }}
KNOWN_HOSTS: ${{ secrets.WCCE_SSH_KNOWN_HOSTS }}
- name: "Setup ssh forwarder"
run: |
docker run -d --rm --network acme --name=ssh-forwarder.acme -e "MAPPINGS=8086:$CMP_HOST:8086" -e "SSH_HOST=$SSH_HOST" -e "SSH_PORT=$SSH_PORT" -e "SSH_USER=$SSH_USER" -p 443:443 -p 445:445 -p 88:88 -v "/tmp/rd/ak.tmp:/ssh_key:ro" davidlor/ssh-port-forward-client:dev
env:
SSH_USER: ${{ secrets.CMP_SSH_USER }}
SSH_HOST: ${{ secrets.CMP_SSH_HOST }}
SSH_PORT: ${{ secrets.CMP_SSH_PORT }}
CMP_HOST: ${{ secrets.CMP_HOST }}
- name: "[ PREPARE ] Sleep for 5s"
uses: juliangruber/[email protected]
with:
time: 5s
- name: "Setup a2c with cmp_ca_handler"
run: |
sudo mkdir data/acme_ca
sudo cp test/ca/root-ca-cert.pem data/acme_ca
sudo cp test/ca/sub-ca-cert.pem data/acme_ca
sudo touch data/acme_ca/ca_bundle.pem
sudo touch data/acme_ca/ra_cert.pem
sudo chmod 777 data/acme_ca/*.pem
sudo echo "$CMP_TRUSTED" > data/acme_ca/ca_bundle.pem
sudo echo "$CMP_RA_CERT" > data/acme_ca/ra_cert.pem
sudo touch data/acme_srv.cfg
sudo chmod 777 data/acme_srv.cfg
sudo head -n -8 .github/openssl_ca_handler.py_acme_srv_default_handler.cfg > data/acme_srv.cfg
sudo echo "handler_file: /opt/acme2certifier/examples/ca_handler/cmp_ca_handler.py" >> data/acme_srv.cfg
sudo echo "cmp_path: pkix/" >> data/acme_srv.cfg
sudo echo "cmp_ignore_keyusage: True" >> data/acme_srv.cfg
sudo echo "cmp_msg_timeout: 3" >> data/acme_srv.cfg
sudo echo "cmp_total_timeout: 5" >> data/acme_srv.cfg
sudo echo "cmp_server: ssh-forwarder.acme:8086" >> data/acme_srv.cfg
sudo echo "cmp_cert: /opt/acme2certifier/volume/acme_ca/ra_cert.pem" >> data/acme_srv.cfg
sudo echo "cmp_trusted: /opt/acme2certifier/volume/acme_ca/ca_bundle.pem" >> data/acme_srv.cfg
sudo echo "cmp_recipient: $CMP_RECIPIENT" >> data/acme_srv.cfg
sudo echo "cmp_ref: $CMP_REF" >> data/acme_srv.cfg
sudo echo "cmp_secret: $CMP_SECRET" >> data/acme_srv.cfg
env:
RUNNER_IP: ${{ env.RUNNER_IP }}
CMP_RECIPIENT: ${{ secrets.CMP_RECIPIENT }}
CMP_RA_CERT: ${{ secrets.CMP_RA_CERT }}
CMP_TRUSTED: ${{ secrets.CMP_TRUSTED }}
CMP_REF: ${{ secrets.CMP_REF }}
CMP_SECRET: ${{ secrets.CMP_SECRET }}
- name: "Execute install scipt"
run: |
docker exec acme-srv sh /tmp/acme2certifier/rpm_tester.sh
- name: "Sleep for 10s"
uses: juliangruber/[email protected]
with:
time: 10s
- name: "Test http://acme-srv/directory is accessible"
run: docker run -i --rm --network acme curlimages/curl -f http://acme-srv/directory
- name: "Test if https://acme-srv/directory is accessible"
run: docker run -i --rm --network acme curlimages/curl --insecure -f https://acme-srv/directory
- name: "Enroll acme.sh"
run: |
docker run --rm -i -v "$(pwd)/acme-sh":/acme.sh --network acme --name=acme-sh neilpang/acme.sh:latest --issue --server http://acme-srv --accountemail '[email protected]' -d acme-sh.acme --alpn --standalone --debug 3 --output-insecure --force
awk 'BEGIN {c=0;} /BEGIN CERT/{c++} { print > "cert-" c ".pem"}' < acme-sh/acme-sh.acme_ecc/ca.cer
openssl verify -CAfile cert-2.pem -untrusted cert-1.pem acme-sh/acme-sh.acme_ecc/acme-sh.acme.cer
- name: "[ * ] collecting test logs"
if: ${{ failure() }}
run: |
mkdir -p ${{ github.workspace }}/artifact/upload
docker exec acme-srv tar cvfz /tmp/acme2certifier/a2c.tgz /opt/acme2certifier
sudo cp -rp data/ ${{ github.workspace }}/artifact/data/
sudo rm ${{ github.workspace }}/artifact/data/*.rpm
sudo cp -rp acme-sh/ ${{ github.workspace }}/artifact/acme-sh/
docker exec acme-srv cat /var/log/messages > ${{ github.workspace }}/artifact/acme-srv.log
sudo tar -C ${{ github.workspace }}/artifact/ -cvzf ${{ github.workspace }}/artifact/upload/artifact.tar.gz data acme-srv.log acme-sh
- name: "[ * ] uploading artificates"
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: rpm_cmp_handler_tests_refpsk.tar_rpm.gz
path: ${{ github.workspace }}/artifact/upload/