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:
parent
157373ea16
commit
5923f684ec
1 changed files with 14 additions and 1 deletions
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue