instance_actors_controller.rb 685 B

1234567891011121314151617181920212223242526
  1. # frozen_string_literal: true
  2. class InstanceActorsController < ActivityPub::BaseController
  3. vary_by ''
  4. serialization_scope nil
  5. before_action :set_account
  6. skip_before_action :require_functional!
  7. skip_before_action :update_user_sign_in
  8. def show
  9. expires_in 10.minutes, public: true
  10. render json: @account, content_type: 'application/activity+json', serializer: ActivityPub::ActorSerializer, adapter: ActivityPub::Adapter, fields: restrict_fields_to
  11. end
  12. private
  13. def set_account
  14. @account = Account.representative
  15. end
  16. def restrict_fields_to
  17. %i(id type preferred_username inbox outbox public_key endpoints url manually_approves_followers)
  18. end
  19. end