From b0e63a2e0179b9926dad93b156ff773e485f4ec2 Mon Sep 17 00:00:00 2001 From: Justin Oros Date: Sun, 19 Apr 2026 15:50:41 -0700 Subject: [PATCH] syncthing.sh: replace python3 XML parsing with grep/sed for API key extraction since Syncthing container has no python3 --- syncthing.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncthing.sh b/syncthing.sh index b64c8f0..bb60814 100755 --- a/syncthing.sh +++ b/syncthing.sh @@ -19,7 +19,7 @@ ST_CONTAINER="" get_apikey() { ST_CONTAINER=$(docker ps --format '{{.Names}}' | grep -i syncthing | head -1 || true) [ -n "$ST_CONTAINER" ] || die "No running Syncthing container found." - APIKEY=$(docker exec "$ST_CONTAINER" python3 -c "import xml.etree.ElementTree as ET; print(ET.parse('/var/syncthing/config/config.xml').find('.//apikey').text)" 2>/dev/null || true) + APIKEY=$(docker exec "$ST_CONTAINER" cat /var/syncthing/config/config.xml 2>/dev/null | grep -o '[^<]*' | sed 's/<[^>]*>//g' || true) [ -n "$APIKEY" ] || die "Could not read Syncthing API key from container '$ST_CONTAINER'." }