Merge pull request #1271 from TechHutTV/main

NetBird (remove
This commit is contained in:
Michel Roegl-Brunner 2026-01-13 08:35:04 +01:00 committed by GitHub
commit 624c7bde80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -74,14 +74,20 @@ echo -e "${BL}NetBird Connection Setup${CL}"
echo "─────────────────────────────────────────" echo "─────────────────────────────────────────"
echo "Choose how to connect to your NetBird network:" echo "Choose how to connect to your NetBird network:"
echo "" echo ""
if [[ "$DEPLOYMENT_TYPE" == "1" ]]; then
echo " 1) Setup Key (default) - Use a pre-generated setup key" echo " 1) Setup Key (default) - Use a pre-generated setup key"
echo " 2) SSO Login - Authenticate via browser with your identity provider" echo " 2) SSO Login - Authenticate via browser with your identity provider"
echo " 3) Skip - Configure later with 'netbird up'" echo " 3) Skip - Configure later with 'netbird up'"
else
echo " 1) Setup Key (default) - Use a pre-generated setup key"
echo " 2) Skip - Configure later with 'netbird up'"
fi
echo "" echo ""
read -r -p "Select authentication method [1]: " AUTH_METHOD read -r -p "Select authentication method [1]: " AUTH_METHOD
AUTH_METHOD="${AUTH_METHOD:-1}" AUTH_METHOD="${AUTH_METHOD:-1}"
if [[ "$DEPLOYMENT_TYPE" == "1" ]]; then
case "$AUTH_METHOD" in case "$AUTH_METHOD" in
1) 1)
echo "" echo ""
@ -91,27 +97,15 @@ case "$AUTH_METHOD" in
echo "" echo ""
if [[ -z "$NETBIRD_SETUP_KEY" ]]; then if [[ -z "$NETBIRD_SETUP_KEY" ]]; then
if [[ -n "$NETBIRD_MGMT_URL" ]]; then
msg_warn "No setup key provided. Run 'netbird up -k <key> --management-url $NETBIRD_MGMT_URL' to connect."
else
msg_warn "No setup key provided. Run 'netbird up -k <key>' to connect." msg_warn "No setup key provided. Run 'netbird up -k <key>' to connect."
fi
else else
msg_info "Connecting to NetBird with setup key" msg_info "Connecting to NetBird with setup key"
if [[ -n "$NETBIRD_MGMT_URL" ]]; then
if $STD netbird up -k "$NETBIRD_SETUP_KEY" --management-url "$NETBIRD_MGMT_URL"; then
msg_ok "Connected to NetBird"
else
msg_warn "Connection failed. Run 'netbird up -k <key> --management-url $NETBIRD_MGMT_URL' to retry."
fi
else
if $STD netbird up -k "$NETBIRD_SETUP_KEY"; then if $STD netbird up -k "$NETBIRD_SETUP_KEY"; then
msg_ok "Connected to NetBird" msg_ok "Connected to NetBird"
else else
msg_warn "Connection failed. Run 'netbird up -k <key>' to retry." msg_warn "Connection failed. Run 'netbird up -k <key>' to retry."
fi fi
fi fi
fi
;; ;;
2) 2)
echo "" echo ""
@ -122,39 +116,67 @@ case "$AUTH_METHOD" in
echo "" echo ""
msg_info "Starting SSO login" msg_info "Starting SSO login"
if [[ -n "$NETBIRD_MGMT_URL" ]]; then
netbird login --management-url "$NETBIRD_MGMT_URL" 2>&1 || true
else
netbird login 2>&1 || true netbird login 2>&1 || true
fi
echo "" echo ""
msg_info "Connecting to NetBird" msg_info "Connecting to NetBird"
if [[ -n "$NETBIRD_MGMT_URL" ]]; then
if $STD netbird up --management-url "$NETBIRD_MGMT_URL"; then
msg_ok "Connected to NetBird"
else
msg_warn "Connection failed. Run 'netbird up --management-url $NETBIRD_MGMT_URL' to retry."
fi
else
if $STD netbird up; then if $STD netbird up; then
msg_ok "Connected to NetBird" msg_ok "Connected to NetBird"
else else
msg_warn "Connection failed. Run 'netbird up' to retry." msg_warn "Connection failed. Run 'netbird up' to retry."
fi fi
fi
;; ;;
3) 3)
if [[ -n "$NETBIRD_MGMT_URL" ]]; then
msg_ok "Skipped. Run 'netbird up --management-url $NETBIRD_MGMT_URL' to connect."
else
msg_ok "Skipped. Run 'netbird up' to connect." msg_ok "Skipped. Run 'netbird up' to connect."
fi
;; ;;
*) *)
msg_warn "Invalid selection. Run 'netbird up' to connect." msg_warn "Invalid selection. Run 'netbird up' to connect."
;; ;;
esac esac
else
case "$AUTH_METHOD" in
1)
echo ""
echo "Enter your NetBird setup key from the NetBird dashboard."
echo ""
read -r -p "Setup key: " NETBIRD_SETUP_KEY
echo ""
if [[ -z "$NETBIRD_SETUP_KEY" ]]; then
if [[ -z "$NETBIRD_MGMT_URL" ]]; then
msg_warn "No setup key provided. Run 'netbird up -k <key> --management-url <url>' to connect."
else
msg_warn "No setup key provided. Run 'netbird up -k <key> --management-url $NETBIRD_MGMT_URL' to connect."
fi
else
if [[ -z "$NETBIRD_MGMT_URL" ]]; then
msg_error "Management URL is required for self-hosted deployments. Please configure it first."
else
msg_info "Connecting to NetBird with setup key"
if $STD netbird up -k "$NETBIRD_SETUP_KEY" --management-url "$NETBIRD_MGMT_URL"; then
msg_ok "Connected to NetBird"
else
msg_warn "Connection failed. Run 'netbird up -k <key> --management-url $NETBIRD_MGMT_URL' to retry."
fi
fi
fi
;;
2)
if [[ -z "$NETBIRD_MGMT_URL" ]]; then
msg_ok "Skipped. Run 'netbird up --management-url <url>' to connect."
else
msg_ok "Skipped. Run 'netbird up --management-url $NETBIRD_MGMT_URL' to connect."
fi
;;
*)
if [[ -z "$NETBIRD_MGMT_URL" ]]; then
msg_warn "Invalid selection. Run 'netbird up --management-url <url>' to connect."
else
msg_warn "Invalid selection. Run 'netbird up --management-url $NETBIRD_MGMT_URL' to connect."
fi
;;
esac
fi
motd_ssh motd_ssh
customize customize