Update to v4.1.2
commit
0e0bd661f6
|
@ -1 +1 @@
|
||||||
3.0.4
|
3.0.6
|
||||||
|
|
14
CHANGELOG.md
14
CHANGELOG.md
|
@ -3,6 +3,20 @@ Changelog
|
||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [4.1.2] - 2023-04-04
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix crash in `tootctl` commands making use of parallelization when Elasticsearch is enabled ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/24182), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/24377))
|
||||||
|
- Fix crash in `db:setup` when Elasticsearch is enabled ([rrgeorge](https://github.com/mastodon/mastodon/pull/24302))
|
||||||
|
- Fix user archive takeout when using OpenStack Swift or S3 providers with no ACL support ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/24200))
|
||||||
|
- Fix invalid/expired invites being processed on sign-up ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/24337))
|
||||||
|
|
||||||
|
### Security
|
||||||
|
|
||||||
|
- Update Ruby to 3.0.6 due to ReDoS vulnerabilities ([saizai](https://github.com/mastodon/mastodon/pull/24334))
|
||||||
|
- Fix unescaped user input in LDAP query ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/24379))
|
||||||
|
|
||||||
## [4.1.1] - 2023-03-16
|
## [4.1.1] - 2023-03-16
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# This needs to be bullseye-slim because the Ruby image is built on bullseye-slim
|
# This needs to be bullseye-slim because the Ruby image is built on bullseye-slim
|
||||||
ARG NODE_VERSION="16.18.1-bullseye-slim"
|
ARG NODE_VERSION="16.18.1-bullseye-slim"
|
||||||
|
|
||||||
FROM ghcr.io/moritzheiber/ruby-jemalloc:3.0.4-slim as ruby
|
FROM ghcr.io/moritzheiber/ruby-jemalloc:3.0.6-slim as ruby
|
||||||
FROM node:${NODE_VERSION} as build
|
FROM node:${NODE_VERSION} as build
|
||||||
|
|
||||||
COPY --link --from=ruby /opt/ruby /opt/ruby
|
COPY --link --from=ruby /opt/ruby /opt/ruby
|
||||||
|
|
|
@ -120,8 +120,7 @@ GEM
|
||||||
bindata (2.4.14)
|
bindata (2.4.14)
|
||||||
binding_of_caller (1.0.0)
|
binding_of_caller (1.0.0)
|
||||||
debug_inspector (>= 0.0.1)
|
debug_inspector (>= 0.0.1)
|
||||||
blurhash (0.1.6)
|
blurhash (0.1.7)
|
||||||
ffi (~> 1.14)
|
|
||||||
bootsnap (1.16.0)
|
bootsnap (1.16.0)
|
||||||
msgpack (~> 1.2)
|
msgpack (~> 1.2)
|
||||||
brakeman (5.4.0)
|
brakeman (5.4.0)
|
||||||
|
|
|
@ -48,7 +48,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController
|
||||||
super(hash)
|
super(hash)
|
||||||
|
|
||||||
resource.locale = I18n.locale
|
resource.locale = I18n.locale
|
||||||
resource.invite_code = params[:invite_code] if resource.invite_code.blank?
|
resource.invite_code = @invite&.code if resource.invite_code.blank?
|
||||||
resource.registration_form_time = session[:registration_form_time]
|
resource.registration_form_time = session[:registration_form_time]
|
||||||
resource.sign_up_ip = request.remote_ip
|
resource.sign_up_ip = request.remote_ip
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,11 @@ class BackupsController < ApplicationController
|
||||||
when :s3
|
when :s3
|
||||||
redirect_to @backup.dump.expiring_url(10)
|
redirect_to @backup.dump.expiring_url(10)
|
||||||
when :fog
|
when :fog
|
||||||
redirect_to @backup.dump.expiring_url(Time.now.utc + 10)
|
if Paperclip::Attachment.default_options.dig(:storage, :fog_credentials, :openstack_temp_url_key).present?
|
||||||
|
redirect_to @backup.dump.expiring_url(Time.now.utc + 10)
|
||||||
|
else
|
||||||
|
redirect_to full_asset_url(@backup.dump.url)
|
||||||
|
end
|
||||||
when :filesystem
|
when :filesystem
|
||||||
redirect_to full_asset_url(@backup.dump.url)
|
redirect_to full_asset_url(@backup.dump.url)
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,6 +17,6 @@
|
||||||
class Backup < ApplicationRecord
|
class Backup < ApplicationRecord
|
||||||
belongs_to :user, inverse_of: :backups
|
belongs_to :user, inverse_of: :backups
|
||||||
|
|
||||||
has_attached_file :dump, s3_permissions: 'private'
|
has_attached_file :dump, s3_permissions: ->(*) { ENV['S3_PERMISSION'] == '' ? nil : 'private' }
|
||||||
do_not_validate_attachment_file_type :dump
|
do_not_validate_attachment_file_type :dump
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,7 +6,7 @@ module LdapAuthenticable
|
||||||
class_methods do
|
class_methods do
|
||||||
def authenticate_with_ldap(params = {})
|
def authenticate_with_ldap(params = {})
|
||||||
ldap = Net::LDAP.new(ldap_options)
|
ldap = Net::LDAP.new(ldap_options)
|
||||||
filter = format(Devise.ldap_search_filter, uid: Devise.ldap_uid, mail: Devise.ldap_mail, email: params[:email])
|
filter = format(Devise.ldap_search_filter, uid: Devise.ldap_uid, mail: Devise.ldap_mail, email: Net::LDAP::Filter.escape(params[:email]))
|
||||||
|
|
||||||
if (user_info = ldap.bind_as(base: Devise.ldap_base, filter: filter, password: params[:password]))
|
if (user_info = ldap.bind_as(base: Devise.ldap_base, filter: filter, password: params[:password]))
|
||||||
ldap_get_user(user_info.first)
|
ldap_get_user(user_info.first)
|
||||||
|
|
|
@ -39,6 +39,7 @@ require_relative '../lib/public_file_server_middleware'
|
||||||
require_relative '../lib/devise/two_factor_ldap_authenticatable'
|
require_relative '../lib/devise/two_factor_ldap_authenticatable'
|
||||||
require_relative '../lib/devise/two_factor_pam_authenticatable'
|
require_relative '../lib/devise/two_factor_pam_authenticatable'
|
||||||
require_relative '../lib/chewy/strategy/mastodon'
|
require_relative '../lib/chewy/strategy/mastodon'
|
||||||
|
require_relative '../lib/chewy/strategy/bypass_with_warning'
|
||||||
require_relative '../lib/webpacker/manifest_extensions'
|
require_relative '../lib/webpacker/manifest_extensions'
|
||||||
require_relative '../lib/webpacker/helper_extensions'
|
require_relative '../lib/webpacker/helper_extensions'
|
||||||
require_relative '../lib/rails/engine_extensions'
|
require_relative '../lib/rails/engine_extensions'
|
||||||
|
|
|
@ -19,6 +19,7 @@ Chewy.settings = {
|
||||||
# cycle, which takes care of checking if Elasticsearch is enabled
|
# cycle, which takes care of checking if Elasticsearch is enabled
|
||||||
# or not. However, mind that for the Rails console, the :urgent
|
# or not. However, mind that for the Rails console, the :urgent
|
||||||
# strategy is set automatically with no way to override it.
|
# strategy is set automatically with no way to override it.
|
||||||
|
Chewy.root_strategy = :bypass_with_warning if Rails.env.production?
|
||||||
Chewy.request_strategy = :mastodon
|
Chewy.request_strategy = :mastodon
|
||||||
Chewy.use_after_commit_callbacks = false
|
Chewy.use_after_commit_callbacks = false
|
||||||
|
|
||||||
|
|
|
@ -124,6 +124,7 @@ elsif ENV['SWIFT_ENABLED'] == 'true'
|
||||||
openstack_domain_name: ENV.fetch('SWIFT_DOMAIN_NAME') { 'default' },
|
openstack_domain_name: ENV.fetch('SWIFT_DOMAIN_NAME') { 'default' },
|
||||||
openstack_region: ENV['SWIFT_REGION'],
|
openstack_region: ENV['SWIFT_REGION'],
|
||||||
openstack_cache_ttl: ENV.fetch('SWIFT_CACHE_TTL') { 60 },
|
openstack_cache_ttl: ENV.fetch('SWIFT_CACHE_TTL') { 60 },
|
||||||
|
openstack_temp_url_key: ENV['SWIFT_TEMP_URL_KEY'],
|
||||||
},
|
},
|
||||||
|
|
||||||
fog_file: { 'Cache-Control' => 'public, max-age=315576000, immutable' },
|
fog_file: { 'Cache-Control' => 'public, max-age=315576000, immutable' },
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
Dir[Rails.root.join('db', 'seeds', '*.rb')].sort.each do |seed|
|
Chewy.strategy(:mastodon) do
|
||||||
load seed
|
Dir[Rails.root.join('db', 'seeds', '*.rb')].sort.each do |seed|
|
||||||
|
load seed
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module Chewy
|
||||||
|
class Strategy
|
||||||
|
class BypassWithWarning < Base
|
||||||
|
def update(...)
|
||||||
|
Rails.logger.warn 'Chewy update without a root strategy' unless @warning_issued
|
||||||
|
@warning_issued = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -53,14 +53,16 @@ module Mastodon
|
||||||
|
|
||||||
progress.log("Processing #{item.id}") if options[:verbose]
|
progress.log("Processing #{item.id}") if options[:verbose]
|
||||||
|
|
||||||
result = ActiveRecord::Base.connection_pool.with_connection do
|
Chewy.strategy(:mastodon) do
|
||||||
yield(item)
|
result = ActiveRecord::Base.connection_pool.with_connection do
|
||||||
ensure
|
yield(item)
|
||||||
RedisConfiguration.pool.checkin if Thread.current[:redis]
|
ensure
|
||||||
Thread.current[:redis] = nil
|
RedisConfiguration.pool.checkin if Thread.current[:redis]
|
||||||
end
|
Thread.current[:redis] = nil
|
||||||
|
end
|
||||||
|
|
||||||
aggregate.increment(result) if result.is_a?(Integer)
|
aggregate.increment(result) if result.is_a?(Integer)
|
||||||
|
end
|
||||||
rescue => e
|
rescue => e
|
||||||
progress.log pastel.red("Error processing #{item.id}: #{e}")
|
progress.log pastel.red("Error processing #{item.id}: #{e}")
|
||||||
ensure
|
ensure
|
||||||
|
|
|
@ -13,7 +13,7 @@ module Mastodon
|
||||||
end
|
end
|
||||||
|
|
||||||
def patch
|
def patch
|
||||||
1
|
2
|
||||||
end
|
end
|
||||||
|
|
||||||
def flags
|
def flags
|
||||||
|
|
Reference in New Issue