diff --git a/app/javascript/mastodon/components/dismissable_banner.tsx b/app/javascript/mastodon/components/dismissable_banner.tsx index d5cdb07503..04a28e3cbe 100644 --- a/app/javascript/mastodon/components/dismissable_banner.tsx +++ b/app/javascript/mastodon/components/dismissable_banner.tsx @@ -33,8 +33,6 @@ export const DismissableBanner: React.FC> = ({ return (
-
{children}
-
> = ({ onClick={handleDismiss} />
+ +
{children}
); }; diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 9db7047791..06da39f0b9 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -9300,9 +9300,7 @@ noscript { } &__action { - position: absolute; - inset-inline-end: 0; - top: 0; + float: right; padding: 15px 10px; .icon-button { diff --git a/app/javascript/styles/mastodon/rtl.scss b/app/javascript/styles/mastodon/rtl.scss index 8d3d32665c..b5c4836bcd 100644 --- a/app/javascript/styles/mastodon/rtl.scss +++ b/app/javascript/styles/mastodon/rtl.scss @@ -58,4 +58,11 @@ body.rtl { .fa-chevron-right::before { content: '\F053'; } + + .dismissable-banner, + .warning-banner { + &__action { + float: left; + } + } } diff --git a/app/lib/activitypub/activity/update.rb b/app/lib/activitypub/activity/update.rb index 0a7762ee39..973706f595 100644 --- a/app/lib/activitypub/activity/update.rb +++ b/app/lib/activitypub/activity/update.rb @@ -30,6 +30,6 @@ class ActivityPub::Activity::Update < ActivityPub::Activity return if @status.nil? - ActivityPub::ProcessStatusUpdateService.new.call(@status, @object, request_id: @options[:request_id]) + ActivityPub::ProcessStatusUpdateService.new.call(@status, @json, @object, request_id: @options[:request_id]) end end diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index bffd5b8705..12db968c5a 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -417,6 +417,6 @@ class MediaAttachment < ApplicationRecord end def reset_parent_cache - Rails.cache.delete("statuses/#{status_id}") if status_id.present? + Rails.cache.delete("v3:statuses/#{status_id}") if status_id.present? end end diff --git a/app/models/poll.rb b/app/models/poll.rb index efa625eb5b..72f04f00a7 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -108,7 +108,7 @@ class Poll < ApplicationRecord def reset_parent_cache return if status_id.nil? - Rails.cache.delete("statuses/#{status_id}") + Rails.cache.delete("v3:statuses/#{status_id}") end def last_fetched_before_expiration? diff --git a/app/models/status_stat.rb b/app/models/status_stat.rb index dbbc95948b..7c7e32d434 100644 --- a/app/models/status_stat.rb +++ b/app/models/status_stat.rb @@ -21,8 +21,6 @@ class StatusStat < ApplicationRecord belongs_to :status, inverse_of: :status_stat - after_commit :reset_parent_cache - def replies_count [attributes['replies_count'], 0].max end @@ -50,10 +48,4 @@ class StatusStat < ApplicationRecord def status_referred_by_count [attributes['status_referred_by_count'] || 0, 0].max end - - private - - def reset_parent_cache - Rails.cache.delete("statuses/#{status_id}") - end end diff --git a/app/services/activitypub/fetch_remote_poll_service.rb b/app/services/activitypub/fetch_remote_poll_service.rb index 1829e791ce..41b9b2f0c9 100644 --- a/app/services/activitypub/fetch_remote_poll_service.rb +++ b/app/services/activitypub/fetch_remote_poll_service.rb @@ -8,6 +8,6 @@ class ActivityPub::FetchRemotePollService < BaseService return unless supported_context?(json) - ActivityPub::ProcessStatusUpdateService.new.call(poll.status, json) + ActivityPub::ProcessStatusUpdateService.new.call(poll.status, json, json) end end diff --git a/app/services/activitypub/process_status_update_service.rb b/app/services/activitypub/process_status_update_service.rb index 7ee444dea4..dd6c8bc8a1 100644 --- a/app/services/activitypub/process_status_update_service.rb +++ b/app/services/activitypub/process_status_update_service.rb @@ -5,10 +5,11 @@ class ActivityPub::ProcessStatusUpdateService < BaseService include Redisable include Lockable - def call(status, json, request_id: nil) + def call(status, activity_json, object_json, request_id: nil) raise ArgumentError, 'Status has unsaved changes' if status.changed? - @json = json + @activity_json = activity_json + @json = object_json @status_parser = ActivityPub::Parser::StatusParser.new(@json) @uri = @status_parser.uri @status = status @@ -324,6 +325,6 @@ class ActivityPub::ProcessStatusUpdateService < BaseService end def forwarder - @forwarder ||= ActivityPub::Forwarder.new(@account, @json, @status) + @forwarder ||= ActivityPub::Forwarder.new(@account, @activity_json, @status) end end diff --git a/app/services/statuses_search_service.rb b/app/services/statuses_search_service.rb index 99921d1957..72468496bb 100644 --- a/app/services/statuses_search_service.rb +++ b/app/services/statuses_search_service.rb @@ -43,12 +43,12 @@ class StatusesSearchService < BaseService end if @options[:min_id] - timestamp = Mastodon::Snowflake.to_time(@options[:min_id]) + timestamp = Mastodon::Snowflake.to_time(@options[:min_id].to_i) syntax_options << "after:\"#{timestamp.iso8601}\"" end if @options[:max_id] - timestamp = Mastodon::Snowflake.to_time(@options[:max_id]) + timestamp = Mastodon::Snowflake.to_time(@options[:max_id].to_i) syntax_options << "before:\"#{timestamp.iso8601}\"" end diff --git a/install/setup1.sh b/install/setup1.sh new file mode 100644 index 0000000000..51d6c4b518 --- /dev/null +++ b/install/setup1.sh @@ -0,0 +1,58 @@ +apt update && apt upgrade -y + +apt install -y curl wget gnupg apt-transport-https lsb-release ca-certificates + +# nodejs +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list +sudo apt-get update && sudo apt-get install nodejs -y + +# postgresql +wget -O /usr/share/keyrings/postgresql.asc https://www.postgresql.org/media/keys/ACCC4CF8.asc +echo "deb [signed-by=/usr/share/keyrings/postgresql.asc] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/postgresql.list + +apt update +apt install -y \ + imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file git-core \ + g++ libprotobuf-dev protobuf-compiler pkg-config nodejs gcc autoconf \ + bison build-essential libssl-dev libyaml-dev libreadline6-dev \ + zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev \ + nginx redis-server redis-tools postgresql postgresql-contrib \ + certbot python3-certbot-nginx libidn11-dev libicu-dev libjemalloc-dev + +corepack enable +yarn set version classic + +adduser --disabled-login mastodon +su - mastodon << EOF + +git clone https://github.com/rbenv/rbenv.git /home/mastodon/.rbenv +cd /home/mastodon/.rbenv && src/configure && make -C src +echo 'export PATH="/home/mastodon/.rbenv/bin:$PATH"' >> /home/mastodon/.bashrc +echo 'eval "$(rbenv init -)"' >> /home/mastodon/.bashrc +exec bash +git clone https://github.com/rbenv/ruby-build.git /home/mastodon/.rbenv/plugins/ruby-build + +RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 3.2.2 +rbenv global 3.2.2 + +gem install bundler --no-document + +EOF + +sudo -u postgres psql << EOF + CREATE USER mastodon WITH PASSWORD 'ohagi' CREATEDB; +EOF + +su - mastodon <=3.0.0 <4.0.0" immutable "^4.0.0"