Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

remove ipapi

Bill Yangd56bbb4eb8df
diff --git a/client/messages/cs.json b/client/messages/cs.json
index 6bf502aae..6a4d4c2c0 100644
--- a/client/messages/cs.json
+++ b/client/messages/cs.json
@@ -120,15 +120,6 @@
"S1utKH": "Lon",
"18HJlm": "Štítek",
"7nUCu9": "Časové pásmo",
- "PfUTPz": "VPN",
- "1fzzQF": "Crawler",
- "zUxWZC": "Datové centrum",
- "9YazHG": "Společnost",
- "6TFjfy": "Typ společnosti",
- "7qesNi": "Doména společnosti",
- "0cOykX": "ASN Org",
- "/g8hj9": "ASN Type",
- "ckAea8": "ASN Domain",
"CfjnxD": "Rovná se",
"TVHfKA": "Je",
"DmLxpf": "Nerovná se",
@@ -389,9 +380,6 @@
"Aujn2T": "Počet",
"ogKEiU": "Odchozí odkazy",
"VLKK35": "Kliknutí",
- "uWvl2D": "VPN",
- "e6P9iT": "Crawlery",
- "NoQGSk": "Datová centra",
"6kvpmt": "Filtrovat {count} odkazů...",
"cegNe7": "Odchozí odkaz",
"pEc/5k": "Kliknutí %",
diff --git a/client/messages/de.json b/client/messages/de.json
index efcec50fe..4899a1153 100644
--- a/client/messages/de.json
+++ b/client/messages/de.json
@@ -120,15 +120,6 @@
"S1utKH": "Längengrad",
"18HJlm": "Tag",
"7nUCu9": "Zeitzone",
- "PfUTPz": "VPN",
- "1fzzQF": "Crawler",
- "zUxWZC": "Rechenzentrum",
- "9YazHG": "Unternehmen",
- "6TFjfy": "Unternehmenstyp",
- "7qesNi": "Unternehmens-Domain",
- "0cOykX": "ASN-Organisation",
- "/g8hj9": "ASN-Typ",
- "ckAea8": "ASN-Domain",
"CfjnxD": "Gleich",
"TVHfKA": "Ist",
"DmLxpf": "Ungleich",
@@ -389,9 +380,6 @@
"Aujn2T": "Anzahl",
"ogKEiU": "Ausgehende Links",
"VLKK35": "Klicks",
- "uWvl2D": "VPNs",
- "e6P9iT": "Crawler",
- "NoQGSk": "Rechenzentren",
"6kvpmt": "{count} Links filtern...",
"cegNe7": "Ausgehender Link",
"pEc/5k": "Klick %",
diff --git a/client/messages/en.json b/client/messages/en.json
index cc9e5a58b..cae186f75 100644
--- a/client/messages/en.json
+++ b/client/messages/en.json
@@ -120,15 +120,6 @@
"S1utKH": "Lon",
"18HJlm": "Tag",
"7nUCu9": "Timezone",
- "PfUTPz": "VPN",
- "1fzzQF": "Crawler",
- "zUxWZC": "Datacenter",
- "9YazHG": "Company",
- "6TFjfy": "Company Type",
- "7qesNi": "Company Domain",
- "0cOykX": "ASN Org",
- "/g8hj9": "ASN Type",
- "ckAea8": "ASN Domain",
"CfjnxD": "Equals",
"TVHfKA": "Is",
"DmLxpf": "Not equals",
@@ -389,9 +380,6 @@
"Aujn2T": "Count",
"ogKEiU": "Outbound Links",
"VLKK35": "Clicks",
- "uWvl2D": "VPNs",
- "e6P9iT": "Crawlers",
- "NoQGSk": "Datacenters",
"6kvpmt": "Filter {count} links...",
"cegNe7": "Outbound Link",
"pEc/5k": "Click %",
diff --git a/client/messages/es.json b/client/messages/es.json
index 9cb80c822..953f730be 100644
--- a/client/messages/es.json
+++ b/client/messages/es.json
@@ -120,15 +120,6 @@
"S1utKH": "Longitud",
"18HJlm": "Etiqueta",
"7nUCu9": "Zona horaria",
- "PfUTPz": "VPN",
- "1fzzQF": "Rastreador",
- "zUxWZC": "Centro de datos",
- "9YazHG": "Empresa",
- "6TFjfy": "Tipo de empresa",
- "7qesNi": "Dominio de empresa",
- "0cOykX": "Org ASN",
- "/g8hj9": "Tipo ASN",
- "ckAea8": "Dominio ASN",
"CfjnxD": "Igual a",
"TVHfKA": "Es",
"DmLxpf": "No es igual a",
@@ -389,9 +380,6 @@
"Aujn2T": "Recuento",
"ogKEiU": "Enlaces salientes",
"VLKK35": "Clics",
- "uWvl2D": "VPNs",
- "e6P9iT": "Rastreadores",
- "NoQGSk": "Centros de datos",
"6kvpmt": "Filtrar {count} enlaces...",
"cegNe7": "Enlace saliente",
"pEc/5k": "% Clic",
diff --git a/client/messages/fr.json b/client/messages/fr.json
index 75adb21f8..09d32ce03 100644
--- a/client/messages/fr.json
+++ b/client/messages/fr.json
@@ -120,15 +120,6 @@
"S1utKH": "Longitude",
"18HJlm": "Tag",
"7nUCu9": "Fuseau horaire",
- "PfUTPz": "VPN",
- "1fzzQF": "Robot",
- "zUxWZC": "Centre de données",
- "9YazHG": "Entreprise",
- "6TFjfy": "Type d'entreprise",
- "7qesNi": "Domaine de l'entreprise",
- "0cOykX": "Org. ASN",
- "/g8hj9": "Type ASN",
- "ckAea8": "Domaine ASN",
"CfjnxD": "Égal",
"TVHfKA": "Est",
"DmLxpf": "Différent",
@@ -389,9 +380,6 @@
"Aujn2T": "Nombre",
"ogKEiU": "Liens sortants",
"VLKK35": "Clics",
- "uWvl2D": "VPN",
- "e6P9iT": "Robots d'indexation",
- "NoQGSk": "Centres de données",
"6kvpmt": "Filtrer {count} liens...",
"cegNe7": "Lien sortant",
"pEc/5k": "Clic %",
diff --git a/client/messages/it.json b/client/messages/it.json
index 4bfddaf3e..ecbe8ee6b 100644
--- a/client/messages/it.json
+++ b/client/messages/it.json
@@ -120,15 +120,6 @@
"S1utKH": "Lon",
"18HJlm": "Tag",
"7nUCu9": "Fuso orario",
- "PfUTPz": "VPN",
- "1fzzQF": "Bot",
- "zUxWZC": "Datacenter",
- "9YazHG": "Azienda",
- "6TFjfy": "Tipo Azienda",
- "7qesNi": "Dominio Azienda",
- "0cOykX": "Org ASN",
- "/g8hj9": "Tipo ASN",
- "ckAea8": "Dominio ASN",
"CfjnxD": "Uguale a",
"TVHfKA": "È",
"DmLxpf": "Diverso da",
@@ -389,9 +380,6 @@
"Aujn2T": "Conteggio",
"ogKEiU": "Link Esterni",
"VLKK35": "Clic",
- "uWvl2D": "VPN",
- "e6P9iT": "Crawler",
- "NoQGSk": "Datacenter",
"6kvpmt": "Filtra {count} link...",
"cegNe7": "Link Esterno",
"pEc/5k": "% Clic",
diff --git a/client/messages/ja.json b/client/messages/ja.json
index f55d8e802..d6e971244 100644
--- a/client/messages/ja.json
+++ b/client/messages/ja.json
@@ -120,15 +120,6 @@
"S1utKH": "経度",
"18HJlm": "タグ",
"7nUCu9": "タイムゾーン",
- "PfUTPz": "VPN",
- "1fzzQF": "クローラー",
- "zUxWZC": "データセンター",
- "9YazHG": "企業",
- "6TFjfy": "企業タイプ",
- "7qesNi": "企業ドメイン",
- "0cOykX": "ASN組織",
- "/g8hj9": "ASNタイプ",
- "ckAea8": "ASNドメイン",
"CfjnxD": "等しい",
"TVHfKA": "である",
"DmLxpf": "等しくない",
@@ -389,9 +380,6 @@
"Aujn2T": "カウント",
"ogKEiU": "外部リンク",
"VLKK35": "クリック",
- "uWvl2D": "VPN",
- "e6P9iT": "クローラー",
- "NoQGSk": "データセンター",
"6kvpmt": "{count}件のリンクをフィルター...",
"cegNe7": "外部リンク",
"pEc/5k": "クリック率",
diff --git a/client/messages/ko.json b/client/messages/ko.json
index bbd9c28d8..b04b9976c 100644
--- a/client/messages/ko.json
+++ b/client/messages/ko.json
@@ -120,15 +120,6 @@
"S1utKH": "경도",
"18HJlm": "태그",
"7nUCu9": "시간대",
- "PfUTPz": "VPN",
- "1fzzQF": "크롤러",
- "zUxWZC": "데이터센터",
- "9YazHG": "회사",
- "6TFjfy": "회사 유형",
- "7qesNi": "회사 도메인",
- "0cOykX": "ASN 조직",
- "/g8hj9": "ASN 유형",
- "ckAea8": "ASN 도메인",
"CfjnxD": "같음",
"TVHfKA": "이(가)",
"DmLxpf": "같지 않음",
@@ -389,9 +380,6 @@
"Aujn2T": "수",
"ogKEiU": "외부 링크",
"VLKK35": "클릭",
- "uWvl2D": "VPN",
- "e6P9iT": "크롤러",
- "NoQGSk": "데이터센터",
"6kvpmt": "{count}개 링크 필터...",
"cegNe7": "외부 링크",
"pEc/5k": "클릭 %",
diff --git a/client/messages/pl.json b/client/messages/pl.json
index 7c70c6800..0819022db 100644
--- a/client/messages/pl.json
+++ b/client/messages/pl.json
@@ -120,15 +120,6 @@
"S1utKH": "Dł. geogr.",
"18HJlm": "Tag",
"7nUCu9": "Strefa czasowa",
- "PfUTPz": "VPN",
- "1fzzQF": "Crawler",
- "zUxWZC": "Centrum danych",
- "9YazHG": "Firma",
- "6TFjfy": "Typ firmy",
- "7qesNi": "Domena firmy",
- "0cOykX": "Organizacja ASN",
- "/g8hj9": "Typ ASN",
- "ckAea8": "Domena ASN",
"CfjnxD": "Równa się",
"TVHfKA": "Jest",
"DmLxpf": "Nie równa się",
@@ -389,9 +380,6 @@
"Aujn2T": "Liczba",
"ogKEiU": "Linki wychodzące",
"VLKK35": "Kliknięcia",
- "uWvl2D": "VPN-y",
- "e6P9iT": "Crawlery",
- "NoQGSk": "Centra danych",
"6kvpmt": "Filtruj {count} linków...",
"cegNe7": "Link wychodzący",
"pEc/5k": "% kliknięć",
diff --git a/client/messages/pt.json b/client/messages/pt.json
index 741cb38f7..267afd4af 100644
--- a/client/messages/pt.json
+++ b/client/messages/pt.json
@@ -120,15 +120,6 @@
"S1utKH": "Lon",
"18HJlm": "Tag",
"7nUCu9": "Fuso Horário",
- "PfUTPz": "VPN",
- "1fzzQF": "Rastreador",
- "zUxWZC": "Datacenter",
- "9YazHG": "Empresa",
- "6TFjfy": "Tipo de Empresa",
- "7qesNi": "Domínio da Empresa",
- "0cOykX": "Org ASN",
- "/g8hj9": "Tipo ASN",
- "ckAea8": "Domínio ASN",
"CfjnxD": "Igual a",
"TVHfKA": "É",
"DmLxpf": "Diferente de",
@@ -389,9 +380,6 @@
"Aujn2T": "Contagem",
"ogKEiU": "Links Externos",
"VLKK35": "Cliques",
- "uWvl2D": "VPNs",
- "e6P9iT": "Rastreadores",
- "NoQGSk": "Datacenters",
"6kvpmt": "Filtrar {count} links...",
"cegNe7": "Link Externo",
"pEc/5k": "Clique %",
diff --git a/client/messages/uk.json b/client/messages/uk.json
index f4f9c3350..06ca9f14b 100644
--- a/client/messages/uk.json
+++ b/client/messages/uk.json
@@ -120,15 +120,6 @@
"S1utKH": "Довгота",
"18HJlm": "Тег",
"7nUCu9": "Часовий пояс",
- "PfUTPz": "VPN",
- "1fzzQF": "Кроулер",
- "zUxWZC": "Дата-центр",
- "9YazHG": "Компанія",
- "6TFjfy": "Тип компанії",
- "7qesNi": "Домен компанії",
- "0cOykX": "Організація ASN",
- "/g8hj9": "Тип ASN",
- "ckAea8": "Домен ASN",
"CfjnxD": "Дорівнює",
"TVHfKA": "Є",
"DmLxpf": "Не дорівнює",
@@ -389,9 +380,6 @@
"Aujn2T": "Кількість",
"ogKEiU": "Вихідні посилання",
"VLKK35": "Кліки",
- "uWvl2D": "VPN-и",
- "e6P9iT": "Кроулери",
- "NoQGSk": "Дата-центри",
"6kvpmt": "Фільтрувати {count} посилань...",
"cegNe7": "Вихідне посилання",
"pEc/5k": "% кліків",
diff --git a/client/messages/zh.json b/client/messages/zh.json
index afb57ce47..ce9316bb7 100644
--- a/client/messages/zh.json
+++ b/client/messages/zh.json
@@ -120,15 +120,6 @@
"S1utKH": "经度",
"18HJlm": "标签",
"7nUCu9": "时区",
- "PfUTPz": "VPN",
- "1fzzQF": "爬虫",
- "zUxWZC": "数据中心",
- "9YazHG": "公司",
- "6TFjfy": "公司类型",
- "7qesNi": "公司域名",
- "0cOykX": "ASN 组织",
- "/g8hj9": "ASN 类型",
- "ckAea8": "ASN 域名",
"CfjnxD": "等于",
"TVHfKA": "是",
"DmLxpf": "不等于",
@@ -389,9 +380,6 @@
"Aujn2T": "计数",
"ogKEiU": "出站链接",
"VLKK35": "点击次数",
- "uWvl2D": "VPN",
- "e6P9iT": "爬虫",
- "NoQGSk": "数据中心",
"6kvpmt": "过滤 {count} 个链接...",
"cegNe7": "出站链接",
"pEc/5k": "点击 %",
diff --git a/client/src/app/[site]/components/SubHeader/Export/exportCsv.ts b/client/src/app/[site]/components/SubHeader/Export/exportCsv.ts
index 3c9f08e7f..c9c216ec4 100644
--- a/client/src/app/[site]/components/SubHeader/Export/exportCsv.ts
+++ b/client/src/app/[site]/components/SubHeader/Export/exportCsv.ts
@@ -7,7 +7,6 @@ import {
} from "../../../../../api/analytics/endpoints";
import { getStartAndEndDate } from "../../../../../api/utils";
import { fetchGSCConnectionStatus, fetchGSCData, GSCDimension } from "../../../../../api/gsc/endpoints";
-import { IS_CLOUD } from "../../../../../lib/const";
import { CSVFile, downloadZip, formatDateForFilename } from "../../../../../lib/export";
import { Time } from "../../../../../components/DateSelector/types";
import { Filter } from "@rybbit/shared";
@@ -46,18 +45,6 @@ const COUNTRY_METRICS: { param: FilterParameter; filename: string }[] = [
{ param: "timezone", filename: "timezones.csv" },
];
-const NETWORK_METRICS: { param: FilterParameter; filename: string }[] = [
- { param: "vpn", filename: "vpn.csv" },
- { param: "crawler", filename: "crawlers.csv" },
- { param: "datacenter", filename: "datacenters.csv" },
- { param: "company", filename: "companies.csv" },
- { param: "company_type", filename: "company-types.csv" },
- { param: "company_domain", filename: "company-domains.csv" },
- { param: "asn_org", filename: "asn-orgs.csv" },
- { param: "asn_type", filename: "asn-types.csv" },
- { param: "asn_domain", filename: "asn-domains.csv" },
-];
-
const GSC_DIMENSIONS: { dimension: GSCDimension; filename: string }[] = [
{ dimension: "query", filename: "gsc-queries.csv" },
{ dimension: "page", filename: "gsc-pages.csv" },
@@ -90,7 +77,6 @@ export async function exportCsv({ site, time, filters, timeZone }: ExportCsvPara
...PAGE_METRICS,
...DEVICE_METRICS,
...COUNTRY_METRICS,
- ...(IS_CLOUD ? NETWORK_METRICS : []),
];
const metricPromises = allMetrics.map(async ({ param, filename }) => {
diff --git a/client/src/app/[site]/components/SubHeader/Filters/FilterComponent.tsx b/client/src/app/[site]/components/SubHeader/Filters/FilterComponent.tsx
index f969cfcaa..a7b29b90b 100644
--- a/client/src/app/[site]/components/SubHeader/Filters/FilterComponent.tsx
+++ b/client/src/app/[site]/components/SubHeader/Filters/FilterComponent.tsx
@@ -8,7 +8,6 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from ".
import { Tooltip, TooltipContent, TooltipTrigger } from "../../../../../components/ui/tooltip";
import { FilterOptions, StringOperatorOptions, NumericOperatorOptions, isNumericParameter } from "./const";
import { ValueSelect } from "./ValueSelect";
-import { IS_CLOUD } from "../../../../../lib/const";
// Validate regex pattern and return error message if invalid
function validateRegex(pattern: string): string | null {
@@ -75,24 +74,13 @@ export function FilterComponent({
case "lon": return t("Lon");
case "tag": return t("Tag");
case "timezone": return t("Timezone");
- case "vpn": return t("VPN");
- case "crawler": return t("Crawler");
- case "datacenter": return t("Datacenter");
- case "company": return t("Company");
- case "company_type": return t("Company Type");
- case "company_domain": return t("Company Domain");
- case "asn_org": return t("ASN Org");
- case "asn_type": return t("ASN Type");
- case "asn_domain": return t("ASN Domain");
default: return value;
}
};
const availableFilterOptions = availableFilters
- ? FilterOptions.filter(option => availableFilters?.includes(option.value)).filter(
- option => IS_CLOUD || !option.cloudOnly
- )
- : FilterOptions.filter(option => IS_CLOUD || !option.cloudOnly);
+ ? FilterOptions.filter(option => availableFilters?.includes(option.value))
+ : FilterOptions;
const isNumeric = isNumericParameter(filter.parameter);
const operatorOptions = isNumeric ? NumericOperatorOptions : StringOperatorOptions;
diff --git a/client/src/app/[site]/components/SubHeader/Filters/Filters.tsx b/client/src/app/[site]/components/SubHeader/Filters/Filters.tsx
index 8e00af3da..626c9d4bd 100644
--- a/client/src/app/[site]/components/SubHeader/Filters/Filters.tsx
+++ b/client/src/app/[site]/components/SubHeader/Filters/Filters.tsx
@@ -43,15 +43,6 @@ export function Filters({ availableFilters }: { availableFilters?: FilterParamet
case "lon": return t("Lon");
case "hostname": return t("Hostname");
case "timezone": return t("Timezone");
- case "vpn": return t("VPN");
- case "crawler": return t("Crawler");
- case "datacenter": return t("Datacenter");
- case "company": return t("Company");
- case "company_type": return t("Company Type");
- case "company_domain": return t("Company Domain");
- case "asn_org": return t("ASN Org");
- case "asn_type": return t("ASN Type");
- case "asn_domain": return t("ASN Domain");
case "tag": return t("Tag");
default: return parameter;
}
diff --git a/client/src/app/[site]/components/SubHeader/Filters/const.tsx b/client/src/app/[site]/components/SubHeader/Filters/const.tsx
index 6a84de793..4618b8bc4 100644
--- a/client/src/app/[site]/components/SubHeader/Filters/const.tsx
+++ b/client/src/app/[site]/components/SubHeader/Filters/const.tsx
@@ -2,8 +2,6 @@ import { FilterParameter } from "@rybbit/shared";
import {
AppWindow,
Brain,
- Bug,
- Building,
Clock,
FileText,
Flag,
@@ -23,8 +21,6 @@ import {
Puzzle,
Radio,
Search,
- Server,
- Shield,
TabletSmartphone,
Tag,
Target,
@@ -36,7 +32,6 @@ export const FilterOptions: {
label: string;
value: FilterParameter;
icon: React.ReactNode;
- cloudOnly?: boolean;
}[] = [
{
label: "Path",
@@ -183,60 +178,6 @@ export const FilterOptions: {
value: "timezone",
icon: <Clock className="h-4 w-4" />,
},
- {
- label: "VPN",
- value: "vpn",
- icon: <Shield className="h-4 w-4" />,
- cloudOnly: true,
- },
- {
- label: "Crawler",
- value: "crawler",
- icon: <Bug className="h-4 w-4" />,
- cloudOnly: true,
- },
- {
- label: "Datacenter",
- value: "datacenter",
- icon: <Server className="h-4 w-4" />,
- cloudOnly: true,
- },
- {
- label: "Company",
- value: "company",
- icon: <Building className="h-4 w-4" />,
- cloudOnly: true,
- },
- {
- label: "Company Type",
- value: "company_type",
- icon: <Building className="h-4 w-4" />,
- cloudOnly: true,
- },
- {
- label: "Company Domain",
- value: "company_domain",
- icon: <Building className="h-4 w-4" />,
- cloudOnly: true,
- },
- {
- label: "ASN Org",
- value: "asn_org",
- icon: <Building className="h-4 w-4" />,
- cloudOnly: true,
- },
- {
- label: "ASN Type",
- value: "asn_type",
- icon: <Building className="h-4 w-4" />,
- cloudOnly: true,
- },
- {
- label: "ASN Domain",
- value: "asn_domain",
- icon: <Building className="h-4 w-4" />,
- cloudOnly: true,
- },
];
export const OperatorOptions = [
diff --git a/client/src/app/[site]/components/SubHeader/Filters/utils.ts b/client/src/app/[site]/components/SubHeader/Filters/utils.ts
index 533ccac5d..19dbae5fc 100644
--- a/client/src/app/[site]/components/SubHeader/Filters/utils.ts
+++ b/client/src/app/[site]/components/SubHeader/Filters/utils.ts
@@ -59,24 +59,6 @@ export function getParameterNameLabel(parameter: FilterParameter) {
return "Hostname";
case "timezone":
return "Timezone";
- case "vpn":
- return "VPN";
- case "crawler":
- return "Crawler";
- case "datacenter":
- return "Datacenter";
- case "company":
- return "Company";
- case "company_type":
- return "Company Type";
- case "company_domain":
- return "Company Domain";
- case "asn_org":
- return "ASN Org";
- case "asn_type":
- return "ASN Type";
- case "asn_domain":
- return "ASN Domain";
case "tag":
return "Tag";
default:
diff --git a/client/src/app/[site]/components/shared/icons/Crawler.tsx b/client/src/app/[site]/components/shared/icons/Crawler.tsx
deleted file mode 100644
index 696181643..000000000
--- a/client/src/app/[site]/components/shared/icons/Crawler.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import { Bug } from "lucide-react";
-import Image from "next/image";
-
-const CRAWLER_TO_LOGO: Record<string, string> = {
- AhrefsBot: "Ahrefs.svg",
- BingBot: "Bing.svg",
- GoogleBot: "Google.svg",
- YandexBot: "Yandex.svg",
- Applebot: "Apple.svg",
- DuckDuckGoBot: "DuckDuckGo.svg",
- ByteSpider: "TikTok.svg",
- Baiduspider: "Baidu.svg",
- Twitterbot: "Twitter.svg",
-};
-
-export function Crawler({ crawler = "" }: { crawler?: string }) {
- return (
- <>
- {CRAWLER_TO_LOGO[crawler] ? (
- <Image
- src={`/crawlers/${CRAWLER_TO_LOGO[crawler]}`}
- alt={crawler || "Other"}
- className="w-4 h-4"
- width={16}
- height={16}
- />
- ) : (
- <Bug className="w-4 h-4" />
- )}
- </>
- );
-}
diff --git a/client/src/app/[site]/components/shared/icons/VPN.tsx b/client/src/app/[site]/components/shared/icons/VPN.tsx
deleted file mode 100644
index 8aa67079f..000000000
--- a/client/src/app/[site]/components/shared/icons/VPN.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { Shield } from "lucide-react";
-import Image from "next/image";
-
-const VPN_TO_LOGO: Record<string, string> = {
- AirVPN: "AirVPN.svg",
- NordVPN: "NordVPN.svg",
- Surfshark: "Surfshark.svg",
- ExpressVPN: "ExpressVPN.svg",
- "Private Internet Access": "PIA.svg",
- MullvadVPN: "Mullvad.svg",
- ProtonVPN: "ProtonVPN.svg",
-};
-
-export function VPN({ vpn = "" }: { vpn?: string }) {
- return (
- <>
- {VPN_TO_LOGO[vpn] ? (
- <Image src={`/vpns/${VPN_TO_LOGO[vpn]}`} alt={vpn || "Other"} className="w-4 h-4" width={16} height={16} />
- ) : (
- <Shield className="w-4 h-4" />
- )}
- </>
- );
-}
diff --git a/client/src/app/[site]/main/components/sections/Network.tsx b/client/src/app/[site]/main/components/sections/Network.tsx
deleted file mode 100644
index b7ef4f9f6..000000000
--- a/client/src/app/[site]/main/components/sections/Network.tsx
+++ /dev/null
@@ -1,194 +0,0 @@
-"use client";
-import { Expand } from "lucide-react";
-import { useExtracted } from "next-intl";
-import { useState } from "react";
-import { Favicon } from "../../../../../components/Favicon";
-import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../../../../components/ui/basic-tabs";
-import { Button } from "../../../../../components/ui/button";
-import { Card, CardContent } from "../../../../../components/ui/card";
-import { Crawler } from "../../../components/shared/icons/Crawler";
-import { VPN } from "../../../components/shared/icons/VPN";
-import { StandardSection } from "../../../components/shared/StandardSection/StandardSection";
-
-type Tab =
- | "vpn"
- | "crawler"
- | "datacenter"
- | "company"
- | "company_type"
- | "company_domain"
- | "asn_org"
- | "asn_type"
- | "asn_domain";
-
-export function Network() {
- const [tab, setTab] = useState<Tab>("vpn");
- const [expanded, setExpanded] = useState(false);
- const t = useExtracted();
- const close = () => {
- setExpanded(false);
- };
-
- return (
- <Card className="h-[405px]">
- <CardContent className="mt-2">
- <Tabs defaultValue="vpn" value={tab} onValueChange={value => setTab(value as Tab)}>
- <div className="flex flex-row gap-2 justify-between items-center">
- <div className="overflow-x-auto">
- <TabsList>
- <TabsTrigger value="vpn">{t("VPNs")}</TabsTrigger>
- <TabsTrigger value="crawler">{t("Crawlers")}</TabsTrigger>
- <TabsTrigger value="datacenter">{t("Datacenters")}</TabsTrigger>
- <TabsTrigger value="company">{t("Company")}</TabsTrigger>
- <TabsTrigger value="company_type">{t("Company Type")}</TabsTrigger>
- <TabsTrigger value="company_domain">{t("Company Domain")}</TabsTrigger>
- <TabsTrigger value="asn_org">{t("ASN Org")}</TabsTrigger>
- <TabsTrigger value="asn_type">{t("ASN Type")}</TabsTrigger>
- <TabsTrigger value="asn_domain">{t("ASN Domain")}</TabsTrigger>
- </TabsList>
- </div>
- <div className="w-7">
- <Button size="smIcon" onClick={() => setExpanded(!expanded)}>
- <Expand className="w-4 h-4" />
- </Button>
- </div>
- </div>
- <TabsContent value="vpn">
- <StandardSection
- filterParameter="vpn"
- title={t("VPN")}
- getValue={e => e.value}
- getKey={e => e.value}
- getFilterLabel={e => e.value}
- expanded={expanded}
- close={close}
- getLabel={e => {
- return (
- <div className="flex gap-2 items-center">
- <VPN vpn={e.value} />
- {e.value}
- </div>
- );
- }}
- />
- </TabsContent>
- <TabsContent value="crawler">
- <StandardSection
- filterParameter="crawler"
- title={t("Crawler")}
- getValue={e => e.value}
- getKey={e => e.value}
- getFilterLabel={e => e.value}
- expanded={expanded}
- close={close}
- getLabel={e => {
- return (
- <div className="flex gap-2 items-center">
- <Crawler crawler={e.value} />
- {e.value}
- </div>
- );
- }}
- />
- </TabsContent>
- <TabsContent value="datacenter">
- <StandardSection
- filterParameter="datacenter"
- title={t("Datacenter")}
- getValue={e => e.value}
- getKey={e => e.value}
- getFilterLabel={e => e.value}
- expanded={expanded}
- close={close}
- getLabel={e => e.value}
- />
- </TabsContent>
- <TabsContent value="company">
- <StandardSection
- filterParameter="company"
- title={t("Company")}
- getValue={e => e.value}
- getKey={e => e.value}
- getFilterLabel={e => e.value}
- expanded={expanded}
- close={close}
- getLabel={e => e.value}
- />
- </TabsContent>
- <TabsContent value="company_type">
- <StandardSection
- filterParameter="company_type"
- title={t("Company Type")}
- getValue={e => e.value}
- getKey={e => e.value}
- getFilterLabel={e => e.value}
- expanded={expanded}
- close={close}
- getLabel={e => e.value}
- />
- </TabsContent>
- <TabsContent value="company_domain">
- <StandardSection
- filterParameter="company_domain"
- title={t("Company Domain")}
- getValue={e => e.value}
- getKey={e => e.value}
- getFilterLabel={e => e.value}
- expanded={expanded}
- close={close}
- getLink={e => `https://${e.value}`}
- getLabel={e => (
- <div className="flex items-center">
- <Favicon domain={e.value} className="w-4 mr-2" />
- {e.value ? e.value : t("Unknown")}
- </div>
- )}
- />
- </TabsContent>
- <TabsContent value="asn_org">
- <StandardSection
- filterParameter="asn_org"
- title={t("ASN Org")}
- getValue={e => e.value}
- getKey={e => e.value}
- getFilterLabel={e => e.value}
- expanded={expanded}
- close={close}
- getLabel={e => e.value}
- />
- </TabsContent>
- <TabsContent value="asn_type">
- <StandardSection
- filterParameter="asn_type"
- title={t("ASN Type")}
- getValue={e => e.value}
- getKey={e => e.value}
- getFilterLabel={e => e.value}
- expanded={expanded}
- close={close}
- getLabel={e => e.value}
- />
- </TabsContent>
- <TabsContent value="asn_domain">
- <StandardSection
- filterParameter="asn_domain"
- title={t("ASN Domain")}
- getValue={e => e.value}
- getKey={e => e.value}
- getFilterLabel={e => e.value}
- expanded={expanded}
- close={close}
- getLink={e => `https://${e.value}`}
- getLabel={e => (
- <div className="flex items-center">
- <Favicon domain={e.value} className="w-4 mr-2" />
- {e.value ? e.value : t("Unknown")}
- </div>
- )}
- />
- </TabsContent>
- </Tabs>
- </CardContent>
- </Card>
- );
-}
diff --git a/client/src/app/[site]/main/page.tsx b/client/src/app/[site]/main/page.tsx
index a6d2909ac..0b8a6d4ad 100644
--- a/client/src/app/[site]/main/page.tsx
+++ b/client/src/app/[site]/main/page.tsx
@@ -10,7 +10,6 @@ import { MainSection } from "./components/MainSection/MainSection";
import { Countries } from "./components/sections/Countries";
import { Devices } from "./components/sections/Devices";
import { Events } from "./components/sections/Events";
-import { Network } from "./components/sections/Network";
import { Pages } from "./components/sections/Pages";
import { Referrers } from "./components/sections/Referrers";
import { SearchConsole } from "./components/sections/SearchConsole";
@@ -51,7 +50,6 @@ function MainPageContent() {
<LazySection><Countries /></LazySection>
<LazySection height="483px"><Events /></LazySection>
<LazySection><Weekdays /></LazySection>
- {IS_CLOUD && <LazySection><Network /></LazySection>}
{IS_CLOUD && <LazySection><SearchConsole /></LazySection>}
</div>
</div>
diff --git a/docker-compose.cloud.yml b/docker-compose.cloud.yml
index 4e9dea140..8092fe701 100644
--- a/docker-compose.cloud.yml
+++ b/docker-compose.cloud.yml
@@ -124,7 +124,6 @@ services:
- REDIS_PASSWORD=${REDIS_PASSWORD:-changeme}
- MAPBOX_TOKEN=${MAPBOX_TOKEN}
- TURNSTILE_SECRET_KEY=${TURNSTILE_SECRET_KEY}
- - IPAPI_KEY=${IPAPI_KEY}
- GOOGLE_REDIRECT_URI=${GOOGLE_REDIRECT_URI}
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY}
- OPENROUTER_MODEL=${OPENROUTER_MODEL}
diff --git a/server/src/api/analytics/utils/query-validation.ts b/server/src/api/analytics/utils/query-validation.ts
index 605a388cf..4a762eb9b 100644
--- a/server/src/api/analytics/utils/query-validation.ts
+++ b/server/src/api/analytics/utils/query-validation.ts
@@ -222,15 +222,6 @@ export const filterParamSchema = z.enum([
"lat",
"lon",
"timezone",
- "vpn",
- "crawler",
- "datacenter",
- "company",
- "company_type",
- "company_domain",
- "asn_org",
- "asn_type",
- "asn_domain",
"tag",
]);
diff --git a/server/src/db/clickhouse/clickhouse.ts b/server/src/db/clickhouse/clickhouse.ts
index 30d25ffdd..b9c29fdd6 100644
--- a/server/src/db/clickhouse/clickhouse.ts
+++ b/server/src/db/clickhouse/clickhouse.ts
@@ -63,31 +63,6 @@ export const initializeClickhouse = async () => {
`,
});
- if (IS_CLOUD) {
- await clickhouse.exec({
- query: `
- ALTER TABLE events
- ADD COLUMN IF NOT EXISTS company String DEFAULT '',
- ADD COLUMN IF NOT EXISTS company_domain String DEFAULT '',
- ADD COLUMN IF NOT EXISTS company_type LowCardinality(String) DEFAULT '',
- ADD COLUMN IF NOT EXISTS company_abuse_score Nullable(Float64),
-
- ADD COLUMN IF NOT EXISTS asn Nullable(UInt32),
- ADD COLUMN IF NOT EXISTS asn_org String DEFAULT '',
- ADD COLUMN IF NOT EXISTS asn_domain String DEFAULT '',
- ADD COLUMN IF NOT EXISTS asn_type LowCardinality(String) DEFAULT '',
- ADD COLUMN IF NOT EXISTS asn_abuse_score Nullable(Float64),
-
- ADD COLUMN IF NOT EXISTS vpn LowCardinality(String) DEFAULT '',
- ADD COLUMN IF NOT EXISTS crawler LowCardinality(String) DEFAULT '',
- ADD COLUMN IF NOT EXISTS datacenter LowCardinality(String) DEFAULT '',
- ADD COLUMN IF NOT EXISTS is_proxy Nullable(Boolean),
- ADD COLUMN IF NOT EXISTS is_tor Nullable(Boolean),
- ADD COLUMN IF NOT EXISTS is_satellite Nullable(Boolean)
- `,
- });
- }
-
// Create session replay tables
await clickhouse.exec({
query: `
diff --git a/server/src/db/geolocation/geolocation.ts b/server/src/db/geolocation/geolocation.ts
index bf0146203..038a0774b 100644
--- a/server/src/db/geolocation/geolocation.ts
+++ b/server/src/db/geolocation/geolocation.ts
@@ -2,16 +2,13 @@ import type { City } from "@maxmind/geoip2-node";
import { Reader } from "@maxmind/geoip2-node";
import { readFile } from "fs/promises";
import path from "path";
-import { IS_CLOUD } from "../../lib/const.js";
import { logger } from "../../lib/logger/logger.js";
-import { IPAPIResponse, LocationResponse } from "./types.js";
+import { LocationResponse } from "./types.js";
-// Adjust path to find the database relative to project root
const dbPath = path.join(process.cwd(), "GeoLite2-City.mmdb");
let reader: Reader | null = null;
-// Extend the Reader type to include the city method
interface ExtendedReader extends Reader {
city(ip: string): City;
}
@@ -24,7 +21,6 @@ async function loadDatabase(dbPath: string) {
await loadDatabase(dbPath);
-// Utility function to extract response data
function extractLocationData(response: City | null): LocationResponse {
if (!response) {
return null;
@@ -41,205 +37,14 @@ function extractLocationData(response: City | null): LocationResponse {
};
}
-const apiKey = process.env.IPAPI_KEY;
-
-// Cache configuration
-const CACHE_TTL_MS = 24 * 60 * 60 * 1000; // 24 hours in milliseconds
-const CLEANUP_INTERVAL_MS = 60 * 60 * 1000; // Run cleanup every hour
-
-interface CacheEntry {
- data: LocationResponse;
- timestamp: number;
-}
-
-// In-memory cache for IP geolocation data
-const ipCache = new Map<string, CacheEntry>();
-
-// Periodic cleanup function to remove expired entries
-function cleanupExpiredEntries(): void {
- const now = Date.now();
- let removedCount = 0;
-
- for (const [ip, entry] of ipCache.entries()) {
- const age = now - entry.timestamp;
- if (age > CACHE_TTL_MS) {
- ipCache.delete(ip);
- removedCount++;
- }
- }
-
- if (removedCount > 0) {
- logger.info(`Cleaned up ${removedCount} expired IP cache entries. Current cache size: ${ipCache.size}`);
- }
-}
-
-// Start periodic cleanup
-const cleanupInterval = setInterval(cleanupExpiredEntries, CLEANUP_INTERVAL_MS);
-
-// Cleanup on process exit
-process.on("SIGTERM", () => {
- clearInterval(cleanupInterval);
-});
-process.on("SIGINT", () => {
- clearInterval(cleanupInterval);
-});
-
-function getCachedIP(ip: string): LocationResponse | null {
- const entry = ipCache.get(ip);
- if (!entry) {
- return null;
- }
-
- const now = Date.now();
- const age = now - entry.timestamp;
-
- if (age > CACHE_TTL_MS) {
- // Entry expired, remove it
- ipCache.delete(ip);
- return null;
- }
-
- return entry.data;
-}
-
-function setCachedIP(ip: string, data: LocationResponse): void {
- ipCache.set(ip, {
- data,
- timestamp: Date.now(),
- });
-}
-
-async function getLocationFromIPAPI(ips: string[]): Promise<Record<string, LocationResponse>> {
- if (!apiKey) {
- logger.warn("IPAPI_KEY not configured for cloud geolocation");
- return {};
- }
-
- // Check cache first
+export async function getLocation(ips: string[]): Promise<Record<string, LocationResponse>> {
const results: Record<string, LocationResponse> = {};
- const uncachedIps: string[] = [];
-
- for (const ip of ips) {
- const cached = getCachedIP(ip);
- if (cached !== null) {
- results[ip] = cached;
- } else {
- uncachedIps.push(ip);
- }
- }
-
- // If all IPs were cached, return immediately
- if (uncachedIps.length === 0) {
- return results;
- }
-
- // logger.info(`Cache hit: ${ips.length - uncachedIps.length}/${ips.length}, fetching ${uncachedIps.length} from IPAPI`);
-
- const localInfo = await getLocationFromLocal(uncachedIps);
-
- // IPAPI has a limit of 100 IPs per request, so we need to batch them
- const BATCH_SIZE = 100;
- const batches: string[][] = [];
-
- for (let i = 0; i < uncachedIps.length; i += BATCH_SIZE) {
- batches.push(uncachedIps.slice(i, i + BATCH_SIZE));
- }
-
- try {
- // Process batches sequentially to avoid rate limiting
- for (const batch of batches) {
- const response = await fetch("https://api.ipapi.is/", {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify({
- ips: batch,
- key: apiKey,
- }),
- });
-
- if (!response.ok) {
- logger.error(
- `IPAPI request failed for batch of ${batch.length} IPs: ${response.status} ${response.statusText}`
- );
- continue; // Skip this batch but continue with others
- }
-
- const data = (await response.json()) as Record<string, IPAPIResponse>;
-
- for (const ip of batch) {
- const item = data[ip];
-
- if (!item) {
- continue;
- }
-
- const localInfo = await (reader as ExtendedReader).city(ip);
- const locationData: LocationResponse = {
- ...extractLocationData(localInfo),
- vpn: item.vpn?.service,
- crawler: typeof item.is_crawler === "string" ? item.is_crawler : undefined,
- datacenter: item.datacenter?.datacenter,
- isProxy: item.is_proxy,
- isTor: item.is_tor,
- isSatellite: item.is_satellite,
-
- company: {
- name: item.company?.name,
- domain: item.company?.domain,
- type: item.company?.type,
- abuseScore: Number(item.company?.abuser_score?.split(" ")[0]),
- },
-
- asn: {
- asn: item.asn?.asn,
- org: item.asn?.org,
- domain: item.asn?.domain,
- type: item.asn?.type,
- abuseScore: Number(item.asn?.abuser_score?.split(" ")[0]),
- },
- };
-
- // Cache the result
- setCachedIP(ip, locationData);
- results[ip] = locationData;
- }
+ for (const ip of new Set(ips)) {
+ try {
+ results[ip] = extractLocationData((reader as ExtendedReader).city(ip));
+ } catch {
+ results[ip] = null;
}
-
- return results;
- } catch (error) {
- logger.error(error, "Error fetching from IPAPI");
- return { ...results, ...localInfo };
}
-}
-
-async function getLocationFromLocal(ips: string[]): Promise<Record<string, LocationResponse>> {
- const responses = await Promise.all(
- ips.map(ip => {
- try {
- return (reader as ExtendedReader).city(ip);
- } catch (error) {
- return null;
- }
- })
- );
-
- const results: Record<string, LocationResponse> = {};
-
- responses.forEach((response, index) => {
- results[ips[index]] = extractLocationData(response);
- });
-
return results;
}
-
-export async function getLocation(ips: string[], useLocal?: boolean): Promise<Record<string, LocationResponse>> {
- const dedupedIps = [...new Set(ips)];
-
- if (IS_CLOUD && !useLocal) {
- return getLocationFromIPAPI(dedupedIps);
- }
-
- return getLocationFromLocal(dedupedIps);
-}
diff --git a/server/src/db/geolocation/types.ts b/server/src/db/geolocation/types.ts
index 3e4448a6e..07b4d9341 100644
--- a/server/src/db/geolocation/types.ts
+++ b/server/src/db/geolocation/types.ts
@@ -1,84 +1,3 @@
-export type IPAPIResponse = {
- ip: string;
- rir?: string;
- is_bogon?: boolean;
- is_mobile?: boolean;
- is_satellite?: boolean;
- is_crawler?: string | boolean;
- is_datacenter?: boolean;
- is_tor?: boolean;
- is_proxy?: boolean;
- is_vpn?: boolean;
- is_abuser?: boolean;
- elapsed_ms?: number;
- location?: {
- city?: string;
- country?: string;
- country_code?: string;
- latitude?: number;
- longitude?: number;
- timezone?: string;
- state?: string;
- continent?: string;
- continent_code?: string;
- postal_code?: string;
- zip?: string;
- region?: string;
- region_code?: string;
- };
- asn?: {
- asn?: number;
- abuser_score?: string;
- route?: string;
- descr?: string;
- country?: string;
- active?: boolean;
- org?: string;
- domain?: string;
- abuse?: string;
- type?: string;
- created?: string;
- updated?: string;
- rir?: string;
- whois?: string;
- };
- vpn?: {
- ip?: string;
- service?: string;
- url?: string;
- type?: string;
- last_seen?: number;
- last_seen_str?: string;
- exit_node_region?: string;
- country_code?: string;
- city_name?: string;
- latitude?: number;
- longitude?: number;
- };
- datacenter?: {
- datacenter?: string;
- network?: string;
- region?: string;
- country?: string;
- city?: string;
- };
- company?: {
- name?: string;
- abuser_score?: string;
- domain?: string;
- type?: string;
- network?: string;
- whois?: string;
- };
- abuse?: {
- name?: string;
- address?: string;
- country?: string;
- email?: string;
- phone?: string;
- };
-};
-
export type LocationResponse = {
city?: string;
country?: string;
@@ -87,27 +6,4 @@ export type LocationResponse = {
latitude?: number;
longitude?: number;
timeZone?: string;
- error?: string;
-
- vpn?: string;
- crawler?: string;
- datacenter?: string;
- isProxy?: boolean;
- isTor?: boolean;
- isSatellite?: boolean;
-
- company?: {
- name?: string;
- domain?: string;
- type?: string;
- abuseScore?: number;
- };
-
- asn?: {
- asn?: number;
- org?: string;
- domain?: string;
- type?: string;
- abuseScore?: number;
- };
} | null;
diff --git a/server/src/services/replay/trackingUtils.ts b/server/src/services/replay/trackingUtils.ts
index 11c5820b1..d9cd40bf7 100644
--- a/server/src/services/replay/trackingUtils.ts
+++ b/server/src/services/replay/trackingUtils.ts
@@ -37,7 +37,7 @@ export async function parseTrackingData(
// Parse user agent
const ua = UAParser(userAgent);
- const geoData = await getLocation([ipAddress], true);
+ const geoData = await getLocation([ipAddress]);
const countryCode = geoData?.[ipAddress]?.countryIso || "";
const regionCode = geoData?.[ipAddress]?.region || "";
diff --git a/server/src/services/tracker/pageviewQueue.ts b/server/src/services/tracker/pageviewQueue.ts
index 458144a1b..1498d9f1a 100644
--- a/server/src/services/tracker/pageviewQueue.ts
+++ b/server/src/services/tracker/pageviewQueue.ts
@@ -106,21 +106,6 @@ class PageviewQueue {
timezone: timezone,
tag: pv.tag || "",
import_id: null,
- company: dataForIp?.company?.name || "",
- company_domain: dataForIp?.company?.domain || "",
- company_type: dataForIp?.company?.type || "",
- company_abuse_score: dataForIp?.company?.abuseScore ?? null,
- asn: dataForIp?.asn?.asn || null,
- asn_org: dataForIp?.asn?.org || "",
- asn_domain: dataForIp?.asn?.domain || "",
- asn_type: dataForIp?.asn?.type || "",
- asn_abuse_score: dataForIp?.asn?.abuseScore ?? null,
- vpn: dataForIp?.vpn || "",
- crawler: dataForIp?.crawler || "",
- datacenter: dataForIp?.datacenter || "",
- is_proxy: dataForIp?.isProxy ?? null,
- is_tor: dataForIp?.isTor ?? null,
- is_satellite: dataForIp?.isSatellite ?? null,
};
});
diff --git a/shared/src/filters.ts b/shared/src/filters.ts
index 7339ffbea..245ee414f 100644
--- a/shared/src/filters.ts
+++ b/shared/src/filters.ts
@@ -37,15 +37,6 @@ export type FilterParameter =
| "lat"
| "lon"
| "timezone"
- | "vpn"
- | "crawler"
- | "datacenter"
- | "company"
- | "company_type"
- | "company_domain"
- | "asn_org"
- | "asn_type"
- | "asn_domain"
| "tag";
export interface Filter {