Merge pull request #1220 from TechHutTV/claude/fix-netbird-scripts-raTbP
This commit is contained in:
commit
be5195887f
48
ct/netbird.sh
Normal file
48
ct/netbird.sh
Normal file
@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: TechHutTV
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://netbird.io/
|
||||
|
||||
APP="NetBird"
|
||||
var_tags="${var_tags:-network;vpn}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-512}"
|
||||
var_disk="${var_disk:-4}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
var_tun="${var_tun:-yes}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -f /etc/netbird/config.json ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
msg_info "Updating Netbird"
|
||||
$STD apt update
|
||||
$STD apt upgrade -y
|
||||
msg_ok "Updated successfully!"
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW} Access NetBird by entering the container and running:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}netbird up${CL}"
|
||||
50
frontend/public/json/netbird.json
Normal file
50
frontend/public/json/netbird.json
Normal file
@ -0,0 +1,50 @@
|
||||
{
|
||||
"name": "NetBird",
|
||||
"slug": "netbird",
|
||||
"categories": [4],
|
||||
"date_created": "2025-12-02",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": null,
|
||||
"documentation": "https://docs.netbird.io/",
|
||||
"website": "https://netbird.io/",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/netbird.webp",
|
||||
"config_path": "/etc/netbird/config.json",
|
||||
"description": "NetBird is an open source VPN management platform that creates secure peer-to-peer networks using WireGuard. It enables secure connectivity between devices anywhere in the world without complex firewall configurations or port forwarding. NetBird offers features like zero-configuration networking, SSO integration, access control policies, and a centralized management dashboard. It's designed to be simple to deploy and manage, making it ideal for connecting remote teams, securing IoT devices, or building secure infrastructure networks.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/netbird.sh",
|
||||
"resources": {
|
||||
"cpu": 1,
|
||||
"ram": 512,
|
||||
"hdd": 4,
|
||||
"os": "debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "The NetBird client (agent) allows a peer to join a pre-existing NetBird deployment. If a NetBird deployment is not yet available, there are both managed and self-hosted options available.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "After installation, enter the container and run `netbird` to view the commands.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Use a Setup Key from your NetBird dashboard or SSO login to authenticate during setup or in the container.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Check connection status with `netbird status`.",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
161
install/netbird-install.sh
Normal file
161
install/netbird-install.sh
Normal file
@ -0,0 +1,161 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: TechHutTV
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://netbird.io/
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Setting up NetBird Repository"
|
||||
setup_deb882_repo \
|
||||
"netbird" \
|
||||
"https://pkgs.netbird.io/debian/public.key" \
|
||||
"https://pkgs.netbird.io/debian" \
|
||||
"stable"
|
||||
msg_ok "Set up NetBird Repository"
|
||||
|
||||
msg_info "Installing NetBird"
|
||||
$STD apt install -y netbird
|
||||
msg_ok "Installed NetBird"
|
||||
|
||||
msg_info "Enabling NetBird Service"
|
||||
$STD systemctl enable -q --now netbird
|
||||
msg_ok "Enabled NetBird Service"
|
||||
|
||||
echo ""
|
||||
echo ""
|
||||
echo -e "${BL}NetBird Deployment Type${CL}"
|
||||
echo "─────────────────────────────────────────"
|
||||
echo "Are you using NetBird Managed or Self-Hosted?"
|
||||
echo ""
|
||||
echo " 1) NetBird Managed (default) - Use NetBird's managed service"
|
||||
echo " 2) Self-Hosted - Use your own NetBird management server"
|
||||
echo ""
|
||||
|
||||
read -r -p "${TAB3}Select deployment type [1]: " DEPLOYMENT_TYPE
|
||||
DEPLOYMENT_TYPE="${DEPLOYMENT_TYPE:-1}"
|
||||
|
||||
NETBIRD_MGMT_URL=""
|
||||
case "$DEPLOYMENT_TYPE" in
|
||||
1)
|
||||
msg_ok "Using NetBird Managed service"
|
||||
;;
|
||||
2)
|
||||
echo ""
|
||||
echo -e "${BL}Self-Hosted Configuration${CL}"
|
||||
echo "─────────────────────────────────────────"
|
||||
echo "Enter your NetBird management server URL."
|
||||
echo "Example: https://management.example.com"
|
||||
echo ""
|
||||
read -r -p "Management URL: " NETBIRD_MGMT_URL
|
||||
|
||||
if [[ -z "$NETBIRD_MGMT_URL" ]]; then
|
||||
msg_warn "No management URL provided. Run 'netbird up --management-url <url>' to connect."
|
||||
else
|
||||
NETBIRD_MGMT_URL="${NETBIRD_MGMT_URL%/}"
|
||||
msg_ok "Management URL configured: ${NETBIRD_MGMT_URL}"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
msg_warn "Invalid selection. Using NetBird Managed service."
|
||||
;;
|
||||
esac
|
||||
|
||||
echo ""
|
||||
echo ""
|
||||
echo -e "${BL}NetBird Connection Setup${CL}"
|
||||
echo "─────────────────────────────────────────"
|
||||
echo "Choose how to connect to your NetBird network:"
|
||||
echo ""
|
||||
echo " 1) Setup Key (default) - Use a pre-generated setup key"
|
||||
echo " 2) SSO Login - Authenticate via browser with your identity provider"
|
||||
echo " 3) Skip - Configure later with 'netbird up'"
|
||||
echo ""
|
||||
|
||||
read -r -p "Select authentication method [1]: " AUTH_METHOD
|
||||
AUTH_METHOD="${AUTH_METHOD:-1}"
|
||||
|
||||
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 [[ -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."
|
||||
fi
|
||||
else
|
||||
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
|
||||
msg_ok "Connected to NetBird"
|
||||
else
|
||||
msg_warn "Connection failed. Run 'netbird up -k <key>' to retry."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
2)
|
||||
echo ""
|
||||
echo -e "${BL}SSO Authentication${CL}"
|
||||
echo "─────────────────────────────────────────"
|
||||
echo "A login URL will appear below."
|
||||
echo "Copy the URL and open it in your browser to authenticate."
|
||||
echo ""
|
||||
|
||||
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
|
||||
fi
|
||||
echo ""
|
||||
|
||||
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
|
||||
msg_ok "Connected to NetBird"
|
||||
else
|
||||
msg_warn "Connection failed. Run 'netbird up' to retry."
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
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."
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
msg_warn "Invalid selection. Run 'netbird up' to connect."
|
||||
;;
|
||||
esac
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
Loading…
x
Reference in New Issue
Block a user