From 1533a1163c708927ccdaed5dac0e9d8f02566c59 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 9 Jan 2014 10:51:38 +1100 Subject: [PATCH] use_ssl is just confusing, it means use_https , fix name of setting --- app/models/site_setting.rb | 2 +- config/locales/server.cs.yml | 1 - config/locales/server.da.yml | 1 - config/locales/server.de.yml | 1 - config/locales/server.en.yml | 2 +- config/locales/server.es.yml | 1 - config/locales/server.fr.yml | 1 - config/locales/server.id.yml | 1 - config/locales/server.it.yml | 1 - config/locales/server.ja.yml | 1 - config/locales/server.ko.yml | 1 - config/locales/server.nl.yml | 1 - config/locales/server.pseudo.yml | 2 -- config/locales/server.pt.yml | 1 - config/locales/server.pt_BR.yml | 1 - config/locales/server.ru.yml | 1 - config/locales/server.sv.yml | 1 - config/locales/server.zh_CN.yml | 2 +- config/locales/server.zh_TW.yml | 1 - config/site_settings.yml | 2 +- lib/discourse.rb | 2 +- lib/file_store/s3_store.rb | 2 +- lib/tasks/cdn.rake | 4 ++-- spec/components/discourse_spec.rb | 10 +++++----- spec/models/site_setting_spec.rb | 4 ++-- 25 files changed, 15 insertions(+), 32 deletions(-) diff --git a/app/models/site_setting.rb b/app/models/site_setting.rb index c04b7a28e..840516519 100644 --- a/app/models/site_setting.rb +++ b/app/models/site_setting.rb @@ -85,7 +85,7 @@ class SiteSetting < ActiveRecord::Base end def self.scheme - use_ssl? ? "https" : "http" + use_https? ? "https" : "http" end end diff --git a/config/locales/server.cs.yml b/config/locales/server.cs.yml index b99d168e7..d212012bf 100644 --- a/config/locales/server.cs.yml +++ b/config/locales/server.cs.yml @@ -513,7 +513,6 @@ cs: notification_email: "Návratová emailová adresa, která se použije u systémových emailů, jako jsou notifikace o zapomenutém heslu, nových účtech, atd." email_custom_headers: "Seznam vlastních hlaviček emailů, oddělený svislítkem" - use_ssl: "Má být web přístupný přes SSL? (NEPODPOROVÁNO, EXPERIMENTÁLNÍ FUNKCE)" summary_score_threshold: "Minimální skóre příspěvku, aby byl zařazen mezi 'nejlepší'" summary_posts_required: "Minimální počet příspěvků v tématu, aby byl povolen mód 'nejlepší příspěvky'" summary_likes_required: "Minimální počet 'líbí se' v tématu, aby byl povolen mód 'nejlepší příspěvky'" diff --git a/config/locales/server.da.yml b/config/locales/server.da.yml index 57761a7de..3809a7ba4 100644 --- a/config/locales/server.da.yml +++ b/config/locales/server.da.yml @@ -567,7 +567,6 @@ da: notification_email: "Afsenderadressen som bruges til afsendelse af system-e-mails, som f.eks. beskeder til brugere om mistede adgangskoder, nye konti, etc." email_custom_headers: "En liste af brugerdefinerede e-mail-headers adskilt af |-tegn." - use_ssl: "Skal sitet være tilgængeligt via SSL? (IKKE IMPLEMENTERET, EKSPERIMENTELT)" summary_score_threshold: "Den mindste score for at et indlæg medtages i 'resuméet'." summary_posts_required: "Mindste antal indlæg i et emne før 'resumé'-tilstand aktiveres." summary_likes_required: "Mindste antal likes i et emne før 'resumé'-tilstand aktiveres." diff --git a/config/locales/server.de.yml b/config/locales/server.de.yml index d2c476622..6c4896675 100644 --- a/config/locales/server.de.yml +++ b/config/locales/server.de.yml @@ -486,7 +486,6 @@ de: notification_email: "Die Antwortadresse, die in Systemmails (zum Beispiel zur Passwortwiederherstellung, neuen Konten, etc.) eingetragen wird." email_custom_headers: "Eine Pipe-getrennte (|) Liste von eigenen Mail Headern" - use_ssl: "Soll die Seite via SSL nutzbar sein?" summary_score_threshold: "Der Minimalscore eines Beitrags, um zu den Top Beiträgen zu zählen." summary_posts_required: "Minimale Zahl der Beiträge zu einem Thema bevor der Modus 'Top Beiträge' aktiviert wird." summary_likes_required: "Minimale Zahl der „Gefällt mir“ in einem Thema, bevor der Modus 'Top Beiträge' aktiviert wird." diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index ee3cad224..fda9b980b 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -564,7 +564,7 @@ en: notification_email: "The return email address used when sending system emails such as notifying users of lost passwords, new accounts etc" email_custom_headers: "A pipe-delimited list of custom email headers" - use_ssl: "Should the full url for the site (Discourse.base_url) be http or https?" + use_https: "Should the full url for the site (Discourse.base_url) be http or https?" summary_score_threshold: "The minimum score of a post to be included in the 'summary'" summary_posts_required: "Minimum posts in a topic before 'summary' mode is enabled" summary_likes_required: "Minimum likes in a topic before the 'summary' mode will be enabled" diff --git a/config/locales/server.es.yml b/config/locales/server.es.yml index 7b2b7448a..bcc216217 100644 --- a/config/locales/server.es.yml +++ b/config/locales/server.es.yml @@ -311,7 +311,6 @@ es: logo_small_url: "El pequeño logo para tu sitio utilizado cuando se hace scroll en un topic ej: http://example.com/logo-small.png" favicon_url: "Un favicon para tu sitio, ve http://en.wikipedia.org/wiki/Favicon" notification_email: "La dirección de emaul de respuesta utilizada cuando se envían emails del sistema tales como notificar a los usuarios de recuperación de contraseña, nuevas cuentas etc" - use_ssl: "¿Debería ser el sitio accesible por SSL? (NO IMPLEMENTADO, EXPERIMENTAL)" summary_score_threshold: "La mínima puntuación de un post para ser incluido en los 'summary'" summary_posts_required: "Mínimo número de posts en un topic antes de que el modo 'summary' sea activado " summary_likes_required: "Mínimo número de me gustas en un topic antes de que el modo 'summary' sea activado" diff --git a/config/locales/server.fr.yml b/config/locales/server.fr.yml index ba13b42f5..4dadf021b 100644 --- a/config/locales/server.fr.yml +++ b/config/locales/server.fr.yml @@ -500,7 +500,6 @@ fr: apple_touch_icon_url: "Icône utilisée pour les appareils d'Apple. Taille recommandée 144 px par 144 px." notification_email: "L'adresse email utilisée pour notifier les utilisateurs de mots de passe perdus, d'activation de compte, etc." email_custom_headers: "Une liste délimité par des (|) pipes d'entêtes d'email" - use_ssl: "Le site doit-il être accessible via SSL? (NON IMPLEMENTE, EXPERIMENTAL)" summary_score_threshold: "Le score minimum d'un message pour être inclus dans le «résumé»" summary_posts_required: "Nombre minimum de messages dans une discussion avant que le mode «résumé» soit activé" summary_likes_required: "Nombre de J'aime minimum dans une discussion avant que le mode «Résumé» soit activé" diff --git a/config/locales/server.id.yml b/config/locales/server.id.yml index 9b56c8b92..e731261e8 100644 --- a/config/locales/server.id.yml +++ b/config/locales/server.id.yml @@ -321,7 +321,6 @@ id: logo_small_url: "The small logo for your site used when scrolling down on topics eg: http://example.com/logo-small.png" favicon_url: "A favicon for your site, see http://en.wikipedia.org/wiki/Favicon" notification_email: "The return email address used when sending system emails such as notifying users of lost passwords, new accounts etc" - use_ssl: "Should the site be accessible via SSL? (NOT IMPLEMENTED, EXPERIMENTAL)" summary_score_threshold: "The minimum score of a post to be included in the 'summary'" summary_posts_required: "Minimum posts in a topic before 'summary' mode is enabled" summary_likes_required: "Minimum likes in a topic before the 'summary' mode will be enabled" diff --git a/config/locales/server.it.yml b/config/locales/server.it.yml index dbe06b2d9..8301e58c1 100644 --- a/config/locales/server.it.yml +++ b/config/locales/server.it.yml @@ -440,7 +440,6 @@ it: logo_small_url: "La versione piccola del logo del tuo sito (usata durante lo scroll) es: http://example.com/logo-small.png" favicon_url: "La favicon del tuo sito, per informazioni http://en.wikipedia.org/wiki/Favicon" notification_email: "L'indirizzo email usato quando vengono inviate email di sistema come la notifica agli utenti di recupero password o nuovo account" - use_ssl: "Il sito è accessibile tramite SSL?" summary_score_threshold: "Il punteggio minimo di un post per essere inserito nei 'summary'" summary_posts_required: "Numero di post in un topic prima che la modalità 'summary' venga attivata" summary_likes_required: "Numero minimo di likes in un topic prima che la modalità 'summary' venga attivata" diff --git a/config/locales/server.ja.yml b/config/locales/server.ja.yml index 898719618..704a1c83e 100644 --- a/config/locales/server.ja.yml +++ b/config/locales/server.ja.yml @@ -506,7 +506,6 @@ ja: notification_email: "パスワードリセットや新規アカウント作成等をユーザに通知するシステムメールを送信するメールアドレス" email_custom_headers: "カスタムメールヘッダのリスト (パイプ(バーティカルバー) 区切り)" - use_ssl: "SSL でのアクセスを有効にするか? (未実装、試験的)" best_of_score_threshold: "'best of' にポストが含まれるための最終スコア" best_of_posts_required: "'best of' モードが有効になる、トピック内の最小ポスト数" best_of_likes_required: "'best of' モードが有効になる、トピック内の最小「いいね!」数" diff --git a/config/locales/server.ko.yml b/config/locales/server.ko.yml index 21e4c0994..e2b9264be 100644 --- a/config/locales/server.ko.yml +++ b/config/locales/server.ko.yml @@ -520,7 +520,6 @@ ko: notification_email: "The return email address used when sending system emails such as notifying users of lost passwords, new accounts etc" email_custom_headers: "커스텀 이메일 해더의 pipe-delimited" - use_ssl: "Should the site be accessible via SSL? (NOT IMPLEMENTED, EXPERIMENTAL)" best_of_score_threshold: "The minimum score of a post to be included in the 'best of'" best_of_posts_required: "Minimum posts in a topic before 'best of' mode is enabled" best_of_likes_required: "Minimum likes in a topic before the 'best of' mode will be enabled" diff --git a/config/locales/server.nl.yml b/config/locales/server.nl.yml index 2e180f2aa..1f060be0c 100644 --- a/config/locales/server.nl.yml +++ b/config/locales/server.nl.yml @@ -532,7 +532,6 @@ nl: notification_email: "Het afzenderadres dat wordt gebruikt voor mails waarmee leden op de hoogte worden gesteld van verloren wachtwoorden, nieuwe accounts etc." email_custom_headers: "Een lijst van custom email headers, gescheiden door een pipe (|)" - use_ssl: "Moet de site toegankelijk zijn via SSL? (NOG NIET GEIMPLEMENTEERD, EXPERIMENTEEL)" summary_score_threshold: "De minimumscore van bericht om inbegrepen te worden in de samenvatting" summary_posts_required: "Minimum aantal berichten nodig in een topic voordat de samenvattingsmodus mogelijk wordt." summary_likes_required: "Minimum aantal 'vind ik leuk' nodig voordat de samenvattingsmodus mogelijk wordt." diff --git a/config/locales/server.pseudo.yml b/config/locales/server.pseudo.yml index 3f18132cb..b8cbb9a6d 100644 --- a/config/locales/server.pseudo.yml +++ b/config/locales/server.pseudo.yml @@ -657,8 +657,6 @@ pseudo: notification_email: '[[ Ťĥé řéťůřɳ éɱáíł áďďřéšš ůšéď ŵĥéɳ šéɳďíɳǧ šýšťéɱ éɱáíłš šůčĥ áš ɳóťíƒýíɳǧ ůšéřš óƒ łóšť ƿáššŵóřďš, ɳéŵ áččóůɳťš éťč ]]' email_custom_headers: '[[ Á ƿíƿé-ďéłíɱíťéď łíšť óƒ čůšťóɱ éɱáíł ĥéáďéřš ]]' - use_ssl: '[[ Šĥóůłď ťĥé šíťé ƀé áččéššíƀłé νíá ŠŠŁ? (ЍÓŤ ÍϺРŁÉϺÉЍŤÉĎ, ÉХРÉŘÍϺÉЍŤÁŁ) - ]]' summary_score_threshold: '[[ Ťĥé ɱíɳíɱůɱ ščóřé óƒ á ƿóšť ťó ƀé íɳčłůďéď íɳ ťĥé ''šůɱɱářý'' ]]' summary_posts_required: '[[ Ϻíɳíɱůɱ ƿóšťš íɳ á ťóƿíč ƀéƒóřé ''šůɱɱářý'' ɱóďé íš diff --git a/config/locales/server.pt.yml b/config/locales/server.pt.yml index 77cebe0aa..acd0cc419 100644 --- a/config/locales/server.pt.yml +++ b/config/locales/server.pt.yml @@ -262,7 +262,6 @@ pt: logo_small_url: "O logo em pequeno para o teu site (aparece nas páginas dos tópicos) eg: http://example.com/logo-small.png" favicon_url: "Um favicon para o teu site" notification_email: "O endereço de email a ser usado para notificar os utilizadores de password esquecida, novas contas, etc." - use_ssl: "Deverá o site estár acessivel via SSL?" summary_score_threshold: "A pontuação mínima de um post para ser incluído no 'melhor de'" summary_posts_required: "Um tópico precisa deste número de posts antes de ser ativado o modo 'melhor de'." summary_likes_required: "Um tópico precisa deste número de gostos antes de ser ativado o mode 'melhor de'." diff --git a/config/locales/server.pt_BR.yml b/config/locales/server.pt_BR.yml index 78a41f287..4b14c7a6b 100644 --- a/config/locales/server.pt_BR.yml +++ b/config/locales/server.pt_BR.yml @@ -512,7 +512,6 @@ pt_BR: notification_email: "O endereço de email a ser usado para notificar os utilizadores de password esquecida, novas contas, etc." email_custom_headers: "A lista delimitada por barras verticais de cabeçalhos de e-mail personalizados" - use_ssl: "O site deve ser acessível via SSL?" summary_score_threshold: "A pontuação mínima de uma postagem para ser incluído no 'melhor de'" summary_posts_required: "Um tópico precisa deste número de posts antes de ser ativado o modo 'melhor de'." summary_likes_required: "Um tópico precisa deste número de curtidas antes de ser ativado o modo 'melhor de'." diff --git a/config/locales/server.ru.yml b/config/locales/server.ru.yml index ce174d9dd..637ed136d 100644 --- a/config/locales/server.ru.yml +++ b/config/locales/server.ru.yml @@ -526,7 +526,6 @@ ru: apple_touch_icon_url: 'Иконка используемая для тач-устройств Apple. Рекомендуемый размер 144 x 144 px.' notification_email: 'Обратный электронный адрес, используемый для отправки системных электронных писем пользователям, таких как оповещение пользователей о потерянном пароле, новой учетной записи и т.д.' email_custom_headers: 'Разделенный чертой список дополнительных заголовков в почтовых сообщениях' - use_ssl: 'Будет ли сайт доступен по SSL? (НЕ РЕАЛИЗОВАНО, ЭКСПЕРИМЕНТАЛЬНАЯ ФУНКЦИЯ)' summary_score_threshold: 'Минимальная оценка сообщения, чтобы оно было включено в список «лучших сообщений»' summary_posts_required: 'Минимальное количество сообщений в теме для активации режима «лучшие»' summary_likes_required: 'Минимальное количество симпатий в теме для активации режима «лучшие»' diff --git a/config/locales/server.sv.yml b/config/locales/server.sv.yml index d629b4fc8..3b5e4989b 100644 --- a/config/locales/server.sv.yml +++ b/config/locales/server.sv.yml @@ -363,7 +363,6 @@ sv: logo_small_url: "Den lilla logotypen för din webbplats som används när man bläddrar ner i trådar t.ex.: http://xyz.com/x-small.png" favicon_url: "En favicon för till webbplats, se http://en.wikipedia.org/wiki/Favicon" notification_email: "Avsändaradressen som används vid utskick av systemmail som t.ex. glömt lösenord, nya konton etc" - use_ssl: "Ska denna webbplats vara åtkomlig via SSL?" summary_score_threshold: "The minimum score of a post to be included in the 'summary'" summary_posts_required: "Minimum posts in a topic before 'summary' mode is enabled" summary_likes_required: "Minimum likes in a topic before the 'summary' mode will be enabled" diff --git a/config/locales/server.zh_CN.yml b/config/locales/server.zh_CN.yml index 2afea9380..a93ec7ff1 100644 --- a/config/locales/server.zh_CN.yml +++ b/config/locales/server.zh_CN.yml @@ -459,7 +459,7 @@ zh_CN: logo_small_url: "你的站点的小号标志图片,例如:http://example.com/logo-small.png,用于卷起主题列表时显示" favicon_url: "你的站点图标(favicon),参考 http://zh.wikipedia.org/wiki/Favicon" notification_email: "邮件回复地址,当发送系统邮件,例如通知用户找回密码、新用户注册等等时,所使用的发信人地址" - use_ssl: "使用 SSL 安全套接层来访问本站吗?" + use_https: "使用 SSL 安全套接层来访问本站吗?" summary_score_threshold: "将一个帖子包含到“优秀”帖子中所需的最小分值" summary_posts_required: "在一个主题中启用“优秀”模式所要求的最小帖子数量" summary_likes_required: "在一个主题中启用“优秀”模式所要求的最小赞数量" diff --git a/config/locales/server.zh_TW.yml b/config/locales/server.zh_TW.yml index 05f964544..98e9be9e0 100644 --- a/config/locales/server.zh_TW.yml +++ b/config/locales/server.zh_TW.yml @@ -440,7 +440,6 @@ zh_TW: logo_small_url: "你的站點的小號標志圖片,例如:http://example.com/logo-small.png,用于卷起主題列表時顯示" favicon_url: "你的站點圖標(favicon),參考 http://zh.wikipedia.org/wiki/Favicon" notification_email: "郵件回複地址,當發送系統郵件,例如通知用戶找回密碼、新用戶注冊等等時,所使用的發信人地址" - use_ssl: "使用 SSL 安全套接層來訪問本站嗎?" summary_score_threshold: "將一個帖子包含到“優秀”帖子中所需的最小分值" summary_posts_required: "在一個主題中啓用“優秀”模式所要求的最小帖子數量" summary_likes_required: "在一個主題中啓用“優秀”模式所要求的最小贊數量" diff --git a/config/site_settings.yml b/config/site_settings.yml index 58799f58f..29d45b54e 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -292,7 +292,7 @@ trust: security: enable_flash_video_onebox: false - use_ssl: false + use_https: false enable_escaped_fragments: client: true default: false diff --git a/lib/discourse.rb b/lib/discourse.rb index bd1622d3d..b150d61ad 100644 --- a/lib/discourse.rb +++ b/lib/discourse.rb @@ -107,7 +107,7 @@ module Discourse default_port = 80 protocol = "http" - if SiteSetting.use_ssl? + if SiteSetting.use_https? protocol = "https" default_port = 443 end diff --git a/lib/file_store/s3_store.rb b/lib/file_store/s3_store.rb index 4590ca783..1deb834d6 100644 --- a/lib/file_store/s3_store.rb +++ b/lib/file_store/s3_store.rb @@ -115,7 +115,7 @@ module FileStore aws_secret_access_key: SiteSetting.s3_secret_access_key, scheme: SiteSetting.scheme, # cf. https://github.com/fog/fog/issues/2381 - path_style: dns_compatible?(s3_bucket, SiteSetting.use_ssl?), + path_style: dns_compatible?(s3_bucket, SiteSetting.use_https?), } options[:region] = SiteSetting.s3_region unless SiteSetting.s3_region.empty? options diff --git a/lib/tasks/cdn.rake b/lib/tasks/cdn.rake index 49628b2c4..c9b793cbf 100644 --- a/lib/tasks/cdn.rake +++ b/lib/tasks/cdn.rake @@ -6,13 +6,13 @@ task 'assets:prestage' => :environment do |t| require "uri" def get_assets(path) - a = Dir.glob("#{Rails.root}/public/assets/#{path}*").map do |f| + Dir.glob("#{Rails.root}/public/assets/#{path}*").map do |f| if f =~ /[a-f0-9]{16}\.(css|js)$/ "/assets/#{path}#{f.split('/')[-1]}" end end.compact end - + # pre-stage css/js only for now assets = get_assets("locales/") + get_assets("") puts "pre staging: #{assets.join(' ')}" diff --git a/spec/components/discourse_spec.rb b/spec/components/discourse_spec.rb index e5a287be1..7c93e1861 100644 --- a/spec/components/discourse_spec.rb +++ b/spec/components/discourse_spec.rb @@ -16,19 +16,19 @@ describe Discourse do end context 'base_url' do - context 'when ssl is off' do + context 'when https is off' do before do - SiteSetting.expects(:use_ssl?).returns(false) + SiteSetting.expects(:use_https?).returns(false) end - it 'has a non-ssl base url' do + it 'has a non https base url' do Discourse.base_url.should == "http://foo.com" end end - context 'when ssl is on' do + context 'when https is on' do before do - SiteSetting.expects(:use_ssl?).returns(true) + SiteSetting.expects(:use_https?).returns(true) end it 'has a non-ssl base url' do diff --git a/spec/models/site_setting_spec.rb b/spec/models/site_setting_spec.rb index d5bd6efd5..16c452522 100644 --- a/spec/models/site_setting_spec.rb +++ b/spec/models/site_setting_spec.rb @@ -113,12 +113,12 @@ describe SiteSetting do describe "scheme" do it "returns http when ssl is disabled" do - SiteSetting.expects(:use_ssl).returns(false) + SiteSetting.expects(:use_https).returns(false) SiteSetting.scheme.should == "http" end it "returns https when using ssl" do - SiteSetting.expects(:use_ssl).returns(true) + SiteSetting.expects(:use_https).returns(true) SiteSetting.scheme.should == "https" end