Skip to content

Commit

Permalink
Fixed default hostname
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel <[email protected]>
  • Loading branch information
dgarcia18 committed Apr 30, 2024
1 parent 7ad0999 commit 7745f4a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions appliances/Harbor/appliance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ONE_SERVICE_PARAMS=(
### Contextualization defaults #######################################
HARBOR_ADMIN_PASSWORD="${HARBOR_ADMIN_PASSWORD:-Harbor12345}" # Default Harbor admin password
HARBOR_DB_PASSWORD="${HARBOR_DB_PASSWORD:-$(gen_db_password)}" # Defaults to autogenerated password
HARBOR_HOSTNAME="${HARBOR_HOSTNAME:-0.0.0.0}" # Listens in all interfaces by default
HARBOR_HOSTNAME="${HARBOR_HOSTNAME:-$(get_local_ip)}" # Listens in all interfaces by default
HARBOR_SSL_CERT="${HARBOR_SSL_CERT:-AG}" # Defaults to "AG", indicating "AutoGenerated"
HARBOR_SSL_KEY="${HARBOR_SSL_KEY:-AG}" # Defaults to "AG", indicating "AutoGenerated"
HARBOR_PERSISTENT_DEV="${HARBOR_PERSISTENT_DEV:-None}" # Listens in all interfaces by default
Expand Down Expand Up @@ -111,7 +111,7 @@ service_bootstrap() { # Running Harbor installer => will generate and run docker
msg info "Starting bootstrap..."
/root/harbor/install.sh
if [ $? -ne 0 ]; then
msg error "Harbor installation script failed, aborting..."
msg error "Harbor installation script failed, aborting..."
exit 1
else
msg info "Harbor installation script finished successfully. Waiting 60s before final health checks..."
Expand All @@ -137,9 +137,10 @@ check_internet_access() {
}

install_requirements(){
apt update && apt install openssl ca-certificates curl gnupg docker.io docker-compose -y
export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get install openssl ca-certificates curl gnupg docker.io docker-compose -y
if [ $? -eq 0 ]; then
msg info "Dependencies installation finished successfully. Running extra checks..."
msg info "Dependencies installation finished successfully. Running extra checks..."
else
msg error "Dependencies installation failed. Aborting..."
fi
Expand Down Expand Up @@ -218,14 +219,14 @@ download_unpack_harbor() {
# Download Harbor
wget -P /root/ $url
if [ $? -ne 0 ]; then
msg info "Harbor download failed. Download URL: $url"
msg info "Harbor download failed. Download URL: $url"
exit 1
else
msg info "Harbor downloaded successfully"
fi
tar -xvzf /root/harbor-online-installer-v*.tgz
if [ $? -ne 0 ]; then
msg info "Harbor unpacking failed. Aborting..."
msg info "Harbor unpacking failed. Aborting..."
exit 1
else
msg info "Harbor unpacked successfully"
Expand Down Expand Up @@ -270,12 +271,12 @@ mount_persistent() {
msg info "Detected filesystem type $FS_TYPE for persistent device /dev/$HARBOR_PERSISTENT_DEV"

# Add entry to /etc/fstab for persistence
echo "/dev/$HARBOR_PERSISTENT_DEV /data $FS_TYPE defaults 0 2" | sudo tee -a /etc/fstab > /dev/null
echo "/dev/$HARBOR_PERSISTENT_DEV /data $FS_TYPE defaults 0 2" | tee -a /etc/fstab > /dev/null
msg info "Added entry to /etc/fstab for persistency. Mounting..."
# Mount the drive
mount -a
if [ $? -ne 0 ]; then
msg error "Unable to mount persistent device, aborting..."
msg error "Unable to mount persistent device, aborting..."
exit 1
fi

Expand Down

0 comments on commit 7745f4a

Please sign in to comment.