Merge commit 'fd284311e7' into kb_migration

This commit is contained in:
KMY 2023-08-01 17:59:16 +09:00
commit 287eacf5f3
400 changed files with 4667 additions and 5387 deletions

View file

@ -1,15 +0,0 @@
# frozen_string_literal: true
module ActionController
module ConditionalGetExtensions
def expires_in(*)
# This backports a fix from Rails 7 so that a more private Cache-Control
# can be overriden by calling expires_in on a specific controller action
response.cache_control.delete(:no_store)
super
end
end
end
ActionController::ConditionalGet.prepend(ActionController::ConditionalGetExtensions)

View file

@ -158,6 +158,9 @@ module Mastodon::CLI
when :fog
say('The fog storage driver is not supported for this operation at this time', :red)
exit(1)
when :azure
say('The azure storage driver is not supported for this operation at this time', :red)
exit(1)
when :filesystem
require 'find'

View file

@ -7,6 +7,7 @@ module Mastodon::CLI
# Indices are sorted by amount of data to be expected in each, so that
# smaller indices can go online sooner
INDICES = [
InstancesIndex,
AccountsIndex,
TagsIndex,
StatusesIndex,

View file

@ -46,6 +46,8 @@ module Mastodon::CLI
upgrade_storage_s3(progress, attachment, style)
when :fog
upgrade_storage_fog(progress, attachment, style)
when :azure
upgrade_storage_azure(progress, attachment, style)
when :filesystem
upgrade_storage_filesystem(progress, attachment, style)
end
@ -105,6 +107,11 @@ module Mastodon::CLI
exit(1)
end
def upgrade_storage_azure(_progress, _attachment, _style)
say('The azure storage driver is not supported for this operation at this time', :red)
exit(1)
end
def upgrade_storage_filesystem(progress, attachment, style)
previous_storage_schema_version = attachment.storage_schema_version
previous_path = attachment.path(style)

View file

@ -13,7 +13,7 @@ module Mastodon
end
def patch
5
6
end
def flags

View file

@ -438,12 +438,7 @@ namespace :mastodon do
"#{key}=#{escaped}"
end.join("\n")
generated_header = "# Generated with mastodon:setup on #{Time.now.utc}\n\n".dup
if incompatible_syntax
generated_header << "# Some variables in this file will be interpreted differently whether you are\n"
generated_header << "# using docker-compose or not.\n\n"
end
generated_header = generate_header(incompatible_syntax)
Rails.root.join('.env.production').write("#{generated_header}#{env_contents}\n")
@ -538,6 +533,19 @@ namespace :mastodon do
puts "VAPID_PUBLIC_KEY=#{vapid_key.public_key}"
end
end
private
def generate_header(include_warning)
default_message = "# Generated with mastodon:setup on #{Time.now.utc}\n\n"
default_message.tap do |string|
if include_warning
string << "# Some variables in this file will be interpreted differently whether you are\n"
string << "# using docker-compose or not.\n\n"
end
end
end
end
def disable_log_stdout!

11
lib/tasks/spec.rake Normal file
View file

@ -0,0 +1,11 @@
# frozen_string_literal: true
if Rake::Task.task_defined?('spec:system')
namespace :spec do
task :enable_system_specs do # rubocop:disable Rails/RakeEnvironment
ENV['RUN_SYSTEM_SPECS'] = 'true'
end
end
Rake::Task['spec:system'].enhance ['spec:enable_system_specs']
end