Freshrss: [Feature Request] Share to Mastodon

Created on 6 May 2017  路  27Comments  路  Source: FreshRSS/FreshRSS

tout est dans le titre :-)

et un grand merci pour votre travail... FreshRSS est une perle !

All 27 comments

@prolibre Merci. Auriez-vous sous la main la syntaxe du partage avec Mastodon ?

d茅sol茅 je reviens tardivement et les mains vides ... non pour l'heure je n'ai rien trouv茅 pour vous aider :-(

Je crois que tout est d茅crit dans cette page de doc: https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md

I guess it's called a Status on Mastodon. See here.
The main difference between that share and the one we already have is the HTTP action. ATM we only use the GET action but this one requires a POST action.
It's not as easy as it sounds at the first glance.

I have not read the spec' yet. Do any of you have an example of cURL request(s) that would do the job?

Here is something that might help!

So, I was working on that. I'm almost done but something came in the way. Firefox is blocking the post due to Content Security Policy. Apparently, there is no easy way to overcome that.
If you have any ideas, I would love to hear them.

@aledeg Could you give some more details about the problem?

@Alkarex When I send the post, the message is blocked by the browser because the destination URL is not on the same server. Thus triggering the rules of Content Security Policy.
I don't know if you need more than that.

Is the destination URL something controlled by a third-party?

Edit: silly question, of course it is or there would be an easy way around. :-P

Asking Mastodon developers to add a GET action for sharing might be easier, don't you think? :p

@marienfressinaud it could be done for Mastodon alone, but if we want to ask all providers, it would be a mess. For reference, #1513 .

If not server side, and if the only problem client side is our own CSP rule, then we could dynamically alter our CSP rule to allow the domains used in our list of shares. I believe this also requires the destination server to have appropriate CORS rules.

@Alkarex I tried to add my CSP rules but it didn't work (so far). I have to make some readings about it.
We need to find a way to add them dynamically. I haven't look deeply that issue.

Does anyone have ideas on how to apply the CSP rules? Or at least a good documentation about it?

https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
Are you asking about the format, or how it works?
Did you succeed with the POST request when CSP is disabled (i.e. comment-out this line)?
https://github.com/FreshRSS/FreshRSS/blob/3a5427ea7f0269361264ea918db87ccbe501bce8/app/FreshRSS.php#L114

I had no time yet. I will try again this week-end. Thanks for the documentation!

It works when the default-src has the value 'self' *.
We need to find a way to inject the share url in that header.

@prolibre There is a PR available. Could you try it out? THX

Merged in the /dev branch. Tests welcome :-)

How does this work ? What should be used as an instance URL ?
(I'm trying with https://mamot.fr, but the URI of the share link is just /rss/i/POST)

Salut @lapineige ... idem for me

Hi
There is a problem, I suppose, on Mastodon Sharing. I try to test that right now, and I always "p/i/POST" on sharing link.
It seems to be a problem with POST HTTP method, POST doesn't look correctly handled.

Is POST method a problem for FreshRSS? How can I do fixing this?

If someone can help me with. Thx

@aledeg Could you have a chance to look at this issue?

I will when I have time. I don't know when though

Was this page helpful?
0 / 5 - 0 ratings