feat: Major VTL System Upgrade (Auth, Monitoring, CLI, Installer)
- 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
This commit is contained in:
35
install.sh
35
install.sh
@@ -75,12 +75,17 @@ install_dependencies_debian() {
|
||||
"apache2"
|
||||
"php"
|
||||
"libapache2-mod-php"
|
||||
"tgt"
|
||||
"open-iscsi"
|
||||
)
|
||||
|
||||
apt-get install -y "${DEBIAN_PACKAGES[@]}"
|
||||
|
||||
systemctl enable apache2
|
||||
systemctl start apache2
|
||||
|
||||
systemctl enable tgt
|
||||
systemctl start tgt
|
||||
|
||||
print_success "Dependencies installed (Debian/Ubuntu)"
|
||||
}
|
||||
@@ -107,6 +112,8 @@ install_dependencies_rpm() {
|
||||
"sg3_utils"
|
||||
"httpd"
|
||||
"php"
|
||||
"scsi-target-utils"
|
||||
"iscsi-initiator-utils"
|
||||
)
|
||||
|
||||
$PKG_MGR install -y "${RPM_PACKAGES[@]}"
|
||||
@@ -114,6 +121,11 @@ install_dependencies_rpm() {
|
||||
systemctl enable httpd
|
||||
systemctl start httpd
|
||||
|
||||
if systemctl list-unit-files | grep -q "tgtd.service"; then
|
||||
systemctl enable tgtd
|
||||
systemctl start tgtd
|
||||
fi
|
||||
|
||||
if command -v firewall-cmd &> /dev/null; then
|
||||
firewall-cmd --permanent --add-service=http
|
||||
firewall-cmd --reload
|
||||
@@ -262,12 +274,33 @@ configure_system() {
|
||||
|
||||
if [ "$DISTRO" = "debian" ] || [ "$DISTRO" = "ubuntu" ]; then
|
||||
usermod -a -G vtl www-data
|
||||
|
||||
# Initialize users file securely if not exists
|
||||
if [ ! -f "/etc/mhvtl/users.json" ]; then
|
||||
echo '[{"username":"admin","password":"$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi","role":"admin","created":"'$(date '+%Y-%m-%d %H:%M:%S')'","enabled":true}]' > /etc/mhvtl/users.json
|
||||
fi
|
||||
chown www-data:www-data /etc/mhvtl/users.json
|
||||
chmod 600 /etc/mhvtl/users.json
|
||||
|
||||
systemctl restart apache2 2>/dev/null || true
|
||||
else
|
||||
usermod -a -G vtl apache
|
||||
|
||||
# Initialize users file securely if not exists
|
||||
if [ ! -f "/etc/mhvtl/users.json" ]; then
|
||||
echo '[{"username":"admin","password":"$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi","role":"admin","created":"'$(date '+%Y-%m-%d %H:%M:%S')'","enabled":true}]' > /etc/mhvtl/users.json
|
||||
fi
|
||||
chown apache:apache /etc/mhvtl/users.json
|
||||
chmod 600 /etc/mhvtl/users.json
|
||||
|
||||
systemctl restart httpd 2>/dev/null || true
|
||||
fi
|
||||
|
||||
if [ -f "$INSTALL_DIR/scripts/vtl" ]; then
|
||||
ln -sf "$INSTALL_DIR/scripts/vtl" /usr/local/bin/vtl
|
||||
chmod +x /usr/local/bin/vtl
|
||||
fi
|
||||
|
||||
if [ -f "$INSTALL_DIR/scripts/load-mhvtl.sh" ]; then
|
||||
ln -sf "$INSTALL_DIR/scripts/load-mhvtl.sh" /usr/local/bin/mhvtl-load
|
||||
fi
|
||||
@@ -308,6 +341,8 @@ print_completion() {
|
||||
echo -e " • Unload modules: ${YELLOW}mhvtl-unload${NC}"
|
||||
echo -e " • Check status: ${YELLOW}systemctl status mhvtl${NC}"
|
||||
echo -e " • View devices: ${YELLOW}lsscsi -g${NC}"
|
||||
echo -e " • VTL CLI Tool: ${YELLOW}vtl status${NC}"
|
||||
echo -e " • Default Web Login: ${YELLOW}admin / admin123${NC}"
|
||||
echo ""
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user