mirror of https://github.com/mastodon/mastodon
Put FASP support behind a feature flag
This commit is contained in:
parent
de3a9b247d
commit
f50bd3d6d9
|
@ -85,7 +85,7 @@ class Account < ApplicationRecord
|
|||
include Account::Associations
|
||||
include Account::Avatar
|
||||
include Account::Counters
|
||||
include Account::FaspConcern
|
||||
include Account::FaspConcern if Mastodon::Feature.fasp_enabled?
|
||||
include Account::FinderConcern
|
||||
include Account::Header
|
||||
include Account::Interactions
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
class Favourite < ApplicationRecord
|
||||
include Paginable
|
||||
include Favourite::FaspConcern
|
||||
include Favourite::FaspConcern if Mastodon::Feature.fasp_enabled?
|
||||
|
||||
update_index('statuses', :status)
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ class Status < ApplicationRecord
|
|||
include Discard::Model
|
||||
include Paginable
|
||||
include RateLimitable
|
||||
include Status::FaspConcern
|
||||
include Status::FaspConcern if Mastodon::Feature.fasp_enabled?
|
||||
include Status::SafeReblogInsert
|
||||
include Status::SearchConcern
|
||||
include Status::SnapshotConcern
|
||||
|
|
|
@ -34,6 +34,7 @@ require_relative '../lib/paperclip/transcoder'
|
|||
require_relative '../lib/paperclip/type_corrector'
|
||||
require_relative '../lib/paperclip/response_with_limit_adapter'
|
||||
require_relative '../lib/terrapin/multi_pipe_extensions'
|
||||
require_relative '../lib/mastodon/feature'
|
||||
require_relative '../lib/mastodon/snowflake'
|
||||
require_relative '../lib/mastodon/version'
|
||||
require_relative '../lib/mastodon/rack_middleware'
|
||||
|
|
|
@ -73,7 +73,7 @@ SimpleNavigation::Configuration.run do |navigation|
|
|||
s.item :announcements, safe_join([material_symbol('campaign'), t('admin.announcements.title')]), admin_announcements_path, highlights_on: %r{/admin/announcements}, if: -> { current_user.can?(:manage_announcements) }
|
||||
s.item :custom_emojis, safe_join([material_symbol('mood'), t('admin.custom_emojis.title')]), admin_custom_emojis_path, highlights_on: %r{/admin/custom_emojis}, if: -> { current_user.can?(:manage_custom_emojis) }
|
||||
s.item :webhooks, safe_join([material_symbol('inbox'), t('admin.webhooks.title')]), admin_webhooks_path, highlights_on: %r{/admin/webhooks}, if: -> { current_user.can?(:manage_webhooks) }
|
||||
s.item :fasp, safe_join([material_symbol('extension'), t('admin.fasp.title')]), admin_fasp_providers_path, highlights_on: %r{/admin/fasp}, if: -> { current_user.can?(:manage_federation) }
|
||||
s.item :fasp, safe_join([material_symbol('extension'), t('admin.fasp.title')]), admin_fasp_providers_path, highlights_on: %r{/admin/fasp}, if: -> { current_user.can?(:manage_federation) } if Mastodon::Feature.fasp_enabled?
|
||||
s.item :relays, safe_join([material_symbol('captive_portal'), t('admin.relays.title')]), admin_relays_path, highlights_on: %r{/admin/relays}, if: -> { !limited_federation_mode? && current_user.can?(:manage_federation) }
|
||||
end
|
||||
|
||||
|
|
|
@ -196,7 +196,7 @@ Rails.application.routes.draw do
|
|||
|
||||
draw(:api)
|
||||
|
||||
draw(:fasp)
|
||||
draw(:fasp) if Mastodon::Feature.fasp_enabled?
|
||||
|
||||
draw(:web_app)
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Mastodon
|
||||
module Feature
|
||||
FASP_ENABLED = ENV['EXPERIMENTAL_FASP'] == 'true'
|
||||
|
||||
def self.fasp_enabled?
|
||||
FASP_ENABLED
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue