Upgrade GeoIP functionality & replace the databases (#2471)

* Replaced Maxmind's IP database

* Began rebuilding GeoIP reader functionality

The GeoIP2 package does not worth with DB's that aren't built by maxmind themselves, making it rather unhelpful for us.

Since my long-term goal is for someone to be able to bring in their own DB, making a custom implementation seems like the reasonable choice.

(Plus my aim is already to replace the MaxMind DB due to it's licencing)

* Created an IP address lookup page

* + ASN info

* Bump last patch

* Make PHPStan happy

* Very minor refactor + PHPDocs
This commit is contained in:
Belle Aerni authored and GitHub committed 2024-10-31 19:31:50 +01:00
1 parent 2b431f8757
commit a5d15c2a99
27 files changed
+526 -210

No files matched your search

@@ -9,7 +9,7 @@
{% block content %}
<div class="card overflow-auto">
<div class="card-body">
<h5>{{ 'Clients logins history'|trans }}</h5>
<h5>{{ 'Client login history'|trans }}</h5>
</div>
{% include 'partial_search.html.twig' %}
@@ -43,7 +43,7 @@
<td>
<a href="{{ 'client/manage'|alink }}/{{ event.client.id }}">{{ event.client.first_name }} {{ event.client.last_name }}</a>
</td>
<td>{{ event.ip }}</td>
<td>{{ event.ip|iplookup }}</td>
<td>{{ event.ip|ipcountryname|default('Unknown') }}</td>
<td>{{ event.created_at|format_datetime }}</td>
<td>
@@ -115,7 +115,7 @@
{% endif %}
<tr>
<td class="text-end">IP:</td>
<td>{{ client.ip|default('-') }} {{ client.ip|ipcountryname|default('Unknown') }}</td>
<td>{%if client.ip %}{{ client.ip|iplookup }}{% else %}{{ 'Unknown'|trans }}{% endif %}</td>
</tr>
<tr>
<td class="text-end">{{ 'API Key'|trans }}:</td>
@@ -724,7 +724,7 @@
<div class="tab-pane fade" id="tab-history" role="tabpanel" aria-labelledby="history-tab">
<div class="card-body">
<h5>{{ 'Logins history'|trans }}</h5>
<h5>{{ 'Login history'|trans }}</h5>
</div>
<div class="table-responsive">
@@ -741,7 +741,7 @@
{% set logins = admin.client_login_history_get_list({ 'per_page': 10, 'page': request.page, 'client_id': client.id }) %}
{% for i, login in logins.list %}
<tr>
<td>{{ login.ip }}</td>
<td>{{ login.ip|iplookup }}</td>
<td>{{ login.ip|ipcountryname|default('Unknown') }}</td>
<td>{{ login.created_at|format_datetime }}</td>
</tr>