forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into temp3_for-ffxiv-mastodon
- Loading branch information
Showing
98 changed files
with
1,222 additions
and
878 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
# For details, see https://github.com/devcontainers/images/tree/main/src/ruby | ||
FROM mcr.microsoft.com/devcontainers/ruby:1-3.3-bookworm | ||
|
||
# Install Rails | ||
# RUN gem install rails webdrivers | ||
|
||
# Update existing node version, keep in sync with .nvmrc | ||
ARG NODE_VERSION="20" | ||
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1" | ||
|
||
# [Optional] Uncomment this section to install additional OS packages. | ||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get -y install --no-install-recommends libicu-dev libidn11-dev ffmpeg imagemagick libvips42 libpam-dev | ||
RUN . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1 | ||
|
||
# [Optional] Uncomment this line to install additional gems. | ||
RUN gem install foreman | ||
# Install additional OS packages | ||
RUN apt-get update && \ | ||
export DEBIAN_FRONTEND=noninteractive && \ | ||
apt-get -y install --no-install-recommends libicu-dev libidn11-dev ffmpeg imagemagick libvips42 libpam-dev | ||
|
||
# [Optional] Uncomment this line to install global node packages. | ||
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && corepack enable" 2>&1 | ||
# Install global node packages | ||
RUN . /usr/local/share/nvm/nvm.sh && corepack enable 2>&1 | ||
|
||
# Move welcome message to where VS Code expects it | ||
COPY welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt |
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 was deleted.
Oops, something went wrong.
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,8 +1,7 @@ | ||
👋 Welcome to "Mastodon" in GitHub Codespaces! | ||
👋 Welcome to your Mastodon Dev Container! | ||
|
||
🛠️ Your environment is fully setup with all the required software. | ||
🛠️ Your environment is fully setup with all the required software. | ||
|
||
🔍 To explore VS Code to its fullest, search using the Command Palette (Cmd/Ctrl + Shift + P or F1). | ||
|
||
📝 Edit away, run your app as usual, and we'll automatically make it available for you to access. | ||
💥 Run `bin/dev` to start the application processes. | ||
|
||
🥼 Run `RAILS_ENV=test bin/rails assets:precompile && RAILS_ENV=test bin/rspec` to run the test suite. |
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,52 @@ | ||
# frozen_string_literal: true | ||
|
||
class Api::V1::Timelines::LinkController < Api::V1::Timelines::BaseController | ||
before_action -> { doorkeeper_authorize! :read, :'read:statuses' }, only: :show, if: :require_auth? | ||
before_action :set_preview_card | ||
before_action :set_statuses | ||
|
||
PERMITTED_PARAMS = %i( | ||
url | ||
limit | ||
).freeze | ||
|
||
def show | ||
cache_if_unauthenticated! | ||
render json: @statuses, each_serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id) | ||
end | ||
|
||
private | ||
|
||
def require_auth? | ||
!Setting.timeline_preview | ||
end | ||
|
||
def set_preview_card | ||
@preview_card = PreviewCard.joins(:trend).merge(PreviewCardTrend.allowed).find_by!(url: params[:url]) | ||
end | ||
|
||
def set_statuses | ||
@statuses = @preview_card.nil? ? [] : preload_collection(link_timeline_statuses, Status) | ||
end | ||
|
||
def link_timeline_statuses | ||
link_feed.get( | ||
limit_param(DEFAULT_STATUSES_LIMIT), | ||
params[:max_id], | ||
params[:since_id], | ||
params[:min_id] | ||
) | ||
end | ||
|
||
def link_feed | ||
LinkFeed.new(@preview_card, current_account) | ||
end | ||
|
||
def next_path | ||
api_v1_timelines_link_url next_path_params | ||
end | ||
|
||
def prev_path | ||
api_v1_timelines_link_url prev_path_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
Oops, something went wrong.