Merge commit '34cd7d6585992c03298c175ab5d22ad059b58cdb' into glitch-soc/merge-upstream

Conflicts:
- `CONTRIBUTING.md`:
  Upstream changed the file, while we had a different one.
  Updated the common parts.
- `README.md`:
  Upstream changed the file, while we had a different one.
  Updated the common parts.
- `app/helpers/application_helper.rb`:
  Upstream added helpers where glitch-soc had extra ones.
  Added upstream's new helpers.
- `app/models/form/admin_settings.rb`:
  Upstream added some custom handling of one setting, while
  glitch-soc had additional code.
  Ported upstream's code.
- `lib/mastodon/version.rb`:
  Upstream moved some things to `config/mastodon.yml`.
  Did the same.
- `spec/requests/api/v1/accounts/credentials_spec.rb`:
  I don't know honestly.
This commit is contained in:
Claire
2025-01-10 20:36:25 +01:00
127 changed files with 1766 additions and 1224 deletions

View File

@@ -192,6 +192,7 @@ module Mastodon::CLI
verify_schema_version!
verify_sidekiq_not_active!
verify_backup_warning!
disable_timeout!
end
def process_deduplications
@@ -251,6 +252,13 @@ module Mastodon::CLI
fail_with_message 'Maintenance process stopped.' unless yes?('Continue? (Yes/No)')
end
def disable_timeout!
# Remove server-configured timeout if present
database_connection.execute(<<~SQL.squish)
SET statement_timeout = 0
SQL
end
def deduplicate_accounts!
remove_index_if_exists!(:accounts, 'index_accounts_on_username_and_domain_lower')

View File

@@ -21,11 +21,11 @@ module Mastodon
end
def prerelease
ENV['MASTODON_VERSION_PRERELEASE'].presence || default_prerelease
version_configuration[:prerelease].presence || default_prerelease
end
def build_metadata
['glitch', ENV.fetch('MASTODON_VERSION_METADATA', nil)].compact_blank.join('.')
version_configuration[:metadata]
end
def to_a
@@ -77,5 +77,9 @@ module Mastodon
def user_agent
@user_agent ||= "Mastodon/#{Version} (#{HTTP::Request::USER_AGENT}; +http#{Rails.configuration.x.use_https ? 's' : ''}://#{Rails.configuration.x.web_domain}/)"
end
def version_configuration
Rails.configuration.x.mastodon.version
end
end
end