Allow adding relays while secure mode & limited federation mode are enabled (#22324)

pull/21569/merge
Effy Elden 2022-12-16 01:56:05 +11:00 committed by GitHub
parent 7b68e6409b
commit 441cac758f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@
module Admin module Admin
class RelaysController < BaseController class RelaysController < BaseController
before_action :set_relay, except: [:index, :new, :create] before_action :set_relay, except: [:index, :new, :create]
before_action :require_signatures_enabled!, only: [:new, :create, :enable] before_action :warn_signatures_not_enabled!, only: [:new, :create, :enable]
def index def index
authorize :relay, :update? authorize :relay, :update?
@ -56,8 +56,8 @@ module Admin
params.require(:relay).permit(:inbox_url) params.require(:relay).permit(:inbox_url)
end end
def require_signatures_enabled! def warn_signatures_not_enabled!
redirect_to admin_relays_path, alert: I18n.t('admin.relays.signatures_not_enabled') if authorized_fetch_mode? flash.now[:error] = I18n.t('admin.relays.signatures_not_enabled') if authorized_fetch_mode?
end end
end end
end end

View File

@ -557,7 +557,7 @@ en:
pending: Waiting for relay's approval pending: Waiting for relay's approval
save_and_enable: Save and enable save_and_enable: Save and enable
setup: Setup a relay connection setup: Setup a relay connection
signatures_not_enabled: Relays will not work correctly while secure mode or limited federation mode is enabled signatures_not_enabled: Relays may not work correctly while secure mode or limited federation mode is enabled
status: Status status: Status
title: Relays title: Relays
report_notes: report_notes: