From a083604d1d9d8f53c1d69003591e1cab69c620a3 Mon Sep 17 00:00:00 2001 From: MIYAGI Hikaru Date: Sat, 25 Aug 2018 01:16:53 +0900 Subject: [PATCH 01/27] Support UNIX domain socket for streaming service without using PORT (#8217) * Support UNIX domain socket for streaming service without using PORT The use of UNIX domain socket for streaming service was not officially supported, but it was made unofficial to use by setting a path to PORT. From now on, SOCKET will be used just like setting for puma. * Hundle relative path --- streaming/index.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/streaming/index.js b/streaming/index.js index d7bfa6542..b5f6dbd87 100644 --- a/streaming/index.js +++ b/streaming/index.js @@ -9,6 +9,7 @@ const log = require('npmlog'); const url = require('url'); const WebSocket = require('uws'); const uuid = require('uuid'); +const fs = require('fs'); const env = process.env.NODE_ENV || 'development'; @@ -70,6 +71,9 @@ const redisUrlToClient = (defaultConfig, redisUrl) => { const numWorkers = +process.env.STREAMING_CLUSTER_NUM || (env === 'development' ? 1 : Math.max(os.cpus().length - 1, 1)); const startMaster = () => { + if (!process.env.SOCKET && process.env.PORT && isNaN(+process.env.PORT)) { + log.warn('UNIX domain socket is now supported by using SOCKET. Please migrate from PORT hack.'); + } log.info(`Starting streaming API server master with ${numWorkers} workers`); }; @@ -574,9 +578,16 @@ const startWorker = (workerId) => { }); }, 30000); - server.listen(process.env.PORT || 4000, process.env.BIND || '0.0.0.0', () => { - log.info(`Worker ${workerId} now listening on ${server.address().address}:${server.address().port}`); - }); + if (process.env.SOCKET || process.env.PORT && isNaN(+process.env.PORT)) { + server.listen(process.env.SOCKET || process.env.PORT, () => { + fs.chmodSync(server.address(), 0o666); + log.info(`Worker ${workerId} now listening on ${server.address()}`); + }); + } else { + server.listen(+process.env.PORT || 4000, process.env.BIND || '0.0.0.0', () => { + log.info(`Worker ${workerId} now listening on ${server.address().address}:${server.address().port}`); + }); + } const onExit = () => { log.info(`Worker ${workerId} exiting, bye bye`); From b37ae645788e1951e3b1737519f32803e5e1b6ad Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 24 Aug 2018 18:17:11 +0200 Subject: [PATCH 02/27] Upgrade Doorkeeper to 5.0.0 (#8409) See doorkeeper-gem/doorkeeper#1137 --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 516d397a2..d7275017f 100644 --- a/Gemfile +++ b/Gemfile @@ -41,7 +41,7 @@ gem 'omniauth-cas', '~> 1.1' gem 'omniauth-saml', '~> 1.10' gem 'omniauth', '~> 1.2' -gem 'doorkeeper', '~> 4.4' +gem 'doorkeeper', '~> 5.0' gem 'fast_blank', '~> 1.0' gem 'fastimage' gem 'goldfinger', '~> 2.1' diff --git a/Gemfile.lock b/Gemfile.lock index ea0e3f0cd..a11a715c4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -181,7 +181,7 @@ GEM docile (1.3.0) domain_name (0.5.20180417) unf (>= 0.0.5, < 1.0.0) - doorkeeper (4.4.2) + doorkeeper (5.0.0) railties (>= 4.2) dotenv (2.2.2) dotenv-rails (2.2.2) @@ -670,7 +670,7 @@ DEPENDENCIES devise (~> 4.4) devise-two-factor (~> 3.0) devise_pam_authenticatable2 (~> 9.1) - doorkeeper (~> 4.4) + doorkeeper (~> 5.0) dotenv-rails (~> 2.2, < 2.3) fabrication (~> 2.20) faker (~> 1.8) From 869a3af3c0a5b441c09ddd028247cc8f2c4fa4df Mon Sep 17 00:00:00 2001 From: Sylvhem Date: Fri, 24 Aug 2018 21:46:59 +0200 Subject: [PATCH 03/27] Reword the "Delete and rewrite" warning (#8415) * Change "Delete and rewrite" warning Reword the "Delete and rewrite" warning to make it clear that replies are not deleted. * Update the French translation Update the French translation to reflect the changes made to the "Delete and rewrite" warning. --- app/javascript/mastodon/locales/en.json | 2 +- app/javascript/mastodon/locales/fr.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index e00ae84f9..348b36812 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -87,7 +87,7 @@ "confirmations.mute.confirm": "Mute", "confirmations.mute.message": "Are you sure you want to mute {name}?", "confirmations.redraft.confirm": "Delete & redraft", - "confirmations.redraft.message": "Are you sure you want to delete this status and re-draft it? You will lose all replies, boosts and favourites to it.", + "confirmations.redraft.message": "Are you sure you want to delete this status and re-draft it? Favourites and boosts will be lost, and replies to the original post will be orphaned.", "confirmations.unfollow.confirm": "Unfollow", "confirmations.unfollow.message": "Are you sure you want to unfollow {name}?", "embed.instructions": "Embed this status on your website by copying the code below.", diff --git a/app/javascript/mastodon/locales/fr.json b/app/javascript/mastodon/locales/fr.json index 835b1af65..d3fca584d 100644 --- a/app/javascript/mastodon/locales/fr.json +++ b/app/javascript/mastodon/locales/fr.json @@ -87,7 +87,7 @@ "confirmations.mute.confirm": "Masquer", "confirmations.mute.message": "Confirmez-vous le masquage de {name} ?", "confirmations.redraft.confirm": "Effacer et ré-écrire", - "confirmations.redraft.message": "Êtes-vous sûr·e de vouloir effacer ce statut pour le ré-écrire ? Vous perdrez toutes ses réponses, ses repartages et ses mises en favori.", + "confirmations.redraft.message": "Êtes-vous sûr·e de vouloir effacer ce statut pour le ré-écrire ? Ses partages ainsi que ses mises en favori seront perdu·e·s et ses réponses seront orphelines.", "confirmations.unfollow.confirm": "Ne plus suivre", "confirmations.unfollow.message": "Voulez-vous arrêter de suivre {name} ?", "embed.instructions": "Intégrez ce statut à votre site en copiant le code ci-dessous.", From ac092d03e7a781d27aff9cb9ea4637be9c5f2a2a Mon Sep 17 00:00:00 2001 From: M Somerville Date: Fri, 24 Aug 2018 22:55:41 +0100 Subject: [PATCH 04/27] Add missing video descriptions (#8416) * Pass through video description as necessary. * Add title to video, matching aria-label. --- app/javascript/mastodon/components/extended_video_player.js | 1 + app/javascript/mastodon/components/media_gallery.js | 1 + app/javascript/mastodon/components/status.js | 1 + .../mastodon/features/report/components/status_check_box.js | 1 + .../mastodon/features/status/components/detailed_status.js | 1 + app/javascript/mastodon/features/video/index.js | 1 + app/views/admin/reports/_status.html.haml | 2 +- app/views/stream_entries/_detailed_status.html.haml | 2 +- app/views/stream_entries/_simple_status.html.haml | 2 +- 9 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/javascript/mastodon/components/extended_video_player.js b/app/javascript/mastodon/components/extended_video_player.js index 9e2f6835a..009c0d559 100644 --- a/app/javascript/mastodon/components/extended_video_player.js +++ b/app/javascript/mastodon/components/extended_video_player.js @@ -50,6 +50,7 @@ export default class ExtendedVideoPlayer extends React.PureComponent { role='button' tabIndex='0' aria-label={alt} + title={alt} muted={muted} controls={controls} loop={!controls} diff --git a/app/javascript/mastodon/components/media_gallery.js b/app/javascript/mastodon/components/media_gallery.js index 63bc4a59b..6e1310cd6 100644 --- a/app/javascript/mastodon/components/media_gallery.js +++ b/app/javascript/mastodon/components/media_gallery.js @@ -154,6 +154,7 @@ class Item extends React.PureComponent {