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

support allow_ua #2

Open
w796933 opened this issue Mar 27, 2021 · 1 comment
Open

support allow_ua #2

w796933 opened this issue Mar 27, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@w796933
Copy link

w796933 commented Mar 27, 2021

Will consider adding support in the future userAgent whitelist ?

@dbContext dbContext added the enhancement New feature or request label Apr 2, 2021
@w796933
Copy link
Author

w796933 commented Apr 14, 2021

sir . how to Prohibit search engine reverse detection ?
Because the dig command is blocking. Resulting in very low efficiency. Site 500 error.

if (string_find(useragent, "Googlebot") or 
	string_find(useragent, "bingbot") or 
	string_find(useragent, "Yahoo") or 
	string_find(useragent, "DuckDuckBot")) then
	
	local getHostname = io.popen("dig -x " .. remote_ip .. " +short")
	local resolvedHostname = getHostname:read("*a")
	getHostname:close()
	
	local getIP = io.popen("getent hosts " .. resolvedHostname)
	local resolvedIP = getIP:read("*a")
	getIP:close()
	
	if (string_find(resolvedHostname, "google.com") or 
		string_find(resolvedHostname, "googlebot.com") or 
		string_find(resolvedHostname, "search.msn.com") or 
		string_find(resolvedHostname, "crawl.yahoo.net") or 
		string_find(resolvedHostname, "duckduckbot.duckduckgo.com")) then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants