~x3b0b


#100 500 error when trying to reply to someone whose instance won't let you look them up 28 days ago

Comment by ~x3b0b on ~tsileo/microblog.pub

I almost replied without double-checking, because you did it almost exactly the same way I tried. (logging whose lookup failed is an improvement over my quick fix.) But yes, verified this prevents the error. Thanks!

#99 Article list is marked up as h-feed with no h-entries 28 days ago

Comment by ~x3b0b on ~tsileo/microblog.pub

I think you're correct that it is not technically needed; the h-feed documentation says to do that to aid in discovering the "feed or feeds" if your home page doesn't contain your primary feed, and the "feed autodiscovery" section had given me the impression that if the home page contained a feed but there were also links on the homepage that went to other feeds, they should be marked that way. On further inspection and reading, I think:

  1. I may just be straight-up doing it wrong. I think, to the extent it's supposed to be correct, it may be supposed to be for a link in the head, not for an a, for one thing, and what I'd done was mark up the anchors in the header, not the links in the head.
  2. I'm pretty sure the only use-case in which what I thought I was doing would matter would be someone using a reader or browser that actually detected, from looking at the home page, that there were multiple h-feeds available...and in that case I think I should be marking up leads to tags the same way.

I'm probably going to back that part of my changes out for now and ask around.

#49 Feat: allow like/reply/share content from non-fedi sources 28 days ago

on ~tsileo/microblog.pub

Heya, Sorry for the late reply, I've been travelling. I think option number two makes sense. It might also make it easy to allow subscription to h-feed and rss content in the future?

regards, Ash

On Sun, Jan 1, 2023 at 8:39 AM ~x3b0b outgoing@sr.ht wrote:

For what it's worth: Since all the appropriate microformats markup for IndieWeb replies/likes/favorites/reposts go inside the h-entry, I had previously concluded that this should be possible already - it just isn't convenient, because without any special UI for it, you have to write the HTML yourself. And, as you alluded to, it currently appears as an AP note (or article, presumably) with a link in it. Which, of course, is an entirely reasonable thing to post, but doesn't convey the same meaning.

I had already been meaning to test that conclusion, so I did: https://bw3.dev/o/7e024e0ff6f34dee8c93e976887b899c

If you go to the target article (and enable javascript), you can see that it correctly picked my mention up as a like.

That said, I'm all for lowering the barrier of "you can do it, but you have to write your own markup" if you are happy with your idea for how.

As for the visibility option, I can definitely see how this and other purposes might make it nice to be able to say "don't send this to my followers" without also having to say "don't let anyone I didn't mention see it." I had to look at some posts and how-tos to try to be sure I was remembering this correctly, but while favorites/likes/reactions in the Fediverse are public information, in that you can look and see who has liked a post; but unlike boosts/reposts/replies, they don't turn up in your followers' timelines. So on top of AP not supporting such actions on non-AP objects, what I described above is inherently more visible to your followers than the equivalent AP action.

After doing some more tests, I've now thoroughly confused myself as to whether or not I think it potentially makes sense to want to skip sending a post to the AP stream without also making it unlisted, partly because my thoughts on that bleed over into two completely separate (but slightly related) enhancements I've been thinking about trying to implement myself.

-- View on the web: https://todo.sr.ht/~tsileo/microblog.pub/49#event-219475

-- regards, Ashton McAllan http://acegiak.net

#100 500 error when trying to reply to someone whose instance won't let you look them up 28 days ago

Comment by ~x3b0b on ~tsileo/microblog.pub

Doggone it, I said that wrong. This was technically an attempt to reply to a post that mentioned the unavailable profile, not one of that actor's posts, but I suspect the result would be the same, since either way my server would try to look him up and fail.

#100 500 error when trying to reply to someone whose instance won't let you look them up 28 days ago

Ticket created by ~x3b0b on ~tsileo/microblog.pub

Stack trace:

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/opt/venv/.venv/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 404, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/.venv/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/.venv/lib/python3.11/site-packages/fastapi/applications.py", line 269, in __call__
    await super().__call__(scope, receive, send)
  File "/opt/venv/.venv/lib/python3.11/site-packages/starlette/applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/opt/venv/.venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/opt/venv/.venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/opt/venv/.venv/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/app/main.py", line 176, in __call__
    await self.app(scope, receive, send_wrapper)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/.venv/lib/python3.11/site-packages/starlette/exceptions.py", line 93, in __call__
    raise exc
  File "/opt/venv/.venv/lib/python3.11/site-packages/starlette/exceptions.py", line 82, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.11/contextlib.py", line 222, in __aexit__
    await self.gen.athrow(typ, value, traceback)
  File "/app/app/database.py", line 33, in get_db_session
    yield session
  File "/opt/venv/.venv/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/opt/venv/.venv/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/opt/venv/.venv/lib/python3.11/site-packages/starlette/routing.py", line 670, in __call__
    await route.handle(scope, receive, send)
  File "/opt/venv/.venv/lib/python3.11/site-packages/starlette/routing.py", line 266, in handle
    await self.app(scope, receive, send)
  File "/opt/venv/.venv/lib/python3.11/site-packages/starlette/routing.py", line 65, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/.venv/lib/python3.11/site-packages/fastapi/routing.py", line 227, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/.venv/lib/python3.11/site-packages/fastapi/routing.py", line 160, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/app/admin.py", line 192, in admin_new
    mentioned_actor = await fetch_actor(db_session, tag["href"])
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/app/actor.py", line 271, in fetch_actor
    ap_actor = await ap.fetch(actor_id)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/app/activitypub.py", line 199, in fetch
    raise ObjectUnavailableError(url, resp)

To reproduce: attempt to start a reply to a post by someone whose instance uses whitelisting and you aren't on the whitelist, apparently?

Per the user's other profile at https://mstdn.social/@binarytango: "Main account over at @binarytango. If you can't see it, let me know and I'll whitelist the instance you're on."

For reference, trying to start such a reply from my other fediverse account - on a server that is also apparently not whitelisted - instead omits that actor from the @'s. This gave me the idea of just wrapping a try around the attempt to add each mentioned actor, which appears to yield that same result.

I don't think any of the files in the stach trace are ones I've modified yet, so hopefully the line numbers are useful.

#99 Article list is marked up as h-feed with no h-entries 29 days ago

Ticket created by ~x3b0b on ~tsileo/microblog.pub

The result is that a social reader (tested with Monocle) will see the articles endpoint as a valid feed with no entries. I have modified my instance to mark up the article list items as h-entry, the timestamps with dt-published, the links themselves as u-url p-name, and (because my understanding is that this is desirable for feed discovery) the "Notes" and "Articles" links in the header with rel="alternate" type="text/mf2+html" and I'm pleased with the result, but poetry and invoke have me sufficiently baffled that I haven't been able to format, lint, and test.

#49 Feat: allow like/reply/share content from non-fedi sources 30 days ago

Comment by ~x3b0b on ~tsileo/microblog.pub

For what it's worth: Since all the appropriate microformats markup for IndieWeb replies/likes/favorites/reposts go inside the h-entry, I had previously concluded that this should be possible already - it just isn't convenient, because without any special UI for it, you have to write the HTML yourself. And, as you alluded to, it currently appears as an AP note (or article, presumably) with a link in it. Which, of course, is an entirely reasonable thing to post, but doesn't convey the same meaning.

I had already been meaning to test that conclusion, so I did: https://bw3.dev/o/7e024e0ff6f34dee8c93e976887b899c

If you go to the target article (and enable javascript), you can see that it correctly picked my mention up as a like.

That said, I'm all for lowering the barrier of "you can do it, but you have to write your own markup" if you are happy with your idea for how.

As for the visibility option, I can definitely see how this and other purposes might make it nice to be able to say "don't send this to my followers" without also having to say "don't let anyone I didn't mention see it." I had to look at some posts and how-tos to try to be sure I was remembering this correctly, but while favorites/likes/reactions in the Fediverse are public information, in that you can look and see who has liked a post; but unlike boosts/reposts/replies, they don't turn up in your followers' timelines. So on top of AP not supporting such actions on non-AP objects, what I described above is inherently more visible to your followers than the equivalent AP action.

After doing some more tests, I've now thoroughly confused myself as to whether or not I think it potentially makes sense to want to skip sending a post to the AP stream without also making it unlisted, partly because my thoughts on that bleed over into two completely separate (but slightly related) enhancements I've been thinking about trying to implement myself.

#81 Question about proxy a month ago

Comment by ~x3b0b on ~tsileo/microblog.pub

...Okay, I should have tested this more thoroughly. 🤦

It seems that it only behaves exactly this way (so far) if I try to use this:

[㬋](https://unicode.link/codepoint/3B0B-cjk-name-of-a-star)

I was thrown off because I had previously tried to use this:

[㬋](https://codepoints.net/U+3B0B)

...which does not result in the URLs being rewritten so that they attempt to phone home, but does seem to try to proxy https://codepoints.net/api/v1/glyph/3B0B and displays a broken image. I remember trying the first URL as a replacement; I thought I remembered verifying that the rest of the behavior was similar, but it was late, and I must have thought about it but not done it. Sorry about that.

#81 Question about proxy a month ago

Ticket created by ~x3b0b on ~tsileo/microblog.pub

I'm trying to figure out whether I've got something configured wrong or I'm hitting a bug in the media proxy implementation. I've got a note I want to post that includes a link. I'm making it as a test post for mentioned actors only (of which there are none). I put the link in the markdown, post saves, no problem there...but at the bottom of the note it's adding a div.activity-og-meta containing a link to https://127.0.0.1:12658/<path component of the link> and, in front of that, what appears to be a broken attempt to proxy https://127.0.0.1:12658/logo-512.png. The proxied media request is raising a 500 error "Exception in ASGI Application" that ultimately appears to be coming from url.py raising an InvalidURLError when serve_proxy_media calls check_url because it says "https://127.0.0.1:12658/logo-512.png" is invalid (due to being recognized as a local address, I think, and that much seems entirely reasonable), but I haven't gotten as far as figuring out how it came up with something at 127.0.0.1 as what it wants to proxy in the first place (and I wasn't really expecting it to try to proxy anything about a link to a page about a unicode code point, either). I'm afraid it may end up being something screwy about my hosting setup, but I thought I'd start with this much and see if it's a recognizable problem already.