Skip to content

Commit

Permalink
Add internal no proxy and keep custom.config (#2478)
Browse files Browse the repository at this point in the history
custom.config is for user 's customized configurations and should
not be overwritten. Use it as the base context of config.properties
and append auto generated configurations.

localhost, 127.0.0.1, ui, ${HOSTNAME} is important for the internal
connections on the VIC Appliance between the Admiral service and
the Harbor registry. Include them in no proxy list whenever proxy
is configured.

When proxy is not set or removed in the vApp Options, set them as
null clearly.
  • Loading branch information
DanielXiao authored May 30, 2019
1 parent 7af349a commit 951ed5f
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions installer/build/scripts/admiral/configure_admiral.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,26 @@ iptables -w -A INPUT -j ACCEPT -p tcp --dport "${ADMIRAL_PORT}"

touch $data_dir/custom.conf

# Configure the integration URL
echo "harbor.tab.url=https://${HOSTNAME}:${REGISTRY_PORT}" > $data_dir/custom.conf

# Configure the proxy
if [ -n "${NETWORK_HTTPS_PROXY}" ]; then
echo "registry.proxy=${NETWORK_HTTPS_PROXY}" >> $data_dir/custom.conf
elif [ -n "${NETWORK_HTTP_PROXY}" ]; then
echo "registry.proxy=${NETWORK_HTTP_PROXY}" >> $data_dir/custom.conf
fi
if [ -n "${NETWORK_NO_PROXY_LIST}" ]; then
echo "registry.no.proxy.list=${NETWORK_NO_PROXY_LIST}" >> $data_dir/custom.conf
fi

# Copy files needed by Admiral into one directory
cp $appliance_jks $config_dir
cp $appliance_tls_key $config_dir
cp $appliance_tls_cert $config_dir
cp $data_dir/custom.conf $config_dir/config.properties
cp -f $data_dir/custom.conf $config_dir/config.properties
cp $admiral_psc_dir/psc-config.keystore $config_dir
cp $admiral_psc_dir/psc-config.properties $config_dir

# Configure the harbor integration URL
echo "harbor.tab.url=https://${HOSTNAME}:${REGISTRY_PORT}" >> $config_dir/config.properties

# Configure the proxy
if [ -n "${NETWORK_HTTPS_PROXY}" ] || [ -n "${NETWORK_HTTP_PROXY}" ]; then
echo "registry.proxy=${NETWORK_HTTPS_PROXY:-$NETWORK_HTTP_PROXY}" >> $config_dir/config.properties
echo "registry.no.proxy.list=localhost, 127.0.0.1, ui, ${HOSTNAME}${NETWORK_NO_PROXY_LIST:+, }${NETWORK_NO_PROXY_LIST}" >> $config_dir/config.properties
else
echo "registry.proxy=__null" >> $config_dir/config.properties
echo "registry.no.proxy.list=__null" >> $config_dir/config.properties
fi

echo "Copying CA certificate to $ca_download_dir"
cp $appliance_ca_cert $ca_download_dir/
$script_dir/set_guestinfo.sh -f $appliance_ca_cert "admiral.ca"
Expand Down

0 comments on commit 951ed5f

Please sign in to comment.