From 9a61b0ef22eed244be422bfb24155656c4669044 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Fri, 5 Jan 2018 12:43:50 +0900 Subject: [PATCH 1/7] Fix RFC 5646 Regular Expression (#6190) --- app/javascript/mastodon/locales/whitelist_sr-Latn.json | 2 ++ config/webpack/translationRunner.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 app/javascript/mastodon/locales/whitelist_sr-Latn.json diff --git a/app/javascript/mastodon/locales/whitelist_sr-Latn.json b/app/javascript/mastodon/locales/whitelist_sr-Latn.json new file mode 100644 index 000000000..0d4f101c7 --- /dev/null +++ b/app/javascript/mastodon/locales/whitelist_sr-Latn.json @@ -0,0 +1,2 @@ +[ +] diff --git a/config/webpack/translationRunner.js b/config/webpack/translationRunner.js index d616c7839..e6543fbb7 100644 --- a/config/webpack/translationRunner.js +++ b/config/webpack/translationRunner.js @@ -2,7 +2,7 @@ const fs = require('fs'); const path = require('path'); const { default: manageTranslations } = require('react-intl-translations-manager'); -const RFC5646_REGEXP = /^[a-z]{2,3}(?:|-[A-Z]+)$/; +const RFC5646_REGEXP = /^[a-z]{2,3}(?:-(?:x|[A-Za-z]{2,4}))*$/; const rootDirectory = path.resolve(__dirname, '..', '..'); const translationsDirectory = path.resolve(rootDirectory, 'app', 'javascript', 'mastodon', 'locales'); From e9822a4e4e1cbf69581b9d94e4567ba259d5d7d4 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 5 Jan 2018 04:52:06 +0100 Subject: [PATCH 2/7] Bump version to 2.1.2 --- lib/mastodon/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mastodon/version.rb b/lib/mastodon/version.rb index 007768769..bd23ab1d1 100644 --- a/lib/mastodon/version.rb +++ b/lib/mastodon/version.rb @@ -13,7 +13,7 @@ module Mastodon end def patch - 1 + 2 end def pre From 06636c6eca636d7cacc3d743487b2a9618585c34 Mon Sep 17 00:00:00 2001 From: Quenty31 <33203663+Quenty31@users.noreply.github.com> Date: Fri, 5 Jan 2018 10:59:43 +0100 Subject: [PATCH 3/7] l10n Occitan language: mailer update (#6193) * Create email_changed.oc.html.erb * Create email_changed.oc.text.erb * Update email_changed.oc.html.erb * Update email_changed.oc.html.erb * Create reconfirmation_instructions.oc.html.erb * Create reconfirmation_instructions.oc.text.erb * Update confirmation_instructions.oc.html.erb * Update confirmation_instructions.oc.text.erb * Update confirmation_instructions.oc.html.erb * Update reconfirmation_instructions.oc.html.erb * Update reconfirmation_instructions.oc.text.erb * Update reconfirmation_instructions.oc.html.erb --- .../confirmation_instructions.oc.html.erb | 2 +- .../confirmation_instructions.oc.text.erb | 2 +- app/views/user_mailer/email_changed.oc.html.erb | 15 +++++++++++++++ app/views/user_mailer/email_changed.oc.text.erb | 13 +++++++++++++ .../reconfirmation_instructions.oc.html.erb | 15 +++++++++++++++ .../reconfirmation_instructions.oc.text.erb | 12 ++++++++++++ 6 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 app/views/user_mailer/email_changed.oc.html.erb create mode 100644 app/views/user_mailer/email_changed.oc.text.erb create mode 100644 app/views/user_mailer/reconfirmation_instructions.oc.html.erb create mode 100644 app/views/user_mailer/reconfirmation_instructions.oc.text.erb diff --git a/app/views/user_mailer/confirmation_instructions.oc.html.erb b/app/views/user_mailer/confirmation_instructions.oc.html.erb index 7a16db67a..5657e40d4 100644 --- a/app/views/user_mailer/confirmation_instructions.oc.html.erb +++ b/app/views/user_mailer/confirmation_instructions.oc.html.erb @@ -7,7 +7,7 @@

Aprèp vòstra primièra connexion, poiretz accedir a la documentacion de l’aisina.

-

Pensatz tanben de gaitar nòstras <%= link_to 'conditions d\'utilisation', terms_url %>.

+

Pensatz tanben de gaitar nòstres <%= link_to 'tèrmes e condicions d\'utilizacion', terms_url %>.

Amistosament,

diff --git a/app/views/user_mailer/confirmation_instructions.oc.text.erb b/app/views/user_mailer/confirmation_instructions.oc.text.erb index bf2acfec1..fe04fe3d0 100644 --- a/app/views/user_mailer/confirmation_instructions.oc.text.erb +++ b/app/views/user_mailer/confirmation_instructions.oc.text.erb @@ -7,7 +7,7 @@ er confirmar vòstra inscripcion, mercés de clicar sul ligam seguent :  Aprèp vòstra primièra connexion, poiretz accedir a la documentacion de l’aisina. -Pensatz tanben de gaitar nòstras <%= link_to 'conditions d\'utilisation', terms_url %>. +Pensatz tanben de gaitar nòstres <%= link_to 'tèrmes e condicions d\'utilizacion', terms_url %>. Amistosament, diff --git a/app/views/user_mailer/email_changed.oc.html.erb b/app/views/user_mailer/email_changed.oc.html.erb new file mode 100644 index 000000000..0f4c891dc --- /dev/null +++ b/app/views/user_mailer/email_changed.oc.html.erb @@ -0,0 +1,15 @@ +

Bonjorn <%= @resource.email %> !

+ +<% if @resource&.unconfirmed_email? %> +

Vos contactem per vos senhalar que l’adreça qu’utilizatz per <%= @instance %> es cambiada per aquesta d’aquí <%= @resource.unconfirmed_email %>.

+<% else %> +

Vos contactem per vos senhalar que l’adreça qu’utilizatz per <%= @instance %> es cambiada per aquesta d’aquí <%= @resource.email %>.

+<% end %> + +

+ S’avètz pas demandat aqueste cambiament d’adreça, poiriá arribar que qualqu’un mai aguèsse agut accès a vòstre compte. Mercés de cambiar sulpic vòstre senhal o de contactar vòstre administrator d’instància se l’accès a vòstre compte vos es barrat. +

+ +

Amistosament,

+ +

La còla <%= @instance %>

diff --git a/app/views/user_mailer/email_changed.oc.text.erb b/app/views/user_mailer/email_changed.oc.text.erb new file mode 100644 index 000000000..2305ef834 --- /dev/null +++ b/app/views/user_mailer/email_changed.oc.text.erb @@ -0,0 +1,13 @@ +Bonjorn <%= @resource.email %> ! + +<% if @resource&.unconfirmed_email? %> +Vos contactem per vos senhalar que l’adreça qu’utilizatz per <%= @instance %> es cambiada per aquesta d’aquí <%= @resource.unconfirmed_email %>. +<% else %> +Vos contactem per vos senhalar que l’adreça qu’utilizatz per <%= @instance %> es cambiada per aquesta d’aquí <%= @resource.email %>. +<% end %> + +S’avètz pas demandat aqueste cambiament d’adreça, poiriá arribar que qualqu’un mai aguèsse agut accès a vòstre compte. Mercés de cambiar sulpic vòstre senhal o de contactar vòstre administrator d’instància se l’accès a vòstre compte vos es barrat. + +Amistosament, + +La còla <%= @instance %> diff --git a/app/views/user_mailer/reconfirmation_instructions.oc.html.erb b/app/views/user_mailer/reconfirmation_instructions.oc.html.erb new file mode 100644 index 000000000..d5404e49c --- /dev/null +++ b/app/views/user_mailer/reconfirmation_instructions.oc.html.erb @@ -0,0 +1,15 @@ +

Bonjorn <%= @resource.unconfirmed_email %> !

+ +

Avètz demandat a cambiar vòstra adreça de corrièl qu’utilizatz per <%= @instance %>.

+ +

Per confirmar vòstra novèla adreça, mercés de clicar lo ligam seguent :
+<%= link_to 'Confirmar mon adreça', confirmation_url(@resource, confirmation_token: @token) %>

+ +

Se lo ligam al dessús fonciona pas, copiatz e pegatz aquesta URL a la barra d’adreça :
+<%= confirmation_url(@resource, confirmation_token: @token) %> + +

Mercés de gaitar tanben nòstres <%= link_to 'terms and conditions', terms_url %>.

+ +

Amistosament,

+ +

La còla <%= @instance %>

diff --git a/app/views/user_mailer/reconfirmation_instructions.oc.text.erb b/app/views/user_mailer/reconfirmation_instructions.oc.text.erb new file mode 100644 index 000000000..6f174bb3e --- /dev/null +++ b/app/views/user_mailer/reconfirmation_instructions.oc.text.erb @@ -0,0 +1,12 @@ +Bonjorn <%= @resource.unconfirmed_email %> ! + +Avètz demandat a cambiar vòstra adreça de corrièl qu’utilizatz per <%= @instance %>. + +Per confirmar vòstra novèla adreça, mercés de clicar lo ligam seguent : +<%= confirmation_url(@resource, confirmation_token: @token) %> + +Mercés tanben de gaitar nòstres <%= link_to 'terms and conditions', terms_url %>. + +Amistosament, + +La còla <%= @instance %> From 8d51ce429094d43a91d61c9cb0c0dc7b1e6bd2de Mon Sep 17 00:00:00 2001 From: Naoki Kosaka Date: Sat, 6 Jan 2018 04:04:22 +0900 Subject: [PATCH 4/7] Fix enforce HTTPS in production. (#6180) --- config/initializers/session_store.rb | 2 +- spec/rails_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index ef61543a8..3dc0edd6f 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,3 +1,3 @@ # Be sure to restart your server when you modify this file. -Rails.application.config.session_store :cookie_store, key: '_mastodon_session', secure: (ENV['LOCAL_HTTPS'] == 'true') +Rails.application.config.session_store :cookie_store, key: '_mastodon_session', secure: (Rails.env.production? || ENV['LOCAL_HTTPS'] == 'true') diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 4f7399505..67c6b9205 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -46,7 +46,7 @@ RSpec.configure do |config| config.include ActiveSupport::Testing::TimeHelpers config.before :each, type: :feature do - https = ENV['LOCAL_HTTPS'] == 'true' + https = Rails.env.production? || ENV['LOCAL_HTTPS'] == 'true' Capybara.app_host = "http#{https ? 's' : ''}://#{ENV.fetch('LOCAL_DOMAIN')}" end From 95bd85d9e8bd6f47b693a9ccf6733278f992fb6a Mon Sep 17 00:00:00 2001 From: TheKinrar Date: Fri, 5 Jan 2018 22:38:33 +0100 Subject: [PATCH 5/7] Represent numbers by strings in instance activity API (#6198) Fixes #6197. --- app/controllers/api/v1/instances/activity_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/v1/instances/activity_controller.rb b/app/controllers/api/v1/instances/activity_controller.rb index 36f52c38d..e14e0aee8 100644 --- a/app/controllers/api/v1/instances/activity_controller.rb +++ b/app/controllers/api/v1/instances/activity_controller.rb @@ -21,9 +21,9 @@ class Api::V1::Instances::ActivityController < Api::BaseController weeks << { week: week.to_time.to_i.to_s, - statuses: Redis.current.get("activity:statuses:local:#{week_id}") || 0, - logins: Redis.current.pfcount("activity:logins:#{week_id}"), - registrations: Redis.current.get("activity:accounts:local:#{week_id}") || 0, + statuses: Redis.current.get("activity:statuses:local:#{week_id}") || '0', + logins: Redis.current.pfcount("activity:logins:#{week_id}").to_s, + registrations: Redis.current.get("activity:accounts:local:#{week_id}") || '0', } end From a594139115b3e9d07ccf70972c5ede101e5a14e4 Mon Sep 17 00:00:00 2001 From: ThibG Date: Fri, 5 Jan 2018 22:42:50 +0100 Subject: [PATCH 6/7] When fetching an ActivityPub-enabled status, do not re-request it as text/html (#6196) --- app/services/fetch_atom_service.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/services/fetch_atom_service.rb b/app/services/fetch_atom_service.rb index c01e8d071..c07859845 100644 --- a/app/services/fetch_atom_service.rb +++ b/app/services/fetch_atom_service.rb @@ -46,6 +46,8 @@ class FetchAtomService < BaseService json = body_to_json(@response.to_s) if supported_context?(json) && json['type'] == 'Person' && json['inbox'].present? [json['id'], { prefetched_body: @response.to_s, id: true }, :activitypub] + elsif supported_context?(json) && json['type'] == 'Note' + [json['id'], { prefetched_body: @response.to_s, id: true }, :activitypub] else @unsupported_activity = true nil From 10f6793fd0af3690a37c868b7bb4418418dc3a7a Mon Sep 17 00:00:00 2001 From: ThibG Date: Fri, 5 Jan 2018 23:04:35 +0100 Subject: [PATCH 7/7] Fix PuSH workers (#6200) --- app/workers/pubsubhubbub/subscribe_worker.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/workers/pubsubhubbub/subscribe_worker.rb b/app/workers/pubsubhubbub/subscribe_worker.rb index e350973e1..2e176d1c1 100644 --- a/app/workers/pubsubhubbub/subscribe_worker.rb +++ b/app/workers/pubsubhubbub/subscribe_worker.rb @@ -20,7 +20,7 @@ class Pubsubhubbub::SubscribeWorker sidekiq_retries_exhausted do |msg, _e| account = Account.find(msg['args'].first) - logger.error "PuSH subscription attempts for #{account.acct} exhausted. Unsubscribing" + Sidekiq.logger.error "PuSH subscription attempts for #{account.acct} exhausted. Unsubscribing" ::UnsubscribeService.new.call(account) end