From 360f0bb46e3b8c105eeebe3e01bf7d0c18d166b4 Mon Sep 17 00:00:00 2001 From: Betty Date: Mon, 23 Feb 2026 15:25:22 +0100 Subject: [PATCH] post: commit c03df13 in bojemoi-telegram --- .../commits/2026-02-23-commit-c03df13.md | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 content/posts/commits/2026-02-23-commit-c03df13.md diff --git a/content/posts/commits/2026-02-23-commit-c03df13.md b/content/posts/commits/2026-02-23-commit-c03df13.md new file mode 100644 index 0000000..d31855a --- /dev/null +++ b/content/posts/commits/2026-02-23-commit-c03df13.md @@ -0,0 +1,45 @@ +--- +title: "[bojemoi-telegram] telegram: add IPv6 support — ALLOWED_IP_RANGES + ip-api.com fallback" +date: 2026-02-23T15:25:22+01:00 +draft: false +tags: ["commit", "bojemoi-telegram", "master"] +categories: ["Git Activity"] +summary: "Commit c03df13 par Betty dans bojemoi-telegram" +author: "Betty" +--- + +## Commit `c03df13` + +| | | +|---|---| +| **Repository** | bojemoi-telegram | +| **Branch** | `master` | +| **Author** | Betty | +| **Hash** | `c03df130d577b4723e238a5f1c50785ee6aac1d0` | + + +### Description + +- config.py: extend default ALLOWED_IP_RANGES to include ::/0 so IPv6 + addresses pass the is_ip_allowed() check out of the box + +- crud.py: get_country_by_ip() now tries ip2location_db1 first (IPv4), + then falls back to ip-api.com/json/{ip} for IPv6 (and IPv4 if + ip2location fails); no API key required + +Co-Authored-By: Claude Sonnet 4.6 + +### Files Changed + +``` +M telegram-bot/config.py +M telegram-bot/database/crud.py +``` + +### Diff Summary + +``` + telegram-bot/config.py | 2 +- + telegram-bot/database/crud.py | 27 ++++++++++++++++++++------- + 2 files changed, 21 insertions(+), 8 deletions(-) +```