mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-22 08:38:03 +01:00
feat(certs): install internal tls ca from /etc/harbor/ssl dir
Closes #10222 Signed-off-by: He Weiwei <hweiwei@vmware.com>
This commit is contained in:
parent
2da29808ab
commit
13436b75a6
@ -2,30 +2,39 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
if ! grep -q "Photon" /etc/lsb-release; then
|
||||||
|
echo "Current OS is not Photon, skip appending ca bundle"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -f ~/ca-bundle.crt.original ]; then
|
if [ ! -f ~/ca-bundle.crt.original ]; then
|
||||||
cp /etc/pki/tls/certs/ca-bundle.crt ~/ca-bundle.crt.original
|
cp /etc/pki/tls/certs/ca-bundle.crt ~/ca-bundle.crt.original
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp ~/ca-bundle.crt.original /etc/pki/tls/certs/ca-bundle.crt
|
cp ~/ca-bundle.crt.original /etc/pki/tls/certs/ca-bundle.crt
|
||||||
|
|
||||||
if [ "$(ls -A /harbor_cust_cert)" ]; then
|
# Install /etc/harbor/ssl/{component}/ca.crt to trust CA.
|
||||||
if grep -q "Photon" /etc/lsb-release; then
|
echo "Appending internal tls trust CA to ca-bundle ..."
|
||||||
echo "Appending trust CA to ca-bundle ..."
|
for caFile in `find /etc/harbor/ssl -maxdepth 2 -name ca.crt`; do
|
||||||
for z in /harbor_cust_cert/*; do
|
cat $caFile >> /etc/pki/tls/certs/ca-bundle.crt
|
||||||
case ${z} in
|
echo "Internal tls trust CA $caFile appended ..."
|
||||||
*.crt | *.ca | *.ca-bundle | *.pem)
|
done
|
||||||
if [ -d "$z" ]; then
|
echo "Internal tls trust CA appending is Done."
|
||||||
echo "$z is dirictory, skip it ..."
|
|
||||||
else
|
if [[ -d /harbor_cust_cert && -n "$(ls -A /harbor_cust_cert)" ]]; then
|
||||||
cat $z >> /etc/pki/tls/certs/ca-bundle.crt
|
echo "Appending trust CA to ca-bundle ..."
|
||||||
echo " $z Appended ..."
|
for z in /harbor_cust_cert/*; do
|
||||||
fi
|
case ${z} in
|
||||||
;;
|
*.crt | *.ca | *.ca-bundle | *.pem)
|
||||||
*) echo "$z is Not ca file ..." ;;
|
if [ -d "$z" ]; then
|
||||||
esac
|
echo "$z is dirictory, skip it ..."
|
||||||
done
|
else
|
||||||
echo "CA appending is Done."
|
cat $z >> /etc/pki/tls/certs/ca-bundle.crt
|
||||||
else
|
echo " $z Appended ..."
|
||||||
echo "Current OS is not Photon, skip appending ca bundle"
|
fi
|
||||||
fi
|
;;
|
||||||
|
*) echo "$z is Not ca file ..." ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
echo "CA appending is Done."
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user