post: commit c03df13 in bojemoi-telegram
All checks were successful
Hugo Build & Deploy / build-deploy (push) Successful in 6s

This commit is contained in:
Betty
2026-02-23 15:25:22 +01:00
parent 5c442d4dc9
commit 360f0bb46e

View File

@@ -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 <noreply@anthropic.com>
### 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(-)
```