registered-sites/app/controllers/registered_sites_controller.rb

21 lines
588 B
Ruby
Raw Normal View History

2019-03-27 10:29:11 +00:00
class RegisteredSitesController < ApplicationController
def site_count_widget
2019-03-28 08:20:47 +00:00
count = RegisteredSite.count + 1800
2019-03-27 10:29:11 +00:00
{
"extras" => {
"total_sites" => count
}
}
end
2020-04-01 03:44:59 +00:00
def git_auth
user_ip = params['user_ip']
all_ips = RegisteredSite.all.collect{|v| [v.ip,v.real_ip]}.flatten.compact
puts user_ip
if all_ips.include?(user_ip) || user_ip == '118.163.60.152' || user_ip == '163.19.249.14' || user_ip == '203.72.2.177'
render :text=>'hello',:status=> 200
else
render :text=>'forbidden',:status=> 500
end
end
2019-03-27 10:29:11 +00:00
end