Skip to content

Commit

Permalink
➡️ enable fetching IPs for OpenAI bots (#162)
Browse files Browse the repository at this point in the history
See #131
  • Loading branch information
alaz authored Nov 17, 2024
1 parent c2b8111 commit e25384d
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions lib/legitbot/openai.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,47 @@
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
]
end

# 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
Expand Down

0 comments on commit e25384d

Please sign in to comment.