instance_actors_controller.rb 643 B

1234567891011121314151617181920212223
  1. # frozen_string_literal: true
  2. class InstanceActorsController < ApplicationController
  3. include AccountControllerConcern
  4. skip_before_action :check_account_confirmation
  5. skip_around_action :set_locale
  6. def show
  7. expires_in 10.minutes, public: true
  8. render json: @account, content_type: 'application/activity+json', serializer: ActivityPub::ActorSerializer, adapter: ActivityPub::Adapter, fields: restrict_fields_to
  9. end
  10. private
  11. def set_account
  12. @account = Account.representative
  13. end
  14. def restrict_fields_to
  15. %i(id type preferred_username inbox outbox public_key endpoints url manually_approves_followers)
  16. end
  17. end