Commit 0645fc42e2c7d10286c9216486c4aeb7ba4e41b5
Exists in
master
and in
29 other branches
Merge branch 'https' (transparent https support)
Showing
10 changed files
with
13 additions
and
11 deletions
Show diff stats
app/helpers/application_helper.rb
@@ -862,8 +862,9 @@ module ApplicationHelper | @@ -862,8 +862,9 @@ module ApplicationHelper | ||
862 | end | 862 | end |
863 | 863 | ||
864 | def base_url | 864 | def base_url |
865 | - environment.top_url | 865 | + environment.top_url(request.scheme) |
866 | end | 866 | end |
867 | + alias :top_url :base_url | ||
867 | 868 | ||
868 | def helper_for_article(article) | 869 | def helper_for_article(article) |
869 | article_helper = ActionView::Base.new | 870 | article_helper = ActionView::Base.new |
app/helpers/tinymce_helper.rb
@@ -11,7 +11,7 @@ module TinymceHelper | @@ -11,7 +11,7 @@ module TinymceHelper | ||
11 | end | 11 | end |
12 | 12 | ||
13 | def tinymce_init_js options = {} | 13 | def tinymce_init_js options = {} |
14 | - options.merge! :document_base_url => environment.top_url, | 14 | + options.merge! :document_base_url => top_url, |
15 | :content_css => "/stylesheets/tinymce.css,#{macro_css_files}", | 15 | :content_css => "/stylesheets/tinymce.css,#{macro_css_files}", |
16 | :plugins => %w[compat3x advlist autolink lists link image charmap print preview hr anchor pagebreak | 16 | :plugins => %w[compat3x advlist autolink lists link image charmap print preview hr anchor pagebreak |
17 | searchreplace wordcount visualblocks visualchars code fullscreen | 17 | searchreplace wordcount visualblocks visualchars code fullscreen |
app/models/environment.rb
@@ -657,8 +657,8 @@ class Environment < ActiveRecord::Base | @@ -657,8 +657,8 @@ class Environment < ActiveRecord::Base | ||
657 | { :controller => 'admin_panel', :action => 'index' } | 657 | { :controller => 'admin_panel', :action => 'index' } |
658 | end | 658 | end |
659 | 659 | ||
660 | - def top_url | ||
661 | - url = 'http://' | 660 | + def top_url(scheme = 'http') |
661 | + url = scheme + '://' | ||
662 | url << (Noosfero.url_options.key?(:host) ? Noosfero.url_options[:host] : default_hostname) | 662 | url << (Noosfero.url_options.key?(:host) ? Noosfero.url_options[:host] : default_hostname) |
663 | url << ':' << Noosfero.url_options[:port].to_s if Noosfero.url_options.key?(:port) | 663 | url << ':' << Noosfero.url_options[:port].to_s if Noosfero.url_options.key?(:port) |
664 | url << Noosfero.root('') | 664 | url << Noosfero.root('') |
app/views/enterprise_registration/basic_information.html.erb
@@ -20,7 +20,7 @@ | @@ -20,7 +20,7 @@ | ||
20 | 20 | ||
21 | <%= labelled_form_for :create_enterprise do |f| %> | 21 | <%= labelled_form_for :create_enterprise do |f| %> |
22 | <%= required f.text_field 'name', :onchange => "updateUrlField(this, 'create_enterprise_identifier')", :size => 40 %> | 22 | <%= required f.text_field 'name', :onchange => "updateUrlField(this, 'create_enterprise_identifier')", :size => 40 %> |
23 | - <%= required labelled_form_field(_('Address'), content_tag('code', environment.top_url + "/" + text_field(:create_enterprise, 'identifier', :size => 26))) %> | 23 | + <%= required labelled_form_field(_('Address'), content_tag('code', top_url + "/" + text_field(:create_enterprise, 'identifier', :size => 26))) %> |
24 | <%= render :partial => 'shared/organization_custom_fields', :locals => { :f => f, :object_name => :create_enterprise, :profile => @create_enterprise } %> | 24 | <%= render :partial => 'shared/organization_custom_fields', :locals => { :f => f, :object_name => :create_enterprise, :profile => @create_enterprise } %> |
25 | <%= required labelled_form_field(_('Region'), f.select('region_id', @regions)) if @validation == :region %> | 25 | <%= required labelled_form_field(_('Region'), f.select('region_id', @regions)) if @validation == :region %> |
26 | 26 |
app/views/layouts/application-ng.html.erb
@@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
14 | 14 | ||
15 | <!-- Open Graph --> | 15 | <!-- Open Graph --> |
16 | <meta property="og:type" content="<%= @page ? 'article' : 'website' %>"> | 16 | <meta property="og:type" content="<%= @page ? 'article' : 'website' %>"> |
17 | - <meta property="og:url" content="<%= @page ? url_for(@page.url) : @environment.top_url %>"> | 17 | + <meta property="og:url" content="<%= @page ? url_for(@page.url) : top_url %>"> |
18 | <meta property="og:title" content="<%= h page_title %>"> | 18 | <meta property="og:title" content="<%= h page_title %>"> |
19 | <meta property="og:site_name" content="<%= profile ? profile.name : @environment.name %>"> | 19 | <meta property="og:site_name" content="<%= profile ? profile.name : @environment.name %>"> |
20 | <meta property="og:description" content="<%= meta_description_tag(@page) %>"> | 20 | <meta property="og:description" content="<%= meta_description_tag(@page) %>"> |
app/views/layouts/application.html.erb
@@ -68,7 +68,7 @@ | @@ -68,7 +68,7 @@ | ||
68 | 68 | ||
69 | <div id="navigation_bar"> | 69 | <div id="navigation_bar"> |
70 | <%= link_to "<span>"+ @environment.name() +"</span>", | 70 | <%= link_to "<span>"+ @environment.name() +"</span>", |
71 | - @environment.top_url, | 71 | + top_url, |
72 | :id=>"menu_link_to_envhome", | 72 | :id=>"menu_link_to_envhome", |
73 | :title=>@environment.name %> | 73 | :title=>@environment.name %> |
74 | <% unless environment.enabled?(:disable_categories) %> | 74 | <% unless environment.enabled?(:disable_categories) %> |
etc/pound.cfg
@@ -23,6 +23,7 @@ End | @@ -23,6 +23,7 @@ End | ||
23 | 23 | ||
24 | ListenHTTPS | 24 | ListenHTTPS |
25 | Address 0.0.0.0 | 25 | Address 0.0.0.0 |
26 | + AddHeader "X-Forwarded-Proto: https" | ||
26 | Port 443 | 27 | Port 443 |
27 | Cert "/etc/noosfero/ssl/noosfero.pem" | 28 | Cert "/etc/noosfero/ssl/noosfero.pem" |
28 | Ciphers "ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM" | 29 | Ciphers "ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM" |
plugins/bsc/views/shared/_fields.html.erb
@@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
31 | <%= hidden_field_tag 'old_bsc_identifier', profile.identifier %> | 31 | <%= hidden_field_tag 'old_bsc_identifier', profile.identifier %> |
32 | <div id="bsc-formitem"> | 32 | <div id="bsc-formitem"> |
33 | <%= content_tag('code', | 33 | <%= content_tag('code', |
34 | - environment.top_url + '/ ' + | 34 | + top_url + '/ ' + |
35 | text_field(:profile_data, :identifier, :onchange => "warn_value_change()", :size => 25) | 35 | text_field(:profile_data, :identifier, :onchange => "warn_value_change()", :size => 25) |
36 | ) + | 36 | ) + |
37 | content_tag('div', | 37 | content_tag('div', |
public/designs/themes/noosfero/site_title.html.erb
public/designs/themes/profile-base/site_title.html.erb
1 | <% if File.exists?(File.join(Rails.root, 'public', "/designs/themes/#{environment.theme}/images/thin-logo.png")) %> | 1 | <% if File.exists?(File.join(Rails.root, 'public', "/designs/themes/#{environment.theme}/images/thin-logo.png")) %> |
2 | - <%= link_to(image_tag("/designs/themes/#{environment.theme}/images/thin-logo.png"), environment.top_url) %> | 2 | + <%= link_to(image_tag("/designs/themes/#{environment.theme}/images/thin-logo.png"), top_url) %> |
3 | <% else %> | 3 | <% else %> |
4 | - <%= link_to(image_tag("/designs/themes/noosfero/images/thin-logo.png"), environment.top_url) %> | 4 | + <%= link_to(image_tag("/designs/themes/noosfero/images/thin-logo.png"), top_url) %> |
5 | <% end %> | 5 | <% end %> |