Skip to content

Commit

Permalink
Allow adding relays while secure mode & limited federation mode are e…
Browse files Browse the repository at this point in the history
…nabled (mastodon#22324)
  • Loading branch information
ineffyble authored Dec 15, 2022
1 parent 7b68e64 commit 441cac7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/controllers/admin/relays_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Admin
class RelaysController < BaseController
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
authorize :relay, :update?
Expand Down Expand Up @@ -56,8 +56,8 @@ def resource_params
params.require(:relay).permit(:inbox_url)
end

def require_signatures_enabled!
redirect_to admin_relays_path, alert: I18n.t('admin.relays.signatures_not_enabled') if authorized_fetch_mode?
def warn_signatures_not_enabled!
flash.now[:error] = I18n.t('admin.relays.signatures_not_enabled') if authorized_fetch_mode?
end
end
end
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ en:
pending: Waiting for relay's approval
save_and_enable: Save and enable
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
title: Relays
report_notes:
Expand Down

0 comments on commit 441cac7

Please sign in to comment.