Feature #117

Add SSL redirection

Added by Ohad Levy about 5 years ago. Updated about 5 years ago.

Status:ClosedStart date:12/07/2009
Priority:NormalDue date:
Assigned To:Ohad Levy% Done:

100%

Category:Web Interface
Target version:0.1-3
Difficulty: Bugzilla link:
Found in release: Pull request:
Story points-
Velocity based estimate-

Description

It should be possible to enable foreman on SSL ports.
however, kickstart (and maybe others) must work on port 80.
therefore, Foreman should be able to redirect the correct traffic to SSL ports when enabled.

0001-Require-SSL-for-hosts-controller.patch Magnifier (9.04 KB) Frank Sweetser, 12/10/2009 06:23 PM

Associated revisions

Revision 6c6713de
Added by Ohad Levy about 5 years ago

fixes #117 - Add SSL redirection

History

#1 Updated by Frank Sweetser about 5 years ago

http://agilewebdevelopment.com/plugins/ssl_requirement looks like a good fit. I'll play around with it and post any good results.

#2 Updated by Frank Sweetser about 5 years ago

Here's the code, applied to just the hosts controller only. Let me know if this looks reasonable, and I'll do a first pass at expanding it to the rest of the application.

#3 Updated by Ohad Levy about 5 years ago

I was actully thinking about something (that I think is ) simpliar - e.g. in the application control have:

def switch_to_https
    if request.host=~/localhost|127.0.0.1|test\.host|www.example.com/
      return true
    else
      if request.protocol != 'https' and not request.ssl?
        redirect_to :protocol => 'https'
      end
    end
    true
  end

and then in each controller, where you don't want to force ssl, e.g. in the unattended controller:

  before_filter :require_login, :switch_to_https, :except => :kickstart

#4 Updated by Ohad Levy about 5 years ago

  • Status changed from New to Ready For Testing
  • % Done changed from 0 to 100

#5 Updated by Ohad Levy about 5 years ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF