diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 067db12ee..9d4dd539b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -10,4 +10,10 @@ class ApplicationController < ActionController::Base "application" end end + + def authenticate_by_ip! + if request.remote_ip != APP_CONFIG['auth_by_ip'] + render :nothing => true, :status => 403 + end + end end diff --git a/app/controllers/build_lists_controller.rb b/app/controllers/build_lists_controller.rb index fb64cee4c..72163dc7c 100644 --- a/app/controllers/build_lists_controller.rb +++ b/app/controllers/build_lists_controller.rb @@ -1,5 +1,6 @@ class BuildListsController < ApplicationController - before_filter :authenticate_user! + before_filter :authenticate_user!, :except => [:status_build, :pre_build, :post_build, :circle_build, :new_bbdt] + before_filter :authenticate_by_ip!, :only => [:status_build, :pre_build, :post_build, :circle_build, :new_bbdt] before_filter :find_platform, :only => [:index, :filter, :show] before_filter :find_repository, :only => [:index, :filter, :show] before_filter :find_project, :only => [:index, :filter, :show]