From b91d9815f3c0cebc55afdcd7b9ebda77f8134a4f Mon Sep 17 00:00:00 2001 From: arch_agent Date: Tue, 4 Aug 2026 10:04:50 +0200 Subject: [PATCH] feat: /etc/safe-yay.conf config file - Installer writes /etc/safe-yay.conf with SHIELD_HOST/SHIELD_PORT - safe-yay sources /etc/safe-yay.conf at startup (overrides defaults) - No more env-var juggling needed --- install-client.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/install-client.sh b/install-client.sh index 1b636a4..9b6a27c 100644 --- a/install-client.sh +++ b/install-client.sh @@ -6,6 +6,11 @@ set -euo pipefail SHIELD_HOST="${AUR_SHIELD_HOST:-10.90.9.102}" SHIELD_PORT="${AUR_SHIELD_PORT:-8443}" +# Load config from /etc/safe-yay.conf if it exists (overrides defaults) +if [ -f /etc/safe-yay.conf ]; then + source /etc/safe-yay.conf +fi + echo "╔══════════════════════════════════════════════╗" echo "║ AUR-Shield Client Installer ║" echo "╚══════════════════════════════════════════════╝" @@ -19,6 +24,15 @@ fi echo "Server: http://$SHIELD_HOST:$SHIELD_PORT" echo "" +# Write config file +echo "Writing /etc/safe-yay.conf..." +sudo tee /etc/safe-yay.conf > /dev/null << EOFCONF +# AUR-Shield client configuration +SHIELD_HOST="$SHIELD_HOST" +SHIELD_PORT="$SHIELD_PORT" +EOFCONF +echo "✓ Config written to /etc/safe-yay.conf" + # Add pacman repo PACMAN_CONF="/etc/pacman.conf" REPO_ENTRY="[aur-shield] @@ -49,6 +63,11 @@ set -euo pipefail SHIELD_HOST="${AUR_SHIELD_HOST:-10.90.9.102}" SHIELD_PORT="${AUR_SHIELD_PORT:-8443}" +# Load config from /etc/safe-yay.conf if it exists (overrides defaults) +if [ -f /etc/safe-yay.conf ]; then + source /etc/safe-yay.conf +fi + # Exit codes (archcanary-compatible) # 0 = clean, 1 = warning, 2 = malicious/blocked