Skip to content

Use Contact User as Relay, Report, Subscribe.#9661

Merged
Gargron merged 6 commits intomastodon:masterfrom
yukimochi:use-contact-username
Jan 5, 2019
Merged

Use Contact User as Relay, Report, Subscribe.#9661
Gargron merged 6 commits intomastodon:masterfrom
yukimochi:use-contact-username

Conversation

@yukimochi
Copy link
Copy Markdown
Contributor

Following relay, sending report and subscribing are used user selected by Account.local.where(suspend: false) in Mastodon.
This method may give responsibility someone who does not know anything.
Use Contact User if set.

@yukimochi yukimochi force-pushed the use-contact-username branch from a58874f to c7c6496 Compare December 30, 2018 08:46
Comment thread app/models/relay.rb Outdated

def some_local_account
@some_local_account ||= Account.local.find_by(suspended: false)
@some_local_account ||= Account.find_local(Setting.site_contact_username.gsub(/\A@/, '')) || Account.local.find_by(suspended: false)
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.

Perhaps create Account.representative method?

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.

OK.
Sorry for many force-pushes, all done.

@yukimochi yukimochi force-pushed the use-contact-username branch 2 times, most recently from dda40e0 to 00c4f51 Compare December 30, 2018 09:15
@yukimochi yukimochi force-pushed the use-contact-username branch from 00c4f51 to d1e4342 Compare December 30, 2018 09:26
Comment thread app/services/subscribe_service.rb Outdated

def some_local_account
@some_local_account ||= Account.local.where(suspended: false).first
@some_local_account ||= Account.representative || Account.local.where(suspended: false).first
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.

no reason to use Account.representative here.

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.

Certainly, that's right.

@nightpool
Copy link
Copy Markdown
Member

I'm a little nervous about using some_local_account or Account.representative interchangeably—if we're saying relay subscription confers responsibility in some way, then the silent fallback could be dangerous. Certainly federated reports do confer responsibility. But at the same time, we can't expect that all instances have a contact_username set.

I think we should resolve this by having a "server" actor as suggested a couple of times when the relay and federated reports were being developed—the combined usecases of relays and federated reports make this make sense, even if we wouldn't want the complexity for either alone.

@ClearlyClaire
Copy link
Copy Markdown
Contributor

A server actor would also enable authenticating fetches without compromising privacy too much (for non-single-user instances at least).
This (combined with dropping LDS) would pave the way for stricter control of who gets to see toots (even public ones), allowing stronger instance blocks.

extend ActiveSupport::Concern

class_methods do
def representative!
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.

Since this is not used anywhere, I do not think it is required.

end

def representative
find_local(Setting.site_contact_username.gsub(/\A@/, ''))
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 believe the || Account.local.find_by(suspended: false) logic should be included here, since it is repeated everywhere this method is called.

@yukimochi
Copy link
Copy Markdown
Contributor Author

I thought too server actor may best way to solve problem, but that may need more time to implement.
Now non Mastodon ActivityPub implement may misread "who report" "who follow relay" is large problem, this is mitigation measures.

@Gargron Gargron merged commit fae3263 into mastodon:master Jan 5, 2019
@yukimochi yukimochi deleted the use-contact-username branch January 5, 2019 07:49
hiyuki2578 pushed a commit to ProjectMyosotis/mastodon that referenced this pull request Oct 2, 2019
* Use Contact User as Relay, Report, Subscribe.

* Use Account.representative to fetch contact user.

* Use find_local.

* No reason to use Account.representative in subscribe_service.

* Don't required representative!

* Fallback is included in Account.representative method.
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.

4 participants