forked from mastodon/mastodon
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'parent/main' into upstream-20231116
- Loading branch information
Showing
87 changed files
with
566 additions
and
347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
web: env PORT=3000 RAILS_ENV=development bundle exec puma -C config/puma.rb | ||
sidekiq: env PORT=3000 RAILS_ENV=development bundle exec sidekiq | ||
stream: env PORT=4000 yarn run start | ||
stream: env PORT=4000 yarn workspace @mastodon/streaming start | ||
webpack: bin/webpack-dev-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# frozen_string_literal: true | ||
|
||
class Api::V1::Timelines::BaseController < Api::BaseController | ||
after_action :insert_pagination_headers, unless: -> { @statuses.empty? } | ||
|
||
private | ||
|
||
def insert_pagination_headers | ||
set_pagination_headers(next_path, prev_path) | ||
end | ||
|
||
def pagination_max_id | ||
@statuses.last.id | ||
end | ||
|
||
def pagination_since_id | ||
@statuses.first.id | ||
end | ||
|
||
def next_path_params | ||
permitted_params.merge(max_id: pagination_max_id) | ||
end | ||
|
||
def prev_path_params | ||
permitted_params.merge(min_id: pagination_since_id) | ||
end | ||
|
||
def permitted_params | ||
params | ||
.slice(*self.class::PERMITTED_PARAMS) | ||
.permit(*self.class::PERMITTED_PARAMS) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
module Api::ContentSecurityPolicy | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
content_security_policy do |policy| | ||
# Set every directive that does not have a fallback | ||
policy.default_src :none | ||
policy.frame_ancestors :none | ||
policy.form_action :none | ||
|
||
# Disable every directive with a fallback to cut on response size | ||
policy.base_uri false | ||
policy.font_src false | ||
policy.img_src false | ||
policy.style_src false | ||
policy.media_src false | ||
policy.frame_src false | ||
policy.manifest_src false | ||
policy.connect_src false | ||
policy.script_src false | ||
policy.child_src false | ||
policy.worker_src false | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.