From c997b8625f7dd5be0b31d7c082d66bb5c14ee6ff Mon Sep 17 00:00:00 2001 From: Socheat Sok Date: Thu, 29 May 2025 21:55:50 +0700 Subject: [PATCH] Re: "Allow installer to run without sudo & only need it when need to install Docker" --- install/main.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/install/main.go b/install/main.go index a0d74a43..d1ec85eb 100644 --- a/install/main.go +++ b/install/main.go @@ -58,9 +58,11 @@ func main() { reader := bufio.NewReader(os.Stdin) // check if the user is root - if os.Geteuid() != 0 { - fmt.Println("This script must be run as root") - os.Exit(1) + if !isDockerInstalled() { + if os.Geteuid() != 0 { + fmt.Println("Docker is not installed. Please install Docker manually or run this installer as root.") + os.Exit(1) + } } var config Config @@ -619,4 +621,4 @@ func generateRandomSecretKey() string { b[i] = charset[seededRand.Intn(len(charset))] } return string(b) -} \ No newline at end of file +}