Home

You can't follow me

87 pointsby rogualover 1 year ago

17 comments

disruptiveinkover 1 year ago
So: developer attempts to integrate into a global distributed system without a connection to the Internet and complains he can&#x27;t get it working without extra steps? Obviously there&#x27;s two ways of doing this: you put everything online and then there&#x27;s no extra steps, which the author doesn&#x27;t want to do, or, if you want to do this offline, then extra steps are needed. Back in the day we used &quot;dev environments&quot; with tightly guarded ACLs. These days you can have things like Docker Compose locally or K8S clusters.<p>It feels like the author has their own preconceived notions about how systems ought to be &quot;isolated&quot;[1], regardless of the use case, keeps fighting with their half-baked networking implementation and then denounces everything, ranging from HTTPS[2] to now ActivityPub as &quot;broken&quot;.<p>[1] - <a href="https:&#x2F;&#x2F;so.nwalsh.com&#x2F;2024&#x2F;01&#x2F;06-isolation" rel="nofollow">https:&#x2F;&#x2F;so.nwalsh.com&#x2F;2024&#x2F;01&#x2F;06-isolation</a><p>[2] - <a href="https:&#x2F;&#x2F;so.nwalsh.com&#x2F;2023&#x2F;12&#x2F;31-https" rel="nofollow">https:&#x2F;&#x2F;so.nwalsh.com&#x2F;2023&#x2F;12&#x2F;31-https</a>
评论 #38950395 未加载
评论 #38950360 未加载
评论 #38950452 未加载
评论 #38950215 未加载
评论 #38952082 未加载
jefftkover 1 year ago
Browsers deal with this by considering localhost a &quot;secure context&quot;, and anything that &quot;requires https&quot; actually requires a secure context. [1] You can debug new web features like the Audio Output API that require a secure context [2] with <a href="http:&#x2F;&#x2F;localhost" rel="nofollow">http:&#x2F;&#x2F;localhost</a> urls, and use multiple ports if you need multiple hosts. ActivityPub could do this too.<p>[1] <a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;Security&#x2F;Secure_Contexts" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;Security&#x2F;Secure...</a><p>[2] <a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;Security&#x2F;Secure_Contexts&#x2F;features_restricted_to_secure_contexts" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;Security&#x2F;Secure...</a>
评论 #38952086 未加载
jeroenhdover 1 year ago
There are ready made ActivityPub signature algorithms for all kinds of languages. If you&#x27;re planning on implementing them yourself, you could try finding an existing implementation to get inspiration from in a language that suits you but I don&#x27;t agree that there are only Typescript examples.<p>As for the HTTPS thing: last time I messed with ActivityPub, I solved that problem with a Let&#x27;s Encrypt wildcard certificate that I copy between hosts, but there are ActivityPub servers that will let you run in debug mode and federate over HTTP.<p>I think the problem with implementing ActivityPub is that the protocol looks deceptively simple at first glance, and people seem to expect it to be somewhat like RSS. However, when you actually start implementing it, you realise how many edge cases the protocol needs to deal with (and doesn&#x27;t deal with).<p>The signature is a relatively small hurdle (it&#x27;s an RSA public key encoded in base64, almost every language I know has a library to do the hard parts) but it&#x27;s one of many. ActivityPub isn&#x27;t a protocol you just tack onto your code in an afternoon, especially if you don&#x27;t like using external libraries, even if it looks like it&#x27;s just a bunch of JSON.
评论 #38950597 未加载
评论 #38952079 未加载
saagarjhaover 1 year ago
If you&#x27;re looking for a very simple ActivityPub implementation that lets you post, follow, and be followed, I can point you at snac: <a href="https:&#x2F;&#x2F;codeberg.org&#x2F;grunfink&#x2F;snac2" rel="nofollow">https:&#x2F;&#x2F;codeberg.org&#x2F;grunfink&#x2F;snac2</a>. It&#x27;s 100% C, and not a lot of code at that. It should be easy to follow and debug, and you can double-check your implementation against it pretty easily with some choice breakpoints. And you can stand it up as an individual instance to have it talk to your code if you want to test interoperatability.<p>(I would not really recommend it for general use, unfortunately, since it&#x27;s a pile of C that&#x27;s not really all that secure. But as a publicity stunt we run @ish@ish.app inside of iSH itself, and snac turned out to be excellent for this because iSH is slow and doesn&#x27;t implement all of Linux, so picking something simple and lightweight was a must.)
splitbrainover 1 year ago
It&#x27;s not 100% clear if OP wanted two-communication, eg. display replies as comments. His title seems to imply one-way communication only. That is super simple to implement.<p>Simplest solution is to use something like <a href="https:&#x2F;&#x2F;mastofeed.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mastofeed.org&#x2F;</a> which automatically posts your RSS feed to Mastodon.<p>Of course you can also do it yourself. Posting to an existing mastodon account is just a single HTTP call with an API key: <a href="https:&#x2F;&#x2F;docs.joinmastodon.org&#x2F;methods&#x2F;statuses&#x2F;#create" rel="nofollow">https:&#x2F;&#x2F;docs.joinmastodon.org&#x2F;methods&#x2F;statuses&#x2F;#create</a>
peter_l_downsover 1 year ago
I empathize with the author and found the post to be a interesting and concrete example of what it&#x27;s _actually like_ to try to publish a blog to Mastodon, which is something that I have thought about and read about in abstract. So, thank you for writing this up.<p>One thing to consider would be to try to use Caddy [0], or a tool like localias [1], as a local https proxy. You would be able to run both the mastodon server and your blog software on the same computer, addressable via local-only urls like &quot;<a href="https:&#x2F;&#x2F;blog.test" rel="nofollow">https:&#x2F;&#x2F;blog.test</a>&quot; and &quot;<a href="https:&#x2F;&#x2F;mastodon.test" rel="nofollow">https:&#x2F;&#x2F;mastodon.test</a>&quot; and have everything work. These tools manage the certificates for you transparently and you don&#x27;t need to worry about anything being exposed publicly.<p>I&#x27;d be curious to know why the author didn&#x27;t try this, they seem to be quite knowledgeable of other web technologies so I have to assume there&#x27;s a problem that I&#x27;m not seeing here.<p>[0] <a href="https:&#x2F;&#x2F;caddyserver.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;caddyserver.com&#x2F;</a><p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;peterldowns&#x2F;localias">https:&#x2F;&#x2F;github.com&#x2F;peterldowns&#x2F;localias</a>
jraphover 1 year ago
The author mentions difficulties with HTTPS and trying stuff locally.<p>I&#x27;ve had some success with mkcert [1,2] to easily create certificates trusted by browsers, I can suggest to look into this. You are your own root CA, I think it can work without an internet connection.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;FiloSottile&#x2F;mkcert&#x2F;">https:&#x2F;&#x2F;github.com&#x2F;FiloSottile&#x2F;mkcert&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33383095">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33383095</a>
thro1203123over 1 year ago
There are so many weird suggestions in the comments. I&#x27;m surprised nobody has mentioned ngrok <a href="https:&#x2F;&#x2F;ngrok.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;ngrok.com&#x2F;</a> (there are other competing alternatives as well). It makes exposing local service over HTTPS trivial. It&#x27;s been used heavily in most of my engineering orgs.
cobertosover 1 year ago
I hope I don&#x27;t run into this many issues when I do the same implementation. I&#x27;ve been wanting to add integration with Mastodon to my static blog for a while now, as my refuge from Twitter and platforms in general. I just never use my &quot;normal&quot; Mastodon account so it feels weird to think I&#x27;ll use this blog any more than I do that one...<p>Some of these issues seem avoidable though? The author seems to be diving too far into the testing rabbit hole. For my workflows, I generally find holistic integration tests to be too time consuming and not worth it, for the level of fidelity I want (I&#x27;m not NASA&#x2F;bug-free). Same with trying to avoid testing on prod. It might not be &quot;clean&quot; but for a site like this it seems like a reasonable tradeoff.
评论 #38951432 未加载
colinsaneover 1 year ago
not to dismiss the issue, but if you can procure a certificate (e.g. host nginx+acme on `local.nwalsh.com` to obtain a wildcard for `*.local.nwalsh.com`), then just put `127.0.0.1 mastodon.local.nwalsh.com` in your hosts file and you should be good, right?<p>but yes, non-local runtime dependencies in software which you <i>thought</i> you set up to be local-first have a real habit of sneaking in. the wildcard cert solution only masks that non-local runtime dependency, visible by disconnecting the server from the network for 90 days at which point your cert expires and it&#x27;ll fail again.
louismerlinover 1 year ago
Thank you for your write-up, I ran into similar issues a couple of months back.<p>Another gripe with the technical implementation of mastodon is the CORS headers required to access the ActivityPub API [0].<p>Because of this issue, an activitypub-aware frontend for mastodon has to have its own mastodon server running, which adds a whole bunch of hurdles.<p>[0]:<a href="https:&#x2F;&#x2F;github.com&#x2F;mastodon&#x2F;mastodon&#x2F;issues&#x2F;10400">https:&#x2F;&#x2F;github.com&#x2F;mastodon&#x2F;mastodon&#x2F;issues&#x2F;10400</a>
评论 #38950268 未加载
评论 #38950517 未加载
ranger207over 1 year ago
Lots of people are suggesting self-signed certs or a local CA; why not wildcard certs? I have a homelab with some public stuff, some internal stuff, and for the internal stuff I just have a certbot post-renewal hook that scps the wildcard cert from my public reverse proxy to the services that need it. Yeah, not as easy as not needing certs, but once you have it set up it&#x27;s not too bad
lxeover 1 year ago
&gt; There are examples on the web of the sorts of things that need to be done, but all the ones I could find were in TypeScript. That’s a hurdle I didn’t feel like trying to overcome today.<p>I mean, we can all have opinions about TypeScript, but converting from TS to JS is far from a hurdle.
评论 #38951446 未加载
mariusorover 1 year ago
At this point Mastodon is a certified obstacle in the face of wider ActivityPub adoption due to all the warts and quirks of their implementation that ripple into the wider ecosystem.<p>I wish they would dedicate a modicum of attention of being a better Fediverse citizen now that they have people they employ.
glitchcover 1 year ago
&gt; So to test this, I’d need both ends of the communcation to be on the public internet with proper certificates.<p>Sounds like a feature, not a bug. What am I missing? You could generate self-signed certificates to make life a bit easier.
评论 #38951681 未加载
swiftcoderover 1 year ago
Seems like putting a cloudflare tunnel in front of each of these services would just have solved the problem instantly?
geriksonover 1 year ago
I just run a script that echoes an excerpt of my posts to my fedi account, it works ok.