Removed: - docker/ (scripts, binaries, images) - no longer needed - native/, common/ bash scripts - replaced by Go binary - setup.sh - replaced by deploy.sh - internal/docker/ Go package - no longer needed Added: - deploy.sh - one-command bootstrap - --version flag Result: one binary, one TUI, one deployment type. Zero Docker. Binary distributed via Gitea releases (not in repo).
70 lines
2.2 KiB
Bash
70 lines
2.2 KiB
Bash
#!/bin/bash
|
|
# ==============================================================================
|
|
# Wallarm Deployment — Single Binary Bootstrap
|
|
# ==============================================================================
|
|
# Downloads the wallarm binary from the Git repository and places it in
|
|
# ~/deploy/. One command to get started:
|
|
#
|
|
# curl -fsSL ".../deploy.sh" | bash
|
|
# sudo ./deploy/wallarm
|
|
#
|
|
# The binary handles everything: preflight → TUI wizard → deployment →
|
|
# dashboard with multi-node management.
|
|
# ==============================================================================
|
|
|
|
set -euo pipefail
|
|
|
|
BOLD='\033[1m'
|
|
GREEN='\033[0;32m'
|
|
CYAN='\033[0;36m'
|
|
YELLOW='\033[1;33m'
|
|
RED='\033[0;31m'
|
|
NC='\033[0m'
|
|
|
|
ARCH=$(uname -m)
|
|
case "$ARCH" in
|
|
x86_64|amd64) BIN_ARCH="amd64" ;;
|
|
aarch64|arm64) BIN_ARCH="arm64" ;;
|
|
*) echo -e "${RED}Unsupported architecture: $ARCH${NC}"; exit 1 ;;
|
|
esac
|
|
|
|
REPO="https://git.sechpoint.app/customer-engineering/wallarm"
|
|
BIN_URL="${REPO}/raw/branch/main/bin/wallarm-linux-${BIN_ARCH}"
|
|
DEPLOY_DIR="${HOME:-/root}/deploy"
|
|
BIN_PATH="${DEPLOY_DIR}/wallarm"
|
|
|
|
mkdir -p "$DEPLOY_DIR"
|
|
|
|
echo -e "${BOLD}Wallarm Deployment Bootstrap${NC}"
|
|
echo
|
|
|
|
# Download the binary
|
|
echo -e "${YELLOW}Downloading wallarm binary (linux-${BIN_ARCH})...${NC}"
|
|
if command -v curl >/dev/null 2>&1; then
|
|
curl -fsSL --progress-bar "$BIN_URL" -o "$BIN_PATH"
|
|
elif command -v wget >/dev/null 2>&1; then
|
|
wget -q --show-progress "$BIN_URL" -O "$BIN_PATH"
|
|
else
|
|
echo -e "${RED}Neither curl nor wget found. Install one and re-run.${NC}"
|
|
exit 1
|
|
fi
|
|
|
|
chmod +x "$BIN_PATH"
|
|
echo -e "${GREEN} Success: wallarm installed to ${BIN_PATH}${NC}"
|
|
echo
|
|
|
|
# Quick preflight (just to confirm binary works)
|
|
echo -e "${YELLOW}Testing binary...${NC}"
|
|
if "$BIN_PATH" --version 2>/dev/null; then
|
|
echo -e "${GREEN} Binary OK${NC}"
|
|
else
|
|
echo -e "${RED} Binary verification failed${NC}"
|
|
exit 1
|
|
fi
|
|
echo
|
|
|
|
echo -e "${GREEN}${BOLD}Ready!${NC}"
|
|
echo
|
|
echo -e " ${CYAN}sudo ${BIN_PATH}${NC} — Start the TUI (wizard on first run, dashboard after)"
|
|
echo -e " ${CYAN}${BIN_PATH} --help${NC} — Show all commands"
|
|
echo -e " ${CYAN}${BIN_PATH} --tunnel${NC} — Start remote access tunnel"
|