From 472b7c10bb186601d8ad1a00a89ba5c4bece150f Mon Sep 17 00:00:00 2001 From: anonpenguin23 Date: Fri, 31 Oct 2025 08:24:32 +0200 Subject: [PATCH] feat: automate terms acceptance in Anon configuration and installation - Added automatic acceptance of terms in the Anon configuration file to streamline the setup process. - Updated the installation script to pre-accept terms, eliminating interactive prompts during installation. - Enhanced output messages to reflect the auto-accepted terms for better user awareness. --- pkg/cli/setup.go | 5 +++++ scripts/install-debros-network.sh | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/pkg/cli/setup.go b/pkg/cli/setup.go index 1e37697..be554c5 100644 --- a/pkg/cli/setup.go +++ b/pkg/cli/setup.go @@ -528,6 +528,10 @@ func configureAnonDefaults() { if !strings.Contains(config, "SocksPort") { config += "SocksPort 9050\n" } + // Auto-accept terms to avoid interactive prompts + if !strings.Contains(config, "AgreeToTerms") { + config += "AgreeToTerms 1\n" + } // Write back os.WriteFile(anonrcPath, []byte(config), 0644) @@ -536,6 +540,7 @@ func configureAnonDefaults() { fmt.Printf(" ORPort: 9001 (default)\n") fmt.Printf(" ControlPort: 9051\n") fmt.Printf(" SOCKSPort: 9050\n") + fmt.Printf(" AgreeToTerms: 1 (auto-accepted)\n") } } diff --git a/scripts/install-debros-network.sh b/scripts/install-debros-network.sh index 31d86ae..235ee76 100755 --- a/scripts/install-debros-network.sh +++ b/scripts/install-debros-network.sh @@ -223,6 +223,10 @@ install_anon() { # Add repository echo "deb [signed-by=/usr/share/keyrings/anyone-archive-keyring.gpg] https://deb.anyone.io/ anyone main" | sudo tee /etc/apt/sources.list.d/anyone.list >/dev/null + # Preseed terms acceptance to avoid interactive prompt + log "Pre-accepting Anon terms and conditions..." + echo "anon anon/terms boolean true" | sudo debconf-set-selections + # Update and install log "Installing Anon package..." sudo apt update -qq @@ -285,10 +289,16 @@ configure_anon_defaults() { echo "SocksPort 9050" | sudo tee -a /etc/anon/anonrc >/dev/null fi + # Auto-accept terms in config file + if ! grep -q "^AgreeToTerms" /etc/anon/anonrc; then + echo "AgreeToTerms 1" | sudo tee -a /etc/anon/anonrc >/dev/null + fi + log " Nickname: ${HOSTNAME}" log " ORPort: 9001 (default)" log " ControlPort: 9051" log " SOCKSPort: 9050" + log " AgreeToTerms: 1 (auto-accepted)" fi }