mirror of
https://github.com/DeBrosOfficial/network.git
synced 2025-12-13 02:48:49 +00:00
refactor: improve Anon installation script for terms acceptance
- Updated the installation process to rely on debconf preseed and file-based acceptance methods, reducing the need for interactive prompts. - Limited the number of "yes" responses piped during installation to enhance reliability and prevent infinite loops. - Streamlined the command execution for fetching and running the installation script from GitHub.
This commit is contained in:
parent
624f92bf11
commit
f561bc5311
2
Makefile
2
Makefile
@ -21,7 +21,7 @@ test-e2e:
|
|||||||
|
|
||||||
.PHONY: build clean test run-node run-node2 run-node3 run-example deps tidy fmt vet lint clear-ports
|
.PHONY: build clean test run-node run-node2 run-node3 run-example deps tidy fmt vet lint clear-ports
|
||||||
|
|
||||||
VERSION := 0.52.20
|
VERSION := 0.52.21
|
||||||
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
|
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
|
||||||
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
|
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||||
LDFLAGS := -X 'main.version=$(VERSION)' -X 'main.commit=$(COMMIT)' -X 'main.date=$(DATE)'
|
LDFLAGS := -X 'main.version=$(VERSION)' -X 'main.commit=$(COMMIT)' -X 'main.date=$(DATE)'
|
||||||
|
|||||||
@ -469,11 +469,14 @@ func installAnon() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Use the official installation script from GitHub
|
// Use the official installation script from GitHub
|
||||||
// Pipe "yes" repeatedly to automatically accept terms prompt
|
// Rely on debconf preseed and file-based acceptance methods
|
||||||
|
// If prompts still appear, pipe a few "yes" responses (not infinite)
|
||||||
installScriptURL := "https://raw.githubusercontent.com/anyone-protocol/anon-install/refs/heads/main/install.sh"
|
installScriptURL := "https://raw.githubusercontent.com/anyone-protocol/anon-install/refs/heads/main/install.sh"
|
||||||
// Use yes command to pipe multiple "yes" responses if needed
|
// Pipe multiple "yes" responses (but limited) in case of multiple prompts
|
||||||
cmd := exec.Command("sh", "-c", fmt.Sprintf("curl -fsSL %s | (yes yes | bash)", installScriptURL))
|
yesResponses := strings.Repeat("yes\n", 10) // 10 "yes" responses should be enough
|
||||||
|
cmd := exec.Command("sh", "-c", fmt.Sprintf("curl -fsSL %s | bash", installScriptURL))
|
||||||
cmd.Env = append(os.Environ(), "DEBIAN_FRONTEND=noninteractive")
|
cmd.Env = append(os.Environ(), "DEBIAN_FRONTEND=noninteractive")
|
||||||
|
cmd.Stdin = strings.NewReader(yesResponses)
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = os.Stderr
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user