feat: implement Phase 6 — Software Deployment
Backend: - SoftwarePackage model (Name, Version, OsType, PackageManager, PackageName, InstallerUrl, Checksum, SilentArgs) - RmmDbContext: SoftwarePackages DbSet + unique index on (Name, Version, OsType) - SoftwarePackagesController: full CRUD with OsType filter - DeployController: POST /api/v1/deploy creates InstallSoftware/UninstallSoftware TaskItem - EF Migration: AddSoftwarePackages (20260319130448) Go Agent: - internal/deployer/deployer.go: Install() and Uninstall() with: - Chocolatey (Windows), apt/dnf (Linux), auto-detect - Direct installer fallback: HTTP download + SHA256 verify + silent install - Supports .msi, .exe (Windows) and .deb, .rpm (Linux) - main.go: COMMAND_TYPE_INSTALL_SOFTWARE and COMMAND_TYPE_UNINSTALL_SOFTWARE routed to deployer Frontend: - SoftwarePage: Katalog tab (CRUD, OS filter, smart package manager select) + Deploy tab - api/types.ts: SoftwarePackage, PackageManager, DeployRequest/Response types - api/client.ts: softwarePackagesApi and deployApi - App.tsx: Software nav item with Package icon Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"nexusrmm.local/agent/internal/collector"
|
||||
"nexusrmm.local/agent/internal/config"
|
||||
"nexusrmm.local/agent/internal/connection"
|
||||
"nexusrmm.local/agent/internal/deployer"
|
||||
"nexusrmm.local/agent/internal/executor"
|
||||
pb "nexusrmm.local/agent/pkg/proto"
|
||||
)
|
||||
@@ -128,6 +129,10 @@ func executeCommand(ctx context.Context, client *connection.GrpcClient, agentID
|
||||
switch cmd.Type {
|
||||
case pb.CommandType_COMMAND_TYPE_SHELL:
|
||||
result = executor.Execute(ctx, cmd.Payload, 300)
|
||||
case pb.CommandType_COMMAND_TYPE_INSTALL_SOFTWARE:
|
||||
result = deployer.Install(ctx, cmd.Payload)
|
||||
case pb.CommandType_COMMAND_TYPE_UNINSTALL_SOFTWARE:
|
||||
result = deployer.Uninstall(ctx, cmd.Payload)
|
||||
default:
|
||||
result = &executor.Result{ExitCode: -1, Stderr: fmt.Sprintf("unknown command type: %v", cmd.Type)}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user