-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup-certs
executable file
·31 lines (28 loc) · 785 Bytes
/
setup-certs
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
#!/bin/bash
# setup traefik certs
if [ -f traefik/certs/host.cert ]; then
exit 0
fi
mkdir -p traefik/certs traefik/config
(
cd traefik/certs
openssl genrsa -out host.key 2048
openssl req -new -key host.key -out host.csr -subj "/C=US/ST=New York/L=New York/O=Columbia University/OU=IT/CN=localhost"
openssl x509 -req -days 3650 -in host.csr -signkey host.key -out host.cert
openssl x509 -noout -fingerprint -text < host.cert > host.info
)
(
cd traefik/config
cat >traefik.toml <<EOF
debug = false
logLevel = "ERROR"
defaultEntryPoints = ["https"]
[entryPoints]
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[[entryPoints.https.tls.certificates]]
certFile = "/certs/host.cert"
keyFile = "/certs/host.key"
EOF
)