Skip to content

Commit 77efe49

Browse files
committed
2 parents 985d87c + 0e445eb commit 77efe49

120 files changed

Lines changed: 1606 additions & 754 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
patreon: mastodon
2+
open_collective: mastodon

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,39 @@ Changelog
33

44
All notable changes to this project will be documented in this file.
55

6+
## [2.8.4] - 2019-05-24
7+
### Fixed
8+
9+
- Fix delivery not retrying on some inbox errors that should be retriable ([ThibG](https://github.com/tootsuite/mastodon/pull/10812))
10+
- Fix unnecessary 5 minute cooldowns on signature verifications in some cases ([ThibG](https://github.com/tootsuite/mastodon/pull/10813))
11+
- Fix possible race condition when processing statuses ([ThibG](https://github.com/tootsuite/mastodon/pull/10815))
12+
13+
### Security
14+
15+
- Require specific OAuth scopes for specific endpoints of the streaming API, instead of merely requiring a token for all endpoints, and allow using WebSockets protocol negotiation to specify the access token instead of using a query string ([ThibG](https://github.com/tootsuite/mastodon/pull/10818))
16+
17+
## [2.8.3] - 2019-05-19
18+
### Added
19+
20+
- Add `og:image:alt` OpenGraph tag ([BenLubar](https://github.com/tootsuite/mastodon/pull/10779))
21+
- Add clickable area below avatar in statuses in web UI ([Dar13](https://github.com/tootsuite/mastodon/pull/10766))
22+
- Add crossed-out eye icon on account gallery in web UI ([Kjwon15](https://github.com/tootsuite/mastodon/pull/10715))
23+
- Add media description tooltip to thumbnails in web UI ([ThibG](https://github.com/tootsuite/mastodon/pull/10713))
24+
25+
### Changed
26+
27+
- Change "mark as sensitive" button into a checkbox for clarity ([ThibG](https://github.com/tootsuite/mastodon/pull/10748))
28+
29+
### Fixed
30+
31+
- Fix bug allowing users to publicly boost their private statuses ([ThibG](https://github.com/tootsuite/mastodon/pull/10775), [ThibG](https://github.com/tootsuite/mastodon/pull/10783))
32+
- Fix performance in formatter by a little ([ThibG](https://github.com/tootsuite/mastodon/pull/10765))
33+
- Fix some colors in the light theme ([yuzulabo](https://github.com/tootsuite/mastodon/pull/10754))
34+
- Fix some colors of the high contrast theme ([yuzulabo](https://github.com/tootsuite/mastodon/pull/10711))
35+
- Fix ambivalent active state of poll refresh button in web UI ([MaciekBaron](https://github.com/tootsuite/mastodon/pull/10720))
36+
- Fix duplicate posting being possible from web UI ([hinaloe](https://github.com/tootsuite/mastodon/pull/10785))
37+
- Fix "invited by" not showing up in admin UI ([ThibG](https://github.com/tootsuite/mastodon/pull/10791))
38+
639
## [2.8.2] - 2019-05-05
740
### Added
841

CONTRIBUTING.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ Bug reports and feature suggestions can be submitted to [GitHub Issues](https://
1818

1919
## Translations
2020

21-
You can submit translations via [Weblate](https://weblate.joinmastodon.org/). They are periodically merged into the codebase.
22-
23-
[![Mastodon translation statistics by language](https://weblate.joinmastodon.org/widgets/mastodon/-/multi-auto.svg)](https://weblate.joinmastodon.org/)
21+
You can submit translations via pull request.
2422

2523
## Pull requests
2624

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ RUN apt update && \
8686
useradd -m -u $UID -g $GID -d /opt/mastodon mastodon && \
8787
echo "mastodon:`head /dev/urandom | tr -dc A-Za-z0-9 | head -c 24 | mkpasswd -s -m sha-256`" | chpasswd
8888

89-
# Install masto runtime deps
89+
# Install mastodon runtime deps
9090
RUN apt -y --no-install-recommends install \
9191
libssl1.1 libpq5 imagemagick ffmpeg \
9292
libicu60 libprotobuf10 libidn11 libyaml-0-2 \
@@ -95,7 +95,7 @@ RUN apt -y --no-install-recommends install \
9595
ln -s /opt/mastodon /mastodon && \
9696
gem install bundler && \
9797
rm -rf /var/cache && \
98-
rm -rf /var/lib/apt
98+
rm -rf /var/lib/apt/lists/*
9999

100100
# Add tini
101101
ENV TINI_VERSION="0.18.0"
@@ -104,11 +104,11 @@ ADD https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini /tin
104104
RUN echo "$TINI_SUM tini" | sha256sum -c -
105105
RUN chmod +x /tini
106106

107-
# Copy over masto source, and dependencies from building, and set permissions
107+
# Copy over mastodon source, and dependencies from building, and set permissions
108108
COPY --chown=mastodon:mastodon . /opt/mastodon
109109
COPY --from=build-dep --chown=mastodon:mastodon /opt/mastodon /opt/mastodon
110110

111-
# Run masto services in prod mode
111+
# Run mastodon services in prod mode
112112
ENV RAILS_ENV="production"
113113
ENV NODE_ENV="production"
114114

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ gem 'makara', '~> 0.4'
1515
gem 'pghero', '~> 2.2'
1616
gem 'dotenv-rails', '~> 2.7'
1717

18-
gem 'aws-sdk-s3', '~> 1.39', require: false
18+
gem 'aws-sdk-s3', '~> 1.40', require: false
1919
gem 'fog-core', '<= 2.1.0'
2020
gem 'fog-openstack', '~> 0.3', require: false
2121
gem 'paperclip', '~> 6.0'
@@ -53,7 +53,7 @@ gem 'htmlentities', '~> 4.3'
5353
gem 'http', '~> 3.3'
5454
gem 'http_accept_language', '~> 2.1'
5555
gem 'http_parser.rb', '~> 0.6', git: 'https://github.com/tmm1/http_parser.rb', ref: '54b17ba8c7d8d20a16dfc65d1775241833219cf2'
56-
gem 'httplog', '~> 1.2'
56+
gem 'httplog', '~> 1.3'
5757
gem 'idn-ruby', require: 'idn'
5858
gem 'kaminari', '~> 1.1'
5959
gem 'link_header', '~> 0.0'
@@ -128,7 +128,7 @@ group :development do
128128
gem 'letter_opener', '~> 1.7'
129129
gem 'letter_opener_web', '~> 1.3'
130130
gem 'memory_profiler'
131-
gem 'rubocop', '~> 0.69', require: false
131+
gem 'rubocop', '~> 0.70', require: false
132132
gem 'brakeman', '~> 4.5', require: false
133133
gem 'bundler-audit', '~> 0.6', require: false
134134
gem 'scss_lint', '~> 0.58', require: false

Gemfile.lock

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,17 @@ GEM
7676
av (0.9.0)
7777
cocaine (~> 0.5.3)
7878
aws-eventstream (1.0.3)
79-
aws-partitions (1.162.0)
80-
aws-sdk-core (3.52.1)
79+
aws-partitions (1.165.0)
80+
aws-sdk-core (3.53.0)
8181
aws-eventstream (~> 1.0, >= 1.0.2)
8282
aws-partitions (~> 1.0)
8383
aws-sigv4 (~> 1.1)
8484
jmespath (~> 1.0)
85-
aws-sdk-kms (1.20.0)
86-
aws-sdk-core (~> 3, >= 3.52.1)
85+
aws-sdk-kms (1.21.0)
86+
aws-sdk-core (~> 3, >= 3.53.0)
8787
aws-sigv4 (~> 1.1)
88-
aws-sdk-s3 (1.39.0)
89-
aws-sdk-core (~> 3, >= 3.52.1)
88+
aws-sdk-s3 (1.40.0)
89+
aws-sdk-core (~> 3, >= 3.53.0)
9090
aws-sdk-kms (~> 1)
9191
aws-sigv4 (~> 1.0)
9292
aws-sigv4 (1.1.0)
@@ -129,14 +129,13 @@ GEM
129129
sshkit (~> 1.3)
130130
capistrano-yarn (2.0.2)
131131
capistrano (~> 3.0)
132-
capybara (3.20.0)
132+
capybara (3.20.2)
133133
addressable
134134
mini_mime (>= 0.1.3)
135135
nokogiri (~> 1.8)
136136
rack (>= 1.6.0)
137137
rack-test (>= 0.6.3)
138138
regexp_parser (~> 1.2)
139-
uglifier
140139
xpath (~> 3.2)
141140
case_transform (0.2)
142141
activesupport
@@ -208,7 +207,6 @@ GEM
208207
et-orbi (1.1.6)
209208
tzinfo
210209
excon (0.62.0)
211-
execjs (2.7.0)
212210
fabrication (2.20.2)
213211
faker (1.9.3)
214212
i18n (>= 0.7)
@@ -271,7 +269,7 @@ GEM
271269
domain_name (~> 0.5)
272270
http-form_data (2.1.1)
273271
http_accept_language (2.1.1)
274-
httplog (1.2.2)
272+
httplog (1.3.0)
275273
rack (>= 1.0)
276274
rainbow (>= 2.0.0)
277275
i18n (1.6.0)
@@ -322,7 +320,7 @@ GEM
322320
letter_opener (~> 1.0)
323321
railties (>= 3.2)
324322
link_header (0.0.8)
325-
lograge (0.11.0)
323+
lograge (0.11.1)
326324
actionpack (>= 4)
327325
activesupport (>= 4)
328326
railties (>= 4)
@@ -529,7 +527,7 @@ GEM
529527
rspec-core (~> 3.0, >= 3.0.0)
530528
sidekiq (>= 2.4.0)
531529
rspec-support (3.8.0)
532-
rubocop (0.69.0)
530+
rubocop (0.70.0)
533531
jaro_winkler (~> 1.5.1)
534532
parallel (~> 1.10)
535533
parser (>= 2.6)
@@ -627,8 +625,6 @@ GEM
627625
thread_safe (~> 0.1)
628626
tzinfo-data (1.2019.1)
629627
tzinfo (>= 1.0.0)
630-
uglifier (4.1.20)
631-
execjs (>= 0.3.0, < 3)
632628
unf (0.1.4)
633629
unf_ext
634630
unf_ext (0.0.7.5)
@@ -662,7 +658,7 @@ DEPENDENCIES
662658
active_record_query_trace (~> 1.6)
663659
addressable (~> 2.6)
664660
annotate (~> 2.7)
665-
aws-sdk-s3 (~> 1.39)
661+
aws-sdk-s3 (~> 1.40)
666662
better_errors (~> 2.5)
667663
binding_of_caller (~> 0.7)
668664
blurhash (~> 0.1)
@@ -701,7 +697,7 @@ DEPENDENCIES
701697
http (~> 3.3)
702698
http_accept_language (~> 2.1)
703699
http_parser.rb (~> 0.6)!
704-
httplog (~> 1.2)
700+
httplog (~> 1.3)
705701
i18n-tasks (~> 0.9)
706702
idn-ruby
707703
iso-639
@@ -752,7 +748,7 @@ DEPENDENCIES
752748
rqrcode (~> 0.10)
753749
rspec-rails (~> 3.8)
754750
rspec-sidekiq (~> 3.0)
755-
rubocop (~> 0.69)
751+
rubocop (~> 0.70)
756752
sanitize (~> 5.0)
757753
scss_lint (~> 0.58)
758754
sidekiq (~> 5.2)

app/controllers/api/v1/notifications_controller.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def paginated_notifications
4444
end
4545

4646
def browserable_account_notifications
47-
current_account.notifications.browserable(exclude_types)
47+
current_account.notifications.browserable(exclude_types, from_account)
4848
end
4949

5050
def target_statuses_from_notifications
@@ -81,6 +81,10 @@ def exclude_types
8181
val
8282
end
8383

84+
def from_account
85+
params[:account_id]
86+
end
87+
8488
def pagination_params(core_params)
8589
params.slice(:limit, :exclude_types).permit(:limit, exclude_types: []).merge(core_params)
8690
end

app/controllers/concerns/signature_verification.rb

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,7 @@ def signed_request_account
4343
return
4444
end
4545

46-
account_stoplight = Stoplight("source:#{request.ip}") { account_from_key_id(signature_params['keyId']) }
47-
.with_fallback { nil }
48-
.with_threshold(1)
49-
.with_cool_off_time(5.minutes.seconds)
50-
.with_error_handler { |error, handle| error.is_a?(HTTP::Error) ? handle.call(error) : raise(error) }
51-
52-
account = account_stoplight.run
46+
account = account_from_key_id(signature_params['keyId'])
5347

5448
if account.nil?
5549
@signature_verification_failure_reason = "Public key not found for key #{signature_params['keyId']}"
@@ -62,13 +56,7 @@ def signed_request_account
6256

6357
return account unless verify_signature(account, signature, compare_signed_string).nil?
6458

65-
account_stoplight = Stoplight("source:#{request.ip}") { account.possibly_stale? ? account.refresh! : account_refresh_key(account) }
66-
.with_fallback { nil }
67-
.with_threshold(1)
68-
.with_cool_off_time(5.minutes.seconds)
69-
.with_error_handler { |error, handle| error.is_a?(HTTP::Error) ? handle.call(error) : raise(error) }
70-
71-
account = account_stoplight.run
59+
account = stoplight_wrap_request { account.possibly_stale? ? account.refresh! : account_refresh_key(account) }
7260

7361
if account.nil?
7462
@signature_verification_failure_reason = "Public key not found for key #{signature_params['keyId']}"
@@ -136,14 +124,23 @@ def incompatible_signature?(signature_params)
136124

137125
def account_from_key_id(key_id)
138126
if key_id.start_with?('acct:')
139-
ResolveAccountService.new.call(key_id.gsub(/\Aacct:/, ''))
127+
stoplight_wrap_request { ResolveAccountService.new.call(key_id.gsub(/\Aacct:/, '')) }
140128
elsif !ActivityPub::TagManager.instance.local_uri?(key_id)
141129
account = ActivityPub::TagManager.instance.uri_to_resource(key_id, Account)
142-
account ||= ActivityPub::FetchRemoteKeyService.new.call(key_id, id: false)
130+
account ||= stoplight_wrap_request { ActivityPub::FetchRemoteKeyService.new.call(key_id, id: false) }
143131
account
144132
end
145133
end
146134

135+
def stoplight_wrap_request(&block)
136+
Stoplight("source:#{request.remote_ip}", &block)
137+
.with_fallback { nil }
138+
.with_threshold(1)
139+
.with_cool_off_time(5.minutes.seconds)
140+
.with_error_handler { |error, handle| error.is_a?(HTTP::Error) ? handle.call(error) : raise(error) }
141+
.run
142+
end
143+
147144
def account_refresh_key(account)
148145
return if account.local? || !account.activitypub?
149146
ActivityPub::FetchRemoteAccountService.new.call(account.uri, only_key: true)

app/controllers/settings/preferences_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def user_settings_params
4949
:setting_hide_network,
5050
:setting_aggregate_reblogs,
5151
:setting_show_application,
52+
:setting_advanced_layout,
5253
notification_emails: %i(follow follow_request reblog favourite mention digest report pending_account),
5354
interactions: %i(must_be_follower must_be_following)
5455
)

app/javascript/mastodon/actions/compose.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ const messages = defineMessages({
6363
uploadErrorPoll: { id: 'upload_error.poll', defaultMessage: 'File upload not allowed with polls.' },
6464
});
6565

66+
const COMPOSE_PANEL_BREAKPOINT = 600 + (285 * 1) + (10 * 1);
67+
68+
export const ensureComposeIsVisible = (getState, routerHistory) => {
69+
if (!getState().getIn(['compose', 'mounted']) && window.innerWidth < COMPOSE_PANEL_BREAKPOINT) {
70+
routerHistory.push('/statuses/new');
71+
}
72+
};
73+
6674
export function changeCompose(text) {
6775
return {
6876
type: COMPOSE_CHANGE,
@@ -77,9 +85,7 @@ export function replyCompose(status, routerHistory) {
7785
status: status,
7886
});
7987

80-
if (!getState().getIn(['compose', 'mounted'])) {
81-
routerHistory.push('/statuses/new');
82-
}
88+
ensureComposeIsVisible(getState, routerHistory);
8389
};
8490
};
8591

@@ -102,9 +108,7 @@ export function mentionCompose(account, routerHistory) {
102108
account: account,
103109
});
104110

105-
if (!getState().getIn(['compose', 'mounted'])) {
106-
routerHistory.push('/statuses/new');
107-
}
111+
ensureComposeIsVisible(getState, routerHistory);
108112
};
109113
};
110114

@@ -115,9 +119,7 @@ export function directCompose(account, routerHistory) {
115119
account: account,
116120
});
117121

118-
if (!getState().getIn(['compose', 'mounted'])) {
119-
routerHistory.push('/statuses/new');
120-
}
122+
ensureComposeIsVisible(getState, routerHistory);
121123
};
122124
};
123125

0 commit comments

Comments
 (0)