Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instance actor (second take) #11321

Merged
merged 19 commits into from
Jul 18, 2019

Conversation

ClearlyClaire
Copy link
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.

app/controllers/instance_actors_controller.rb Outdated Show resolved Hide resolved
app/serializers/activitypub/actor_serializer.rb Outdated Show resolved Hide resolved
@@ -0,0 +1,48 @@
- content_for :page_title do
Copy link
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
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
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
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.

config/routes.rb Outdated Show resolved Hide resolved
@Gargron
Copy link
Member

Gargron commented Jul 15, 2019

You should probably make Account.representative return this record

@ClearlyClaire
Copy link
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
Copy link
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
@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

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