Browse Source

filter "home-assistant-config-entries": also remove telegram bot tokens

The part after the bot id grants full control over the bot. The bot id itself is public and kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fabian Peter Hammerle 2 weeks ago
parent
commit
c3fd6ad327
1 changed files with 1 additions and 1 deletions
  1. 1 1
      gitconfig

+ 1 - 1
gitconfig

@@ -58,7 +58,7 @@
 	required = true
 
 [filter "home-assistant-config-entries"]
-	clean = "jq '(.data.entries[].data |= with_entries(if (.key | IN(\"password\", \"access_token\", \"noise_psk\", \"token\", \"webhook_id\")) and .value != null then .value = \"…\" else . end)) | (.data.entries[].unique_id |= if . != null then sub(\"^(?<p>io[.]homeassistant[.]companion[.]android-[[:xdigit:]]{2})[[:xdigit:]]{14}$\"; \"\\(.p)…\") else . end) | ((.data.entries[] | select(.data.app_id == \"io.homeassistant.companion.android\") | .data.device_id) |= if . != null then sub(\"^(?<p>[[:xdigit:]]{2})[[:xdigit:]]{14}$\"; \"\\(.p)…\") else . end) | ((.data.entries[] | select(.domain == \"samsungtv\") | .unique_id) |= if . != null then sub(\"^(?<p>[[:xdigit:]]{2})[[:xdigit:]]{6}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}$\"; \"\\(.p)…\") else . end)' | eval \"$(git config --get filter.truncate-mac-address-to-24-bits.clean)\" | eval \"$(git config --get filter.truncate-dyness-battery-serial-numbers.clean)\""
+	clean = "jq '(.data.entries[].data |= with_entries(if (.key | IN(\"password\", \"access_token\", \"noise_psk\", \"token\", \"webhook_id\")) and .value != null then .value = \"…\" else . end)) | (.data.entries[].unique_id |= if . != null then sub(\"^(?<p>io[.]homeassistant[.]companion[.]android-[[:xdigit:]]{2})[[:xdigit:]]{14}$\"; \"\\(.p)…\") else . end) | ((.data.entries[] | select(.data.app_id == \"io.homeassistant.companion.android\") | .data.device_id) |= if . != null then sub(\"^(?<p>[[:xdigit:]]{2})[[:xdigit:]]{14}$\"; \"\\(.p)…\") else . end) | ((.data.entries[] | select(.domain == \"samsungtv\") | .unique_id) |= if . != null then sub(\"^(?<p>[[:xdigit:]]{2})[[:xdigit:]]{6}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}$\"; \"\\(.p)…\") else . end) | ((.data.entries[] | select(.domain == \"telegram_bot\")) |= ((if .data.api_key != null then .data.api_key |= sub(\"^(?<p>[0-9]+:).+$\"; \"\\(.p)…\") else . end) | if .unique_id != null then .unique_id |= sub(\"^(?<p>[0-9]+:).+$\"; \"\\(.p)…\") else . end))' | eval \"$(git config --get filter.truncate-mac-address-to-24-bits.clean)\" | eval \"$(git config --get filter.truncate-dyness-battery-serial-numbers.clean)\""
 	smudge = cat
 	required = true