News for hackers. Stuff that matters.
Re:Please Don't Share Our Links on Mastodon by jefftk on Wednesday May 01, 2024 @08:59AM (#40222534)
There are two problems here:

1. The "It's Foss" site is designed somewhat carelessly, where many things that could be static aren't, and so it goes under with even a bit of load.

2. Mastodon link preview is badly designed and not spec-compliant. Because the link previews are not triggered by a user request they should respect robots.txt (https://github.com/mastodon/mastodon/issues/21738), or they should start being triggered by a user request (https://github.com/mastodon/mastodon/issues/23662).

Re:Please Don't Share Our Links on Mastodon by johnea on Wednesday May 01, 2024 @03:23PM (#40228080)
Could mastedon federate the link preview as well as the link?

Some OP advice to "get a damn CDN" seems to be a responce rather than a correction of the issue.

Even poorly designed websites shouldn't face DDoS scale access by a social network sharing a link. The social network should mitigate it's massive parallelization.

Re:Please Don't Share Our Links on Mastodon by NotEvil on Wednesday May 01, 2024 @06:20PM (#40230310)
The idea has been discussed. The main problem is that Mastodon is a zero-trust environment, and we can't trust the other server to send us the correct preview.
Re:Please Don't Share Our Links on Mastodon by abeyer on Wednesday May 01, 2024 @09:39PM (#40231860)
Don't trust the server, trust the poster/client... that's really where the preview should be coming from anyway. And if you _don't_ trust the poster, you shouldn't be trusting anything they link you to anyway. It's trivial to lie to these preview generators with a couple of meta tags if the destination isn't trustworthy.
Re:Please Don't Share Our Links on Mastodon by ASalazarMX on Friday May 03, 2024 @02:24PM (#40250696)
> Could mastedon federate the link preview as well as the link?

Off-topic, but I love how "mastedon" sounds.

Re:Please Don't Share Our Links on Mastodon by willcipriano on Wednesday May 01, 2024 @03:43PM (#40228365)
The user submitting the link is requesting it if you want to play spec lawyer.
Re:Please Don't Share Our Links on Mastodon by jefftk on Wednesday May 01, 2024 @03:51PM (#40228477)
The way it currently works is:

1. You make a post that includes example.com/cats

2. Your post is federated to the instances your followers are on.

3. Those instances fetch example.com/cats in a fully automated way, and observe its preview image is example.com/tabby.jpg and fetch that as well. They save this locally.

4. When your followers view your federated post they see a short text extract from example.com/cats and a thumbnail of example.com/tabby.jpg

Step 3 is where the 'DDOS' is happening, and it's not a request issued by an agent of the original poster.

Re:Please Don't Share Our Links on Mastodon by willcipriano on Wednesday May 01, 2024 @03:56PM (#40228538)
A single user action can result in more than one http request to a service. The idea of the rule you are referring to is more about things that don't have any user input at all, like crawlers. A user asked for that, they said "I want all my pals to know about this page", even if it's a dumb thing that they asked for, they asked for it.
Re:Please Don't Share Our Links on Mastodon by jefftk on Wednesday May 01, 2024 @03:59PM (#40228576)
In step 3 the servers asking for the image are acting as agents of the followers, not of the original poster, no?
Re:Please Don't Share Our Links on Mastodon by willcipriano on Wednesday May 01, 2024 @04:11PM (#40228726)
Why did the original poster post it if not to have the image downloaded to be displayed in his friends feeds?
Re:Please Don't Share Our Links on Mastodon by jefftk on Wednesday May 01, 2024 @05:04PM (#40229392)
The image isn't actually the issue: it's the html for the web page. The image is static and quick to serve, the html is often dynamically generated for each visitor.

Thinking about other similar distributed systems, if I put a link to an html page in an RSS feed or a mailing list message, it's not normal for subscribers to be using clients that fetch linked pages. But if they did it's clearly as an agent of that user, and not as an agent of the poster?

Re:Please Don't Share Our Links on Mastodon by willcipriano on Wednesday May 01, 2024 @06:35PM (#40230463)
If I was the web service getting hit I'd be glad that somebody is even interested enough that I'm having this problem. I also have the wisdom to know complaining is unlikely to solve my issue.

I get paid to basically solve this sort of scaling problems so I'm not a great barometer but it isn't that hard to handle a traffic spike like this.

Re:Please Don't Share Our Links on Mastodon by joshspankit on Wednesday May 01, 2024 @08:10PM (#40231233)
Maybe it’s time for a new web spec: something that lets federated platforms request link previews with minimal resources. Realistically you need max two requests (one for the structured text, one for the preview media) and those can be heavily cached.