From acf1842896682674d9ab4d0f87ec04c6174468fa Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 9 Feb 2021 01:21:06 +0100 Subject: Change max. image dimensions to 1920x1080px (1080p) (#15690) * Change max. image size to 1920x1080px * Change it in web UI too --- app/models/media_attachment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models') diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index 663bb0896..5cf4d8127 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -59,7 +59,7 @@ class MediaAttachment < ApplicationRecord IMAGE_STYLES = { original: { - pixels: 1_638_400, # 1280x1280px + pixels: 2_073_600, # 1920x1080px file_geometry_parser: FastGeometryParser, }.freeze, -- cgit From acdeb162b8c2e7d036c34690de85dea70277713d Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 9 Feb 2021 18:12:54 +0100 Subject: Create instance actor if it hasn't been properly seeded (#15693) An uncommon but somewhat difficult to digagnose issue is dealing with improperly-seeded databases. In such cases, instance-signed fetches will fail with a ActiveRecord::RecordNotFound error, usually caught and handled as generic 404, leading people to think the remote resource itself has not been found, while it's the local instance actor that does not exist. This commit changes the code so that failure to find the instance actor automatically creates a new one, so that improperly-seeded databases do not cause any issue. --- app/controllers/instance_actors_controller.rb | 2 +- app/models/concerns/account_finder_concern.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'app/models') diff --git a/app/controllers/instance_actors_controller.rb b/app/controllers/instance_actors_controller.rb index 4b074ca19..b3b5476e2 100644 --- a/app/controllers/instance_actors_controller.rb +++ b/app/controllers/instance_actors_controller.rb @@ -13,7 +13,7 @@ class InstanceActorsController < ApplicationController private def set_account - @account = Account.find(-99) + @account = Account.representative end def restrict_fields_to diff --git a/app/models/concerns/account_finder_concern.rb b/app/models/concerns/account_finder_concern.rb index 04b2c981b..0dadddad1 100644 --- a/app/models/concerns/account_finder_concern.rb +++ b/app/models/concerns/account_finder_concern.rb @@ -14,6 +14,8 @@ module AccountFinderConcern def representative Account.find(-99) + rescue ActiveRecord::RecordNotFound + Account.create!(id: -99, actor_type: 'Application', locked: true, username: Rails.configuration.x.local_domain) end def find_local(username) -- cgit