Skip to content

Commit 130ca6e

Browse files
committed
modify tls-gen to also copy the ca certificate to the workflow directory
this simplifies the compose file Signed-off-by: Rui Lopes <[email protected]>
1 parent 0b64c0e commit 130ca6e

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

deploy/compose/docker-compose.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,6 @@ services:
5959
registry:
6060
condition: service_healthy
6161

62-
# registry ca.crt download
63-
registry-ca-crt-download:
64-
image: alpine
65-
entrypoint: wget
66-
working_dir: /code
67-
command: ["http://$TINKERBELL_HOST_IP:42114/cert", "-O", "ca.pem"]
68-
volumes:
69-
- ${REPO_TOP_LEVEL:-.}/state/webroot/workflow:/code
70-
depends_on:
71-
tink-server:
72-
condition: service_healthy
73-
db:
74-
condition: service_healthy
75-
7662
# Create hardware, template, and workflow records in tink-server
7763
create-tink-records:
7864
image: ${TINK_CLI_IMAGE}

deploy/compose/tls/generate.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/usr/bin/env bash
22
# This script handles the generation of the TLS certificates.
3-
# The output is 4 files:
3+
# This generates the files:
44
# 1. /certs/${FACILITY:-onprem}/ca-crt.pem (CA TLS public certificate)
55
# 2. /certs/${FACILITY:-onprem}/server-crt.pem (server TLS certificate)
66
# 3. /certs/${FACILITY:-onprem}/server-key.pem (server TLS private key)
77
# 4. /certs/${FACILITY:-onprem}/bundle.pem (server TLS certificate; backward compat)
8+
# 5. /code/state/webroot/workflow/ca.pem (CA TLS public certificate)
89

9-
set -xo pipefail
10+
set -euxo pipefail
1011

1112
# update_csr will add the sans_ip, as a valid host domain in the csr
1213
update_csr() {
@@ -36,6 +37,7 @@ gen() {
3637
main() {
3738
local sans_ip="$1"
3839
local csr_file="/code/tls/csr.json"
40+
local ca_crt_workflow_file="/code/state/webroot/workflow/ca.pem"
3941
local ca_crt_file="/certs/${FACILITY:-onprem}/ca-crt.pem"
4042
local server_crt_file="/certs/${FACILITY:-onprem}/server-crt.pem"
4143
local server_key_file="/certs/${FACILITY:-onprem}/server-key.pem"
@@ -55,6 +57,11 @@ main() {
5557
else
5658
echo "Files [${ca_crt_file}, ${server_crt_file}, ${server_key_file}] already exist"
5759
fi
60+
if [ ! -f "${ca_crt_workflow_file}" ]; then
61+
cp "${ca_crt_file}" "${ca_crt_workflow_file}"
62+
else
63+
echo "File ${ca_crt_workflow_file} already exist"
64+
fi
5865
cleanup
5966
}
6067

0 commit comments

Comments
 (0)