I am really not interested in getting error mails for crap like people scanning to see if I have some outdated version of phpmyadmin, roundcube, etc... the typical stuff hackers are will look for. So within my application controller before it sends me an e-mail, I want to search to see if it''s a valid ''controller'' that''s being requested before it actually sends me an error e-mail. Thus I need something like... if [ LIST_OF_MY_CONTROLLERS ].include?(params[:action]) how do I get a list of my controllers? Craig -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Craig White wrote:> I am really not interested in getting error mails for crap like people > scanning to see if I have some outdated version of phpmyadmin, > roundcube, etc... the typical stuff hackers are will look for. > > So within my application controller before it sends me an e-mail, I want > to search to see if it''s a valid ''controller'' that''s being requested > before it actually sends me an error e-mail. > > Thus I need something like... > > if [ LIST_OF_MY_CONTROLLERS ].include?(params[:action]) > > how do I get a list of my controllers? > > Craig > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean.I don''t know of a good way to list of all your app''s controllers (you *could* search for all Constants that descend from ApplicationController, but that seems prettttty grody). I''m *assuming* the emails are being sent from a rescue_from or somesuch similar in your ApplicationController... would it work for your requirements to instead just create a catchall route and then send a 404 error/page? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sun, 2010-02-14 at 03:23 +0100, Paul Harrington wrote:> Craig White wrote: > > I am really not interested in getting error mails for crap like people > > scanning to see if I have some outdated version of phpmyadmin, > > roundcube, etc... the typical stuff hackers are will look for. > > > > So within my application controller before it sends me an e-mail, I want > > to search to see if it''s a valid ''controller'' that''s being requested > > before it actually sends me an error e-mail. > > > > Thus I need something like... > > > > if [ LIST_OF_MY_CONTROLLERS ].include?(params[:action]) > > > > how do I get a list of my controllers? > >> I don''t know of a good way to list of all your app''s controllers (you > *could* search for all Constants that descend from > ApplicationController, but that seems prettttty grody). I''m *assuming* > the emails are being sent from a rescue_from or somesuch similar in your > ApplicationController... would it work for your requirements to instead > just create a catchall route and then send a 404 error/page?---- well I am certainly trying to deal with a ''rescue_from''. In essence, all the various crap that people scan web servers in hopes of finding exploitable software for are generating 404 errors...that''s to be expected. I just don''t want to see an e-mail if the URL''s they are requesting aren''t a controller in my application. Obviously I can provide a defined list of my controllers to this but that is rather analog and rails should be able to give me a list of my controllers or an array that I can flatten. Thanks Craig -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sat, 2010-02-13 at 22:16 -0700, Craig White wrote:> On Sun, 2010-02-14 at 03:23 +0100, Paul Harrington wrote: > > Craig White wrote: > > > I am really not interested in getting error mails for crap like people > > > scanning to see if I have some outdated version of phpmyadmin, > > > roundcube, etc... the typical stuff hackers are will look for. > > > > > > So within my application controller before it sends me an e-mail, I want > > > to search to see if it''s a valid ''controller'' that''s being requested > > > before it actually sends me an error e-mail. > > > > > > Thus I need something like... > > > > > > if [ LIST_OF_MY_CONTROLLERS ].include?(params[:action]) > > > > > > how do I get a list of my controllers? > > > > > > I don''t know of a good way to list of all your app''s controllers (you > > *could* search for all Constants that descend from > > ApplicationController, but that seems prettttty grody). I''m *assuming* > > the emails are being sent from a rescue_from or somesuch similar in your > > ApplicationController... would it work for your requirements to instead > > just create a catchall route and then send a 404 error/page? > ---- > well I am certainly trying to deal with a ''rescue_from''. > > In essence, all the various crap that people scan web servers in hopes > of finding exploitable software for are generating 404 errors...that''s > to be expected. > > I just don''t want to see an e-mail if the URL''s they are requesting > aren''t a controller in my application. > > Obviously I can provide a defined list of my controllers to this but > that is rather analog and rails should be able to give me a list of my > controllers or an array that I can flatten.---- this gets me awfully close... @conts = [] controllers = Dir.new("#{RAILS_ROOT}/app/controllers").entries controllers.each do |controller| if controller =~ /_controller/ and not controller.index("\.swp") then cont controller.gsub(".rb~","").gsub(".rb","").gsub("_controller","") @conts << [cont] end end and I can flatten @conts at that point and I could spend the time to toss .svn out but for now, I''m good. Craig -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.