Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable fetching IPs for OpenAI bots #162

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading