Skip to content

Commit 02dc8fd

Browse files
authored
Merge pull request #109 from buildplan/fixing
fix: warn and finish the script on failure to install docker, tailscale, netbird
2 parents 951f2b9 + b15fdad commit 02dc8fd

File tree

3 files changed

+38
-14
lines changed

3 files changed

+38
-14
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
-----
99

10-
**Version:** v0.80.3
10+
**Version:** v0.80.4
1111

12-
**Last Updated:** 2026-03-03
12+
**Last Updated:** 2026-03-09
1313

1414
**Compatible With:**
1515

@@ -88,12 +88,12 @@ sha256sum du_setup.sh
8888

8989
Compare the output hash to the one below. They must match exactly.
9090

91-
`f5beab8c45ec821aba4b109ca9e3bebd40dcbcc774436be9011c58e56d014ed4`
91+
`f32dafe3170045b35cf3b20fe00b6689e192f2bfaa1b6879277b42ca40854bd5`
9292

9393
Or echo the hash to check, it should output: `du_setup.sh: OK`
9494

9595
```bash
96-
echo f5beab8c45ec821aba4b109ca9e3bebd40dcbcc774436be9011c58e56d014ed4 du_setup.sh | sha256sum --check
96+
echo f32dafe3170045b35cf3b20fe00b6689e192f2bfaa1b6879277b42ca40854bd5 du_setup.sh | sha256sum --check
9797
```
9898

9999
### 3. Run the Script

du_setup.sh

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/bin/bash
22

33
# Debian and Ubuntu Server Hardening Interactive Script
4-
# Version: 0.80.3 | 2026-03-03
4+
# Version: 0.80.4 | 2026-03-09
55
# Changelog:
6+
# - v0.80.4: Warn and finish the script if Docker, Tailscale and Netbird fail to install properly.
67
# - v0.80.3: Warn about password-less sudo and offer to generate password for the user if they choose to do so.
78
# Improve SSH service detection for Debian systems.
89
# - v0.80.2: Added an optional install of netbird (https://netbird.io/) as an alternative to tailscale.
@@ -105,7 +106,7 @@
105106
set -euo pipefail
106107

107108
# --- Update Configuration ---
108-
CURRENT_VERSION="0.80.3"
109+
CURRENT_VERSION="0.80.4"
109110
SCRIPT_URL="https://raw.githubusercontent.com/buildplan/du_setup/refs/heads/main/du_setup.sh"
110111
CHECKSUM_URL="${SCRIPT_URL}.sha256"
111112

@@ -167,6 +168,11 @@ PREVIOUS_SSH_PORT=""
167168
IDS_INSTALLED=""
168169
TWO_FACTOR_ENABLED="false"
169170

171+
DOCKER_INSTALL_WARN=false
172+
DOCKER_SANITY_WARN=false
173+
TAILSCALE_INSTALL_WARN=false
174+
NETBIRD_INSTALL_WARN=false
175+
170176
# --- --help ---
171177
show_usage() {
172178
printf "\n"
@@ -264,7 +270,7 @@ print_header() {
264270
printf '%s\n' "${CYAN}╔═════════════════════════════════════════════════════════════════╗${NC}"
265271
printf '%s\n' "${CYAN}║ ║${NC}"
266272
printf '%s\n' "${CYAN}║ DEBIAN/UBUNTU SERVER SETUP AND HARDENING SCRIPT ║${NC}"
267-
printf '%s\n' "${CYAN}║ v0.80.3 | 2026-03-03${NC}"
273+
printf '%s\n' "${CYAN}║ v0.80.4 | 2026-03-09${NC}"
268274
printf '%s\n' "${CYAN}║ ║${NC}"
269275
printf '%s\n' "${CYAN}╚═════════════════════════════════════════════════════════════════╝${NC}"
270276
printf '\n'
@@ -4492,8 +4498,9 @@ install_docker() {
44924498
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/${ID} $(. /etc/os-release && echo "$VERSION_CODENAME") stable" > /etc/apt/sources.list.d/docker.list
44934499
print_info "Installing Docker packages..."
44944500
if ! apt-get update -qq || ! apt-get install -y -qq docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin; then
4495-
print_error "Failed to install Docker packages."
4496-
exit 1
4501+
print_error "Docker package installation failed. Once the script is complete, manually check and install it."
4502+
DOCKER_INSTALL_WARN=true
4503+
return 0
44974504
fi
44984505
print_info "Adding '$USERNAME' to docker group..."
44994506
getent group docker >/dev/null || groupadd docker
@@ -4553,8 +4560,9 @@ DAEMONFILE
45534560
if sudo -u "$USERNAME" docker run --rm hello-world 2>&1 | tee -a "$LOG_FILE" | grep -q "Hello from Docker"; then
45544561
print_success "Docker sanity check passed."
45554562
else
4556-
print_error "Docker hello-world test failed. Please verify installation."
4557-
exit 1
4563+
print_error "Docker hello-world test failed. Please verify installation once the script is complete."
4564+
DOCKER_SANITY_WARN=true
4565+
return 0
45584566
fi
45594567
print_warning "NOTE: '$USERNAME' must log out and back in to use Docker without sudo."
45604568
log "Docker installation completed."
@@ -4653,6 +4661,7 @@ install_tailscale() {
46534661
print_error "Failed to download the Tailscale installation script."
46544662
print_info "After setup completes, please try installing it manually: curl -fsSL https://tailscale.com/install.sh | sh"
46554663
rm -f /tmp/tailscale_install.sh # Clean up partial download
4664+
TAILSCALE_INSTALL_WARN=true
46564665
return 0 # Exit the function without exiting the main script
46574666
fi
46584667

@@ -4661,6 +4670,7 @@ install_tailscale() {
46614670
print_error "Tailscale installation script failed to execute."
46624671
log "Tailscale installation failed."
46634672
rm -f /tmp/tailscale_install.sh # Clean up
4673+
TAILSCALE_INSTALL_WARN=true
46644674
return 0 # Exit the function gracefully
46654675
fi
46664676

@@ -4859,7 +4869,8 @@ install_netbird() {
48594869
print_info "Adding NetBird repository and installing package..."
48604870
if ! apt-get update -qq || ! apt-get install -y -qq ca-certificates curl gnupg; then
48614871
print_error "Failed to install dependencies for NetBird."
4862-
return 1
4872+
NETBIRD_INSTALL_WARN=true
4873+
return 0
48634874
fi
48644875

48654876
curl -sSL https://pkgs.netbird.io/debian/public.key | gpg --dearmor --output /usr/share/keyrings/netbird-archive-keyring.gpg 2>/dev/null
@@ -4868,7 +4879,8 @@ install_netbird() {
48684879
if ! apt-get update -qq || ! apt-get install -y -qq netbird; then
48694880
print_error "Failed to install NetBird package."
48704881
log "NetBird installation failed."
4871-
return 1
4882+
NETBIRD_INSTALL_WARN=true
4883+
return 0
48724884
fi
48734885
print_success "NetBird installation complete."
48744886
log "NetBird installation completed."
@@ -6045,6 +6057,18 @@ generate_summary() {
60456057
if [[ ${#FAILED_SERVICES[@]} -gt 0 ]]; then
60466058
print_warning "ACTION REQUIRED: The following services failed: ${FAILED_SERVICES[*]}. Verify with 'systemctl status <service>'."
60476059
fi
6060+
if [[ "${DOCKER_INSTALL_WARN:-false}" == true ]]; then
6061+
print_warning "ACTION REQUIRED: Docker packages failed to install. Review '$LOG_FILE' and reinstall Docker manually."
6062+
fi
6063+
if [[ "${DOCKER_SANITY_WARN:-false}" == true ]]; then
6064+
print_warning "ACTION REQUIRED: Docker sanity check failed. Run 'docker run --rm hello-world' after reboot to verify."
6065+
fi
6066+
if [[ "${TAILSCALE_INSTALL_WARN:-false}" == true ]]; then
6067+
print_warning "ACTION REQUIRED: Tailscale installation failed. Re-run the official installer and configure Tailscale manually."
6068+
fi
6069+
if [[ "${NETBIRD_INSTALL_WARN:-false}" == true ]]; then
6070+
print_warning "ACTION REQUIRED: NetBird installation failed. Reinstall NetBird and run 'netbird up' manually."
6071+
fi
60486072
if [[ -n "${TS_COMMAND:-}" ]]; then
60496073
print_warning "ACTION REQUIRED: Tailscale connection failed. Run the following command to connect manually:"
60506074
printf '%s\n' "${CYAN} $TS_COMMAND${NC}"

du_setup.sh.sha256

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f5beab8c45ec821aba4b109ca9e3bebd40dcbcc774436be9011c58e56d014ed4 du_setup.sh
1+
f32dafe3170045b35cf3b20fe00b6689e192f2bfaa1b6879277b42ca40854bd5 du_setup.sh

0 commit comments

Comments
 (0)