mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-18 08:15:16 +01:00
commit
a44a399761
@ -85,6 +85,6 @@ crt_email = example@example.com
|
|||||||
|
|
||||||
|
|
||||||
#The path of cert and key files for nginx, they are applied only the protocol is set to https
|
#The path of cert and key files for nginx, they are applied only the protocol is set to https
|
||||||
ssl_cert = /path/to/server.crt
|
ssl_cert = /data/server.crt
|
||||||
ssl_cert_key = /path/to/server.key
|
ssl_cert_key = /data/server.key
|
||||||
#############
|
#############
|
||||||
|
@ -48,23 +48,22 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
#Handle http/https
|
#Handle http/https
|
||||||
protocal=http
|
protocol=http
|
||||||
echo "Read attribute using ovfenv: [ ssl_cert ]"
|
echo "Read attribute using ovfenv: [ ssl_cert ]"
|
||||||
ssl_cert=$(ovfenv -k ssl_cert)
|
ssl_cert=$(ovfenv -k ssl_cert)
|
||||||
echo "Read attribute using ovfenv: [ ssl_cert_key ]"
|
echo "Read attribute using ovfenv: [ ssl_cert_key ]"
|
||||||
ssl_cert_key=$(ovfenv -k ssl_cert_key)
|
ssl_cert_key=$(ovfenv -k ssl_cert_key)
|
||||||
if [ -n "$ssl_cert" ] && [ -n "$ssl_cert_key" ]
|
if [ -n "$ssl_cert" ] && [ -n "$ssl_cert_key" ]
|
||||||
then
|
then
|
||||||
echo "ssl_cert and ssl_cert_key are set, using HTTPS protocal"
|
echo "ssl_cert and ssl_cert_key are set, using HTTPS protocol"
|
||||||
protocal=https
|
protocol=https
|
||||||
sed -i -r s%"#?ui_url_protocol = .*"%"ui_url_protocol = $protocal"% $cfg
|
sed -i -r s%"#?ui_url_protocol = .*"%"ui_url_protocol = $protocol"% $cfg
|
||||||
mkdir -p /path/to
|
echo $ssl_cert > /data/server.crt
|
||||||
echo $ssl_cert > /path/to/server.crt
|
format /data/server.crt
|
||||||
format /path/to/server.crt
|
echo $ssl_cert_key > /data/server.key
|
||||||
echo $ssl_cert_key > /path/to/server.key
|
format /data/server.key
|
||||||
format /path/to/server.key
|
|
||||||
else
|
else
|
||||||
echo "ssl_cert and ssl_cert_key are not set, using HTTP protocal"
|
echo "ssl_cert and ssl_cert_key are not set, using HTTP protocol"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for attr in "${attrs[@]}"
|
for attr in "${attrs[@]}"
|
||||||
|
Loading…
Reference in New Issue
Block a user