Skip to content

Commit e70d917

Browse files
committed
Add NetBird installation and setup scripts; include Git configuration guide
- Introduced `.git-setup-info` for recommended Git configurations and workflows for ProxmoxVE development. - Added `ct/netbird.sh` for managing NetBird container setup and updates. - Created `install/netbird-install.sh` for installing NetBird and configuring its repository and service. - Enhanced user experience with prompts for authentication methods during NetBird setup.
1 parent 838e663 commit e70d917

File tree

3 files changed

+230
-0
lines changed

3 files changed

+230
-0
lines changed

.git-setup-info

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Git Configuration for ProxmoxVE Development
2+
3+
## Recommended Git Configuration
4+
5+
### Set up remotes for easy syncing with upstream:
6+
7+
```bash
8+
# View your current remotes
9+
git remote -v
10+
11+
# If you don't have 'upstream' configured, add it:
12+
git remote add upstream https://github.com/community-scripts/ProxmoxVE.git
13+
14+
# Verify both remotes exist:
15+
git remote -v
16+
# Should show:
17+
# origin https://github.com/YOUR_USERNAME/ProxmoxVE.git (fetch)
18+
# origin https://github.com/YOUR_USERNAME/ProxmoxVE.git (push)
19+
# upstream https://github.com/community-scripts/ProxmoxVE.git (fetch)
20+
# upstream https://github.com/community-scripts/ProxmoxVE.git (push)
21+
```
22+
23+
### Configure Git User (if not done globally)
24+
25+
```bash
26+
git config user.name "Your Name"
27+
git config user.email "[email protected]"
28+
29+
# Or configure globally:
30+
git config --global user.name "Your Name"
31+
git config --global user.email "[email protected]"
32+
```
33+
34+
### Useful Git Workflows
35+
36+
**Keep your fork up-to-date:**
37+
```bash
38+
git fetch upstream
39+
git rebase upstream/main
40+
git push origin main
41+
```
42+
43+
**Create feature branch:**
44+
```bash
45+
git checkout -b feature/my-awesome-app
46+
# Make changes...
47+
git commit -m "feat: add my awesome app"
48+
git push origin feature/my-awesome-app
49+
```
50+
51+
**Pull latest from upstream:**
52+
```bash
53+
git fetch upstream
54+
git merge upstream/main
55+
```
56+
57+
---
58+
59+
For more help, see: docs/CONTRIBUTION_GUIDE.md

ct/netbird.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
3+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
4+
# Copyright (c) 2021-2025 community-scripts ORG
5+
# Author: TechHutTV
6+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
7+
# Source: https://netbird.io/
8+
9+
APP="NetBird"
10+
var_tags="network;vpn"
11+
var_cpu="1"
12+
var_ram="512"
13+
var_disk="4"
14+
var_os="debian"
15+
var_version="13"
16+
var_unprivileged="1"
17+
var_tun="${var_tun:-yes}"
18+
19+
header_info "$APP"
20+
variables
21+
color
22+
catch_errors
23+
24+
function update_script() {
25+
header_info
26+
check_container_storage
27+
check_container_resources
28+
29+
if [[ ! -f /etc/netbird/config.json ]]; then
30+
msg_error "No ${APP} Installation Found!"
31+
exit
32+
fi
33+
34+
msg_info "Updating ${APP}"
35+
$STD apt update
36+
$STD apt -y upgrade
37+
msg_ok "Updated Successfully"
38+
exit
39+
}
40+
41+
start
42+
build_container
43+
description
44+
45+
msg_ok "Completed Successfully!\n"
46+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
47+
echo -e "${INFO}${YW} Access NetBird by entering the container and running:${CL}"
48+
echo -e "${TAB}${GATEWAY}${BGN}netbird up${CL}"

install/netbird-install.sh

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: TechHutTV
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://netbird.io/
7+
8+
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
echo ""
17+
echo ' _ _ _ ____ _ _ _ __ _______ '
18+
echo ' | \ | | | | | _ \(_) | | | | \ \ / / ____|'
19+
echo ' | \| | ___| |_| |_) |_ _ __ __| | | | \ V / | '
20+
echo ' | . ` |/ _ \ __| _ <| | '\''__/ _` | | | > <| | '
21+
echo ' | |\ | __/ |_| |_) | | | | (_| | | |____ / . \ |____ '
22+
echo ' |_| \_|\___|\__|____/|_|_| \__,_| |______/_/ \_\_____|'
23+
echo ""
24+
25+
msg_info "Installing Dependencies"
26+
$STD apt install -y \
27+
curl \
28+
ca-certificates \
29+
gnupg
30+
msg_ok "Installed Dependencies"
31+
32+
msg_info "Setting up NetBird Repository"
33+
curl -sSL https://pkgs.netbird.io/debian/public.key \
34+
| gpg --dearmor -o /usr/share/keyrings/netbird-archive-keyring.gpg
35+
chmod 0644 /usr/share/keyrings/netbird-archive-keyring.gpg
36+
echo 'deb [signed-by=/usr/share/keyrings/netbird-archive-keyring.gpg] https://pkgs.netbird.io/debian stable main' \
37+
| tee /etc/apt/sources.list.d/netbird.list > /dev/null
38+
$STD apt update
39+
msg_ok "Set up NetBird Repository"
40+
41+
msg_info "Installing NetBird"
42+
$STD apt install -y netbird
43+
msg_ok "Installed NetBird"
44+
45+
msg_info "Enabling NetBird Service"
46+
$STD netbird service install 2>/dev/null || true
47+
$STD netbird service start 2>/dev/null || true
48+
$STD systemctl enable netbird
49+
msg_ok "Enabled NetBird Service"
50+
51+
# NetBird Connection Setup
52+
echo ""
53+
echo -e "${BL}NetBird Connection Setup${CL}"
54+
echo "─────────────────────────────────────────"
55+
echo "Choose how to connect to your NetBird network:"
56+
echo ""
57+
echo " 1) Setup Key (default) - Use a pre-generated setup key"
58+
echo " 2) SSO Login - Authenticate via browser with your identity provider"
59+
echo " 3) Skip - Configure later with 'netbird up'"
60+
echo ""
61+
62+
read -rp "Select authentication method [1]: " AUTH_METHOD
63+
AUTH_METHOD="${AUTH_METHOD:-1}"
64+
65+
case "$AUTH_METHOD" in
66+
1)
67+
# Setup Key authentication
68+
echo ""
69+
echo "Enter your NetBird setup key from the NetBird dashboard."
70+
echo ""
71+
read -rp "Setup key: " NETBIRD_SETUP_KEY
72+
echo ""
73+
74+
if [[ -z "$NETBIRD_SETUP_KEY" ]]; then
75+
msg_warn "No setup key provided. Run 'netbird up' within the container to connect."
76+
else
77+
echo -e "Setup key: ${GN}${NETBIRD_SETUP_KEY}${CL}"
78+
read -rp "Press Enter to continue or Ctrl+C to cancel..."
79+
80+
msg_info "Connecting to NetBird with setup key"
81+
if netbird up -k "$NETBIRD_SETUP_KEY"; then
82+
msg_ok "Connected to NetBird"
83+
else
84+
msg_warn "Connection failed. Run 'netbird up -k <key>' within the container to retry."
85+
fi
86+
fi
87+
;;
88+
2)
89+
# SSO authentication
90+
echo ""
91+
echo -e "${BL}SSO Authentication${CL}"
92+
echo "─────────────────────────────────────────"
93+
echo "A login URL will appear below."
94+
echo "Copy the URL and open it in your browser to authenticate."
95+
echo ""
96+
97+
msg_info "Starting SSO login"
98+
netbird login 2>&1 || true
99+
echo ""
100+
101+
msg_info "Connecting to NetBird"
102+
if netbird up; then
103+
msg_ok "Connected to NetBird"
104+
else
105+
msg_warn "Connection failed. Run 'netbird up' within the container to retry."
106+
fi
107+
;;
108+
3)
109+
msg_info "Skipping NetBird connection"
110+
msg_ok "Run 'netbird up' within the container to connect."
111+
;;
112+
*)
113+
msg_warn "Invalid selection. Run 'netbird up' within the container to connect."
114+
;;
115+
esac
116+
117+
motd_ssh
118+
customize
119+
120+
msg_info "Cleaning up"
121+
$STD apt -y autoremove
122+
$STD apt -y autoclean
123+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)