#social 2017-09-25
2017-09-25 UTC
rowan, xmpp-social, bwn and cdchapman joined the channel
# rowan hi; i’m working on a flask/mongodb implementation of ActivityPub, with the primary federation goal of mastodon servers, but I’m having trouble with account discovery. I can find my account on my server from masto, and it gets the correct displayname from webfinger, but doesn’t seem to folllow the links to fetch posts/image/etc. would anybody be open to helping me debug this/taking a look? (am i breaking social norms by straight-up asking? should i have
# rowan introduced myself first?)
# cwebber heya rowan :D
# rowan i figure that i must be missing some crucial ingredient; i thought that .well-known/host-meta was it, but that doesn’t seem to have worked, and then i thought that returning the webfinger info as xml was it, but that wasn’t, so i’m lost
# rowan hi!
# cwebber rowan: do you have an instance running publicly?
# rowan (acct:roo@populator.smilodon.social)
# cwebber rowan: what's the https id for the user?
# cwebber id/uri
# cwebber I can't answer everything about masto but I can check your user's as2 object
# rowan yeah that would be delightful :) i’ve been checking it against what things i’ve been able to find but running up against dead ends
# cwebber rowan: ok, I'll take a look, but it might take me an hour or so
# cwebber I'm in the middle of some things and would have to get to a stopping point
# rowan no rush, i’m in a meeting rn anyway :)
rowan joined the channel
# puckipedia (the idea is that you can GET whatever the "id" value is, and have that object be returned)
rowan, MMN-o and timbl joined the channel
# rowan puckipedia: thank you! so should api/roo#main-key pull the public key, then?
# puckipedia rowan: well, you don't GET towards the server with a fragment
# puckipedia so it's the requester's job to extract the sub-object with the fragment from the entire request
# rowan (context: i haven’t written an api before)
# puckipedia rowan: so do you know about JSON-LD
# rowan puckipedia: soort of? i haven’t read up on it very much because it didn’t look like i needed to understand it to implement AP, but maybe i do!
# puckipedia so, a few things that are handy to remember for JSON-LD compared to ActivityPub
# puckipedia 1. @context is used for defining extensions. This shouldn't be an issue, but look at what Mastodon sends
# puckipedia 2. the idea is that everything with an "id" can be retrieved by sending a GET request to that id
# puckipedia so if you e.g. have a post,
{"id": "https://kroeg.azurewebsites.net/puckipedia/status/fd88fa75", "type": "Create"}
you can get it by doing GET https://kroeg.azurewebsites.net/puckipedia/status/fd88fa75# rowan right
# cwebber thanks for all your help on this puckipedia
# rowan (ditto cwebber)
# cwebber sorry I'm not being more helpful at this second, I'm doing actual client work in a client's office :)
# puckipedia rowan: my server has a feature where if you append .json, you get the AS2 representation, might be useful to fiture out what is going on :P
# cwebber puckipedia: huh, that's a clever feature
# puckipedia rowan: what Mastodon (and my instance) do, is not have a special API and a frontend, but if you GET e.g. the ID of a person with a browser, you get the index page of that user
# cwebber content type negotiation!
# cwebber puckipedia: but the .json is effectively "sugar", right?
# puckipedia yep
# cwebber in that, it's not really used api-wise
# puckipedia it just overrides the "Accept:"
# cwebber just for developer convenience
# rowan right, yeah
# rowan that should make a difference in dev, though, right?
# cwebber rowan: should help you look things up more quickly
# rowan like, as long as i keep paths straight and have IDs correspond to the api
# cwebber without having to go to your language's repl or etc
# cwebber yes the bad thing would be if you accidentally started using the .json in the api without those being the actual links from the user's profile
# cwebber or assuming all implementations did it
# cwebber just keep it as a developer-convenience thing
# puckipedia rowan: my suggestion is to basically redirect to the frontend if you don't have "Accept: application/ld+json;profile="https://www.w3.org/ns/activitystreams", application/activity+json" or something
# cwebber AP is "follow your nose"
# cwebber ie you should be able to get all the uris you need just by traversing links in objects
# rowan right. i *think* that’s what i’ve been doing, and if i haven’t somewhere then i’ll def fix it
# cwebber +1
# cwebber cool to see you making so much progress rowan !
# rowan oh gosh thanks. it feels like i’m against a wall no matter how much i get done, but the wall is shifting? the federation bit was always going to be the hardest thing so it’s okay that it’s taking a while
# puckipedia rowan: you can try hitting against https://kroeg.azurewebsites.net/puckipedia if you want (actually I think it's open registration, that should probably be disabled lol)
# cwebber rowan: if the wall is shifting that's called "progress"! :D
# rowan ‘hitting against’?
# rowan (puckipedia)
# cwebber rowan: I think puckipedia means that's a user on their AP server, so you can try federating to their user
# puckipedia yup
# rowan that was my guess. i’m not at the point of finding users on other servers, though, just trying to find my user/server from other ones
# rowan *’publicKeyPem’: ‘a bunch of shit’}
# cwebber ’publicKeyPem’: ‘a bunch of shit’
# cwebber that's how I feel about PEM encoded keys yes :)
# cwebber but yeah
# cwebber I think so assuming the ellipsis stands for your site
# rowan yeah it does, i just wanted to shorten :)
# rowan so
# rowan i’m doing something else wrong here, bc masto still isn’t finding the information from my user profile
# rowan it gets the webfinger address (bc it gets the 'properties':
{'http://schema.org/name': u['name']}
) but doesn’t follow through to pull down the feed# cwebber wait
# cwebber schema.org?
# puckipedia isn't that in webfinger
# cwebber oh is it
# puckipedia rowan: ehm, webfinger 500's here
# rowan i def copied it from some other webfinger request
# rowan hmmmm
# rowan okay i broke something
# puckipedia yep :D
# rowan (that being said, masto is still displaying the profile with the name from webfinger, so there must be some caching going on OR it’s getting it from some other mysterious place)
# puckipedia it's caching a ton of stuff
# rowan i was afraid of that. is there a good way of checking federation without running into that?
# puckipedia run your own Mastodon instance? :P
# rowan but that’s what i was trying to avoiddddddd
# puckipedia haha
# puckipedia issue is that a bunch of stuff in Mastodon is cached
# puckipedia notices a conflict of prefix
# puckipedia I did a bunch of testing against mastodon.social first but then I realised to much stuff is cached (so I kept making more users and eventually hit really obscure bugs that required me to run Mastodon local)
# rowan oh
# rowan new users
# rowan that’s a horribly good idea
# puckipedia issue: everyone else on the instance can find your broken user by searching @roo
# trackbot Created ISSUE-47 - Everyone else on the instance can find your broken user by searching @roo. Please complete additional details at <http://www.w3.org/Social/track/issues/47/edit>.
# puckipedia TRACKBOT NO
# trackbot Sorry, puckipedia, I don't understand 'TRACKBOT NO'. Please refer to <http://www.w3.org/2005/06/tracker/irc> for help.
# puckipedia BAD BOT
# rowan hahaha
# rowan i mean that’s not that big a deal, i can just delete it and re-make it when i actually put the instance live
# puckipedia but it's cached in Mastodon, is what I mean
# rowan wait forever
cdchapman joined the channel
# cwebber puckipedia: rowan: it's a good thing that cache invalidation is one of the easiest problems in computer science, right?
# rowan lol
# rowan puckipedia: okay i have the webfinger situation up again
# cwebber also that trackbot exchange above is hilarious
# puckipedia rowan: so officially, if you want to use "manuallyApprovesFollowers" you have to define it in the context
# puckipedia like what Mastodon does with "@context": ["https://[...]/ns/activitystreams",
{"manuallyApprovesFollowers": "as:manuallyApprovesFollowers"}
] iirc# rowan i do that in the user context
# rowan but
# rowan don’t return it #whoops
# cwebber rowan: in the future this might not be necessary because this is a being-incubated extension
# cwebber but since the extension is not yet in the as2 context it's necessary for json-ld to actually know what term it maps to
# cwebber rowan: if you'd like to test expanding your json-ld documents you can use the pyld library
# cwebber rowan: in order to get a better sense of how json-ld works, I recommend the json-ld playground:
# cwebber https://json-ld.org/playground/
# cwebber wow! there's now "Signed with RSA" and "Signed with Bitcoin" tabs on there, lolawesome
# rowan okay. so current status is: mastodon searches for rowan@[etc], i return a json with appropriate subject and rel:self. masto does not show any results and does not make a GET request to the rel:self link, presumably it’s not happy with something about the json i’m returning from the webfinger request?
# puckipedia hm
# puckipedia this is what I'm sending https://kroeg.azurewebsites.net/.well-known/webfinger?resource=acct:puckipedia@kroeg.azurewebsites.net
# puckipedia rowan: ah, so "subject" in webfinger should be the acct:[...] form
# rowan god damn it yeah
# puckipedia I think that's all you need lol
# rowan it was that and then i changed what the id in my database was and forgot to fix it
# rowan AHHH AMAZING
# rowan puckipedia: thank you so much for helping me with all of this debugging, i think that this solved my issues
# rowan (thank you cwebber also!! but i didn’t just meet you haha)
# puckipedia rowan: \o/
# cwebber rowan: :)
# rowan (other issues now, like ‘how to update things’ but that’s a getting-around-caching issue that i’m not gonna deal with today
# rowan )
JanKusanagi and timbl joined the channel