Follow

So I managed to add to a static website I just put together. I will be modifying it so I use the same code on my personal blog too.

Basically it supports followers, and when a new page is added (like a news entry, or a new project) then if your following the website it will show as a status in your feed.

Even cooler, if you comment or like the status from here you will see that comment and status on the website. Yes I can block people if they abuse this, as well as servers.

Check it out by following @flear which represents flear.org

Its a very early beta, so the look of the site will still be heavily modified and I will add some more support soon. But this covers all the basics needs.

@flear @trinsec

Since you are running your own server you may be interested in this, I just wrote a whole AP server that works for static sites!

@healthiswealth

You have to comment on the post itself, this is just a quote toot of the post so comments here wont show up.. go over to the took I link, do it there.

@flear

@freemo @flear ha! I was so eager to test it I just replied! Have tested it now, works a treat! :)

@healthiswealth

I dont see it. I am guessing you deleted it? Either way glad it worked for you... ill be working on it for a few more days to make it look pretty and add in some more features maybe

@flear

@freemo @flear ah its on the Sending Notes Added page. If deleting is an option, I will later, keep you page nice and tidy and not fill it with my random comments :)

@healthiswealth

Ahh ok... right now deleting isnt added but ill be adding that shortly.. feel free to clutter though I can always delete by hand for now.

@flear

@freemo @smallcircles @flear This is a very cool use of AP, good stuff on the innovative thinking 🤘

@Brendanjones

Thanks all the bits and pieces were out there as a few people made failed attempts before.. I just came in and collected it in one place, fixed the bugs, and added some new stuff... standing on the shoulders of giants and all :) I just happened to be the one who crossed the finish line :) Some of the people I took code from were pretty close though (ill add them to the contributors file int he next days so everyone gets credit once I look up everyone again).

@smallcircles @flear

@freemo

How do third parties manage to change content in a static site? If the site is immutable, what and where is the mutated data?

Sounds very neat so 👏
@flear

Laris: But your not sleeping, bad dreams?

Picard: The dreams are lovely. Its the waking up I am begging to resent.

-- Picard, 1:1

@happyborg

Static sites actually have come a long way, to the point that the term is still super confusing.

Yes the code itself is static html. and the code itself doesnt change between deploys. To answer your question it uses javascript (originally written as typescript). Some of it even runs remotely on the server, though its called "serverless functions" since the lambdas run without any OS or system info.

So the javascript basically can modify the code on the fly (the local js) and act as endpoints for things like follows using serverless functions but still running "in the cloud" (you see those int he api folder).

Next you might be wondering where the data is stored... It uses a firebase DB, so basically the DB is also in the cloud and is accessed with javascript as well... So the dynamic parts are rendered dynamically using static code written in javascript :)

@flear

@freemo thanks, that's neat.

With respect I think using the term serverless when there is a server because Google (I think) coined the term is misleading IMO though I know many go along with it.

My interest is in p2p, so building static sites where code runs in the client & data mutated without a server, and stored across the p2p network. There are though people who insist that p2p nodes be called servers! 🤷‍♂️

I think a useful distinction is whether site specific code runs outside the client.

@happyborg "serverless function" is the correct and adopted technical term. As far as I know it wasnt coined by google, but if it was, i dont see that really making a difference. It is the established standard term for such a thing.

You can run it in a server configuration if you want, go for it. Some of us dont want that level of complexity, especially not for a static site that has no need for it.

> I think a useful distinction is whether site specific code runs outside the client.

For ActivityPub it must, it is designed to. There are solutions if you want it totally in the client though, go for that if you want it.. I intend to add Nostr support on top of AP so my site does both and so people can follow it using the standard of their choice.

@freemo

> For ActivityPub it must, it is designed to. There are solutions if you want it totally in the client though, go for that if you want it

That seems contradictory or do you mean non-AP solutions?

Regardless, I'm curious if AP can be implemented using libp2p services. I'm not impressed with Nostr in several respects. I'm a big fan of Safe Network though and hope to see it link to synergistic projects.

I built a PoC for SN to integrate with Solid and another, a GitHub in the browser.

@happyborg

I mean that AP requires a server with a static address and available port, and must run 24/7 to be effective (otherwise I cant follow people will get errors).

Since the vast majority of personal computers are behind a nat with a dynamic IP you can not host AP based instances off your local machine unless you pay for commercial features (static public ip)

@freemo @happyborg

My vpn has a port forwarding feature, but it can't forward the default web server ports, 80 or 8080.
@freemo @happyborg

I probably could run my own instance using only my laptop and vpn (and some free domain) via adding custom port to URLs, e.g. "inbox": "https://my-shitty-domain.com:58962/inbox", if i understand everything correctly.

But no sane person will host an instance using their laptop 😀

@lonelyowl

The port is only half the battle, you still need a static public ip address if you wanted to have a reliable server. But yea if you really want to hack it there are ways.

@happyborg

@freemo @happyborg

The vpn server's public ip address is always the same, they give the ability to choose exactly one you want every time.

But i'm not sure if https will work with whatever port except 443 :thinking:

@freemo I'm not sure but maybe #libp2p will solve that.

I'm hopeful it will but we're waiting for libp2p to complete #AutoNatv2 which is in progress, and then for someone who understands both #ActivityPub and libp2p services to take a look and see if it is feasible. It is beyond me so I can remain hopeful 😉

It isn't essential but would be a very nice to have.

@happyborg @freemo I've recently done a p2p project with webrtc. Mostly works over NAT. Phones using mobile data definitely work. You do need a TURN server as backup but for social media the bandwidth would be reasonable. You can use public STUN servers.

@mike805 I expect libp2p to handle all this with AutoNATv2 over QUIC which will make life a lot easier in this area.

@freemo

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.