- Web UI: - Added secure Authentication system (Login, 2 Roles: Admin/Viewer) - Added System Monitoring Dashboard (Health, Services, Power Mgmt) - Added User Management Interface (Create, Delete, Enable/Disable) - Added Device Mapping view in iSCSI tab (lsscsi output) - Backend: - Implemented secure session management (auth.php) - Added power management APIs (restart/shutdown appliance) - Added device mapping API - CLI: - Created global 'vtl' management tool - Added scripts for reliable startup (vtllibrary fix) - Installer: - Updated install.sh with new dependencies (tgt, sudoers, permissions) - Included all new components in build-installer.sh - Docs: - Consolidated documentation into docs/ folder
113 lines
4.0 KiB
Bash
Executable File
113 lines
4.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
OUTPUT_DIR="$SCRIPT_DIR/dist"
|
|
PACKAGE_NAME="adastra-vtl-installer"
|
|
VERSION="1.0.0"
|
|
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
BLUE='\033[0;34m'
|
|
NC='\033[0m'
|
|
|
|
print_info() {
|
|
echo -e "${YELLOW}➜${NC} $1"
|
|
}
|
|
|
|
print_success() {
|
|
echo -e "${GREEN}✓${NC} $1"
|
|
}
|
|
|
|
print_error() {
|
|
echo -e "${RED}✗${NC} $1"
|
|
}
|
|
|
|
create_package() {
|
|
print_info "Creating installer package..."
|
|
|
|
rm -rf "$OUTPUT_DIR"
|
|
mkdir -p "$OUTPUT_DIR/$PACKAGE_NAME"
|
|
|
|
print_info "Copying files..."
|
|
|
|
cp -r "$SCRIPT_DIR/web-ui" "$OUTPUT_DIR/$PACKAGE_NAME/"
|
|
cp -r "$SCRIPT_DIR/config" "$OUTPUT_DIR/$PACKAGE_NAME/" 2>/dev/null || true
|
|
cp -r "$SCRIPT_DIR/scripts" "$OUTPUT_DIR/$PACKAGE_NAME/" 2>/dev/null || true
|
|
cp -r "$SCRIPT_DIR/systemd" "$OUTPUT_DIR/$PACKAGE_NAME/" 2>/dev/null || true
|
|
cp -r "$SCRIPT_DIR/docs" "$OUTPUT_DIR/$PACKAGE_NAME/" 2>/dev/null || true
|
|
|
|
cp "$SCRIPT_DIR/install.sh" "$OUTPUT_DIR/$PACKAGE_NAME/"
|
|
cp "$SCRIPT_DIR/uninstall.sh" "$OUTPUT_DIR/$PACKAGE_NAME/"
|
|
cp "$SCRIPT_DIR/README.md" "$OUTPUT_DIR/$PACKAGE_NAME/" 2>/dev/null || true
|
|
cp "$SCRIPT_DIR/INSTALLER-README.md" "$OUTPUT_DIR/$PACKAGE_NAME/README.md" 2>/dev/null || true
|
|
|
|
chmod +x "$OUTPUT_DIR/$PACKAGE_NAME/install.sh"
|
|
chmod +x "$OUTPUT_DIR/$PACKAGE_NAME/uninstall.sh"
|
|
chmod +x "$OUTPUT_DIR/$PACKAGE_NAME/scripts"/*.sh 2>/dev/null || true
|
|
|
|
cat > "$OUTPUT_DIR/$PACKAGE_NAME/VERSION" << EOF
|
|
Adastra VTL Installer
|
|
Version: $VERSION
|
|
Build Date: $(date '+%Y-%m-%d %H:%M:%S')
|
|
Build Host: $(hostname)
|
|
EOF
|
|
|
|
print_info "Creating tarball..."
|
|
cd "$OUTPUT_DIR"
|
|
tar -czf "${PACKAGE_NAME}-${VERSION}.tar.gz" "$PACKAGE_NAME"
|
|
|
|
TARBALL_SIZE=$(du -h "${PACKAGE_NAME}-${VERSION}.tar.gz" | cut -f1)
|
|
TARBALL_PATH="$OUTPUT_DIR/${PACKAGE_NAME}-${VERSION}.tar.gz"
|
|
|
|
print_success "Package created successfully!"
|
|
echo ""
|
|
echo -e "${BLUE}╔════════════════════════════════════════╗${NC}"
|
|
echo -e "${BLUE}║ Package Build Complete ║${NC}"
|
|
echo -e "${BLUE}╚════════════════════════════════════════╝${NC}"
|
|
echo ""
|
|
echo -e "${GREEN}Package Details:${NC}"
|
|
echo -e " • Name: ${YELLOW}${PACKAGE_NAME}-${VERSION}.tar.gz${NC}"
|
|
echo -e " • Size: ${YELLOW}${TARBALL_SIZE}${NC}"
|
|
echo -e " • Location: ${YELLOW}${TARBALL_PATH}${NC}"
|
|
echo ""
|
|
echo -e "${GREEN}Contents:${NC}"
|
|
echo -e " • Web UI (mhvtl configuration interface)"
|
|
echo -e " • Installation scripts"
|
|
echo -e " • Systemd service files"
|
|
echo -e " • Configuration templates"
|
|
echo -e " • Documentation"
|
|
echo ""
|
|
echo -e "${GREEN}Supported Distributions:${NC}"
|
|
echo -e " • Debian 10+ / Ubuntu 18.04+"
|
|
echo -e " • RHEL/CentOS 7+ / Fedora 30+"
|
|
echo -e " • Rocky Linux 8+ / AlmaLinux 8+"
|
|
echo ""
|
|
echo -e "${BLUE}Quick Start:${NC}"
|
|
echo ""
|
|
echo -e "${YELLOW}1. Copy to target system:${NC}"
|
|
echo -e " scp ${TARBALL_PATH} user@server:~/"
|
|
echo ""
|
|
echo -e "${YELLOW}2. On target system:${NC}"
|
|
echo -e " tar -xzf ${PACKAGE_NAME}-${VERSION}.tar.gz"
|
|
echo -e " cd ${PACKAGE_NAME}"
|
|
echo -e " sudo ./install.sh"
|
|
echo ""
|
|
echo -e "${YELLOW}3. Access Web UI:${NC}"
|
|
echo -e " http://[SERVER-IP]/mhvtl-config"
|
|
echo ""
|
|
echo -e "${BLUE}For detailed instructions, see README.md in the package${NC}"
|
|
echo ""
|
|
}
|
|
|
|
main() {
|
|
echo -e "${BLUE}╔════════════════════════════════════════╗${NC}"
|
|
echo -e "${BLUE}║ Adastra VTL Package Builder ║${NC}"
|
|
echo -e "${BLUE}╚════════════════════════════════════════╝${NC}"
|
|
echo ""
|
|
|
|
create_package
|
|
}
|
|
|
|
main "$@"
|