2016-06-07 06:19:48 +02:00
|
|
|
#!/bin/bash
|
|
|
|
IP=`ip addr s eth0 |grep "inet "|awk '{print $2}' |awk -F "/" '{print $1}'`
|
2017-03-20 11:51:20 +01:00
|
|
|
PROTOCOL='https'
|
|
|
|
|
2016-06-15 06:57:04 +02:00
|
|
|
#echo $IP
|
2016-10-19 08:32:00 +02:00
|
|
|
sudo sed "s/reg.mydomain.com/$IP/" -i make/harbor.cfg
|
2018-09-19 11:49:43 +02:00
|
|
|
sudo sed "s/^ui_url_protocol = .*/ui_url_protocol = $PROTOCOL/g" -i make/harbor.cfg
|
|
|
|
|
|
|
|
if [ "$1" = 'LDAP' ]; then
|
|
|
|
sudo sed "s/db_auth/ldap_auth/" -i make/harbor.cfg
|
|
|
|
sudo sed "s/ldaps:\/\/ldap.mydomain.com/ldap:\/\/$IP/g" -i make/harbor.cfg
|
|
|
|
sudo sed "s/#ldap_searchdn = uid=searchuser,ou=people,dc=mydomain,dc=com/ldap_searchdn = cn=admin,dc=example,dc=com/" -i make/harbor.cfg
|
|
|
|
sudo sed "s/#ldap_search_pwd = password/ldap_search_pwd = admin/" -i make/harbor.cfg
|
|
|
|
sudo sed "s/ldap_basedn = ou=people,dc=mydomain,dc=com/ldap_basedn = dc=example,dc=com/" -i make/harbor.cfg
|
|
|
|
sudo sed "s/ldap_uid = uid/ldap_uid = cn/" -i make/harbor.cfg
|
|
|
|
fi
|