fix: auto-install NGINX before Wallarm node setup

Wallarm node (native deployment) requires NGINX as a runtime
dependency.  installNginx() runs apt-get install nginx if not
already present, before extracting/running the Wallarm installer.

Also fixed repo.wallarm.com → meganode.wallarm.com in preflight.
This commit is contained in:
admin 2026-08-01 15:52:35 +00:00
parent 157373ea16
commit 5923f684ec

View file

@ -64,7 +64,10 @@ connector:
return fmt.Errorf("write config: %w", err)
}
// 3. Download installer if missing
// 3. Ensure NGINX is installed (Wallarm node requires it)
installNginx()
// 4. Download installer if missing
url := installerURL()
if _, err := os.Stat(installerPath); os.IsNotExist(err) {
fmt.Printf("[%s] Downloading installer from meganode.wallarm.com...\n", node.Name)
@ -233,3 +236,13 @@ WantedBy=multi-user.target
func CreateNodesDir() error {
return os.MkdirAll(NodesDir, 0755)
}
// installNginx ensures NGINX is present on the system.
func installNginx() {
if _, err := exec.LookPath("nginx"); err == nil {
return
}
fmt.Println("Installing NGINX (required by Wallarm node)...")
exec.Command("apt-get", "update", "-qq").Run()
exec.Command("apt-get", "install", "-y", "-qq", "nginx").Run()
}