mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 07:49:29 +00:00
Merge commit '7c10b0fb7a078661558fef86399d86831423260c' into glitch-soc/merge-upstream
This commit is contained in:
@@ -36,4 +36,11 @@ module Mastodon
|
||||
super()
|
||||
end
|
||||
end
|
||||
|
||||
HTTP_CONNECTION_ERRORS = [
|
||||
HTTP::ConnectionError,
|
||||
HTTP::Error,
|
||||
HTTP::TimeoutError,
|
||||
OpenSSL::SSL::SSLError,
|
||||
].freeze
|
||||
end
|
||||
|
||||
@@ -305,7 +305,7 @@ module Mastodon::CLI
|
||||
|
||||
begin
|
||||
code = Request.new(:head, account.uri).perform(&:code)
|
||||
rescue HTTP::TimeoutError, HTTP::ConnectionError, OpenSSL::SSL::SSLError, Mastodon::PrivateNetworkAddressError
|
||||
rescue *Mastodon::HTTP_CONNECTION_ERRORS, Mastodon::PrivateNetworkAddressError
|
||||
skip_domains << account.domain
|
||||
end
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ require_relative 'base'
|
||||
|
||||
module Mastodon::CLI
|
||||
class IpBlocks < Base
|
||||
option :severity, required: true, enum: %w(no_access sign_up_requires_approval sign_up_block), desc: 'Severity of the block'
|
||||
option :severity, required: true, enum: IpBlock.severities.keys, desc: 'Severity of the block'
|
||||
option :comment, aliases: [:c], desc: 'Optional comment'
|
||||
option :duration, aliases: [:d], type: :numeric, desc: 'Duration of the block in seconds'
|
||||
option :force, type: :boolean, aliases: [:f], desc: 'Overwrite existing blocks'
|
||||
|
||||
@@ -7,8 +7,19 @@ namespace :db do
|
||||
namespace :encryption do
|
||||
desc 'Generate a set of keys for configuring Active Record encryption in a given environment'
|
||||
task :init do # rubocop:disable Rails/RakeEnvironment
|
||||
if %w(
|
||||
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY
|
||||
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT
|
||||
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY
|
||||
).any? { |key| ENV.key?(key) }
|
||||
pastel = Pastel.new
|
||||
puts pastel.red(<<~MSG)
|
||||
WARNING: It looks like encryption secrets have already been set. Please ensure you are not changing secrets for a Mastodon installation that already uses them, as this will cause data loss and other issues that are difficult to recover from.
|
||||
MSG
|
||||
end
|
||||
|
||||
puts <<~MSG
|
||||
Add these secret environment variables to your Mastodon environment (e.g. .env.production):#{' '}
|
||||
Add the following secret environment variables to your Mastodon environment (e.g. .env.production), ensure they are shared across all your nodes and do not change them after they are set:#{' '}
|
||||
|
||||
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=#{SecureRandom.alphanumeric(32)}
|
||||
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=#{SecureRandom.alphanumeric(32)}
|
||||
|
||||
Reference in New Issue
Block a user