1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00

Only force SSL in production

This commit is contained in:
Daniel Barber 2015-10-15 15:45:14 +01:00
parent 90988a4d26
commit 0fb938aa26
3 changed files with 2 additions and 14 deletions

View File

@ -4,15 +4,3 @@ DanBarberPhoto
[ ![Codeship Status for danbee/danbarberphoto](https://www.codeship.io/projects/bdd9fe40-63ad-0132-3763-76d0773b13a7/status)](https://www.codeship.io/projects/30798) [ ![Codeship Status for danbee/danbarberphoto](https://www.codeship.io/projects/bdd9fe40-63ad-0132-3763-76d0773b13a7/status)](https://www.codeship.io/projects/30798)
This is the source code for DanBarberPhoto.com. This is the source code for DanBarberPhoto.com.
The session cookie has been set to `secure: true` so the admin login will only
work over an HTTPS connection. Use the tunnels gem to proxy the development
server to HTTPS:
```bash
# If you're using pow
$ sudo tunnels
# If using rails server
$ sudo tunnels 443 3000
```

View File

@ -4,7 +4,7 @@ module Admin
before_filter :authenticate_admin_user! before_filter :authenticate_admin_user!
before_filter :admin_menu before_filter :admin_menu
force_ssl host: APP_CONFIG[:ssl_hostname] force_ssl host: APP_CONFIG[:ssl_hostname] if Rails.env.production?
def admin_menu def admin_menu
@admin_menu = { dashboard: '', @admin_menu = { dashboard: '',

View File

@ -1,6 +1,6 @@
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
DanBarberPhoto::Application.config.session_store :cookie_store, key: '_danbarberphoto_session', secure: true DanBarberPhoto::Application.config.session_store :cookie_store, key: '_danbarberphoto_session', secure: Rails.env.production?
# Use the database for sessions instead of the cookie-based default, # Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information # which shouldn't be used to store highly confidential information