Skip to content

Add instance actor (second take)#11321

Merged
Gargron merged 19 commits intomastodon:masterfrom
ClearlyClaire:features/instance-actor-v2
Jul 18, 2019
Merged

Add instance actor (second take)#11321
Gargron merged 19 commits intomastodon:masterfrom
ClearlyClaire:features/instance-actor-v2

Conversation

@ClearlyClaire
Copy link
Copy Markdown
Contributor

#10457 but using an actual Account with the following tricks:

  • use instance.tld as username, to make sure we're not hitting an existing username
  • use Application as actor_type and 0 as id to uniquely
  • only serialize a subset of the Actor fields
  • use its own route and controller to make it unique and avoid issues with dots in paths

It seems to work, I am not sure what may be missing but I haven't actually tested federating with it yet.

@ClearlyClaire ClearlyClaire force-pushed the features/instance-actor-v2 branch from 9423fc2 to 9588c6b Compare July 15, 2019 15:27
Comment thread app/controllers/instance_actors_controller.rb Outdated
Comment thread app/serializers/activitypub/actor_serializer.rb Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't really tell how this is going to look from code alone but do we need a HTML page for this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The page is useful to let people know what this actor is about, as it may be confusing. Having it on a separate page allows people to know at a glance that it is a special user.

It looks like this:
image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the url maybe just point to the /about page then? What I'm trying to avoid is the maintenance cost of another static page design because they've tended to be redesigned quite a few times so far.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, we really want to explain what this account is for. I should probably reword that description btw.

Comment thread config/routes.rb Outdated
Comment thread db/migrate/20190715164535_add_instance_actor.rb Outdated
@Gargron
Copy link
Copy Markdown
Member

Gargron commented Jul 15, 2019

You should probably make Account.representative return this record

@ClearlyClaire
Copy link
Copy Markdown
Contributor Author

You should probably make Account.representative return this record

Yes, I will do that, I just need to think about how to do cleanly, and I'd have to adjust the tests.

@ClearlyClaire ClearlyClaire force-pushed the features/instance-actor-v2 branch 4 times, most recently from b3534d8 to f712c3f Compare July 15, 2019 21:08
@ClearlyClaire ClearlyClaire requested a review from Gargron July 16, 2019 10:50
@ClearlyClaire ClearlyClaire force-pushed the features/instance-actor-v2 branch from cd3bef2 to b3759ed Compare July 16, 2019 21:27
@ClearlyClaire ClearlyClaire force-pushed the features/instance-actor-v2 branch from daec7be to d473be6 Compare July 16, 2019 22:24
@ClearlyClaire ClearlyClaire force-pushed the features/instance-actor-v2 branch from 7b7a63c to 9b0a4ba Compare July 18, 2019 21:39
@ClearlyClaire
Copy link
Copy Markdown
Contributor Author

Changed the instance actor profile URL to /about/more?instance_actor=true which displays a flash message:
image

This has the added benefit of always returning json for the actor URI, thus not having to worry about the Vary header for caching.

@ClearlyClaire ClearlyClaire force-pushed the features/instance-actor-v2 branch 3 times, most recently from 774e53f to 3112f34 Compare July 18, 2019 21:48
@ClearlyClaire ClearlyClaire force-pushed the features/instance-actor-v2 branch from 3112f34 to c6aec6e Compare July 18, 2019 21:52
@Gargron Gargron merged commit 730c405 into mastodon:master Jul 18, 2019
@ClearlyClaire ClearlyClaire mentioned this pull request Jul 23, 2019
6 tasks
@Pizzacus
Copy link
Copy Markdown

Pizzacus commented Aug 1, 2019

It is used for federation purposes and should not be blocked unless you want to block the whole instance

So far, the English version of Mastodon has been VERY consistent about using the word "server" instead of "instance".

This would actually be, as far as I know, the first time the word "instance" is used on the actual UI.

This should be addressed should it not?

hiyuki2578 pushed a commit to ProjectMyosotis/mastodon that referenced this pull request Oct 2, 2019
* Add support for an instance actor

* Skip username validation for local Application accounts

* Add migration script to create instance actor

* Make Codeclimate happy

* Switch to id -99 for instance actor

* Remove unused `icon` and `image` attributes from instance actor

* Use if/elsif/else instead of return + ternary operator

* Add instance actor to fresh installs

* Use instance actor as instance representative

Use instance actor for forwarding reports, relay operations, and spam
auto-reporting.

* Seed database in test environment

* Fix single-user mode

* Fix tests

* Fix specs to accomodate for an extra `Account`

* Auto-reject follows on instance actor

Following an instance actor might make sense, but we are not handling that
right now, so auto-reject.

* Fix webfinger lookup and serialization for instance actor

* Rename instance actor

* Make it clear in the HTML view that the instance actor should not be blocked

* Raise cache time for instance actor as there's no dynamic content

* Re-use /about/more with a flash message for instance actor profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants