From e25384df3395ff0c004b6666761a018ea96b9fed Mon Sep 17 00:00:00 2001 From: Alexander Azarov Date: Sun, 17 Nov 2024 09:20:55 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9E=A1=EF=B8=8F=20enable=20fetching=20IPs=20?= =?UTF-8?q?for=20OpenAI=20bots=20(#162)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See #131 --- lib/legitbot/openai.rb | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/lib/legitbot/openai.rb b/lib/legitbot/openai.rb index 417a8a1..3229017 100644 --- a/lib/legitbot/openai.rb +++ b/lib/legitbot/openai.rb @@ -3,10 +3,12 @@ module Legitbot # :nodoc: # https://platform.openai.com/docs/gptbot class GPTBot < BotMatch - # NOTE: fetching is disabled, see #131 - # @ fetch:url https://openai.com/gptbot.json + # @fetch:url https://openai.com/gptbot.json + # @fetch:jsonpath $.prefixes[*].ipv4Prefix ip_ranges %w[ + 4.227.36.0/25 20.171.206.0/24 + 20.171.207.0/24 52.230.152.0/24 52.233.106.0/24 ] @@ -14,28 +16,34 @@ class GPTBot < BotMatch # https://platform.openai.com/docs/bots class OpenAIChat < BotMatch - # NOTE: fetching is disabled, see #131 - # @ fetch:url https://openai.com/chatgpt-user.json + # @fetch:url https://openai.com/chatgpt-user.json + # @fetch:jsonpath $.prefixes[*].ipv4Prefix ip_ranges %w[ - 23.98.142.176/28 - 40.84.180.224/28 13.65.240.240/28 20.97.189.96/28 20.161.75.208/28 - 52.225.75.208/28 - 52.156.77.144/28 + 23.98.142.176/28 + 23.98.179.16/28 + 40.84.180.64/28 + 40.84.180.224/28 40.84.221.208/28 40.84.221.224/28 - 40.84.180.64/28 + 51.8.155.48/28 + 52.156.77.144/28 + 52.225.75.208/28 + 135.237.131.208/28 + 172.178.140.144/28 + 172.178.141.128/28 ] end # https://platform.openai.com/docs/bots class OpenAISearch < BotMatch - # NOTE: fetching is disabled, see #131 - # @ fetch:url https://openai.com/searchbot.json + # @fetch:url https://openai.com/searchbot.json + # @fetch:jsonpath $.prefixes[*].ipv4Prefix ip_ranges %w[ 20.42.10.176/28 + 51.8.102.0/24 172.203.190.128/28 ] end