forked from mtusi2026/mtusi2026lab7
ops: add PKI and HTTPS ingress
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
umask 077
|
||||
|
||||
rm -rf /target/api/internal-ca /target/api/api
|
||||
mkdir -p /target/api/internal-ca /target/api/api
|
||||
cp /source/internal-ca/ca.crt /target/api/internal-ca/ca.crt
|
||||
cp /source/api/tls.crt /target/api/api/tls.crt
|
||||
cp /source/api/tls.key /target/api/api/tls.key
|
||||
chown -R 10001:10001 /target/api
|
||||
find /target/api -type d -exec chmod 0700 {} \;
|
||||
find /target/api -type f -exec chmod 0600 {} \;
|
||||
|
||||
rm -rf /target/nginx/ingress /target/nginx/public-ca /target/nginx/internal-ca /target/nginx/load-balancer
|
||||
mkdir -p /target/nginx/ingress /target/nginx/public-ca /target/nginx/internal-ca /target/nginx/load-balancer
|
||||
cp /source/ingress/tls.crt /target/nginx/ingress/tls.crt
|
||||
cp /source/ingress/tls.key /target/nginx/ingress/tls.key
|
||||
cp /source/public-ca/ca.crt /target/nginx/public-ca/ca.crt
|
||||
cp /source/internal-ca/ca.crt /target/nginx/internal-ca/ca.crt
|
||||
cp /source/load-balancer/tls.crt /target/nginx/load-balancer/tls.crt
|
||||
cp /source/load-balancer/tls.key /target/nginx/load-balancer/tls.key
|
||||
chown -R 0:0 /target/nginx
|
||||
find /target/nginx -type d -exec chmod 0700 {} \;
|
||||
find /target/nginx -type f -exec chmod 0600 {} \;
|
||||
|
||||
rm -rf /target/prometheus/internal-ca /target/prometheus/prometheus
|
||||
mkdir -p /target/prometheus/internal-ca /target/prometheus/prometheus
|
||||
cp /source/internal-ca/ca.crt /target/prometheus/internal-ca/ca.crt
|
||||
cp /source/prometheus/tls.crt /target/prometheus/prometheus/tls.crt
|
||||
cp /source/prometheus/tls.key /target/prometheus/prometheus/tls.key
|
||||
chown -R 65534:65534 /target/prometheus
|
||||
find /target/prometheus -type d -exec chmod 0700 {} \;
|
||||
find /target/prometheus -type f -exec chmod 0600 {} \;
|
||||
|
||||
rm -rf /target/client/public-ca
|
||||
mkdir -p /target/client/public-ca
|
||||
cp /source/public-ca/ca.crt /target/client/public-ca/ca.crt
|
||||
chown -R 10001:10001 /target/client
|
||||
find /target/client -type d -exec chmod 0700 {} \;
|
||||
find /target/client -type f -exec chmod 0600 {} \;
|
||||
Reference in New Issue
Block a user