I bought into the ecosystem while taking my networking cert classes back in 2017. They were much cheaper than Cisco gear for business-grade networking, and overall I've been happy with them. ...
• Change: Add Kitten’s own routes (that every Kitten app inherits) for the Small Web protocol namespace (/💕) as well as for Kitten’s reserved namespace (/🐱) first, before app-specific routes so that a wildcard route in the form, e.g., [anything]_[anythingElse].get.js won’t lock you out of the Settings site for your app (at /🐱/settings).
(To update, run kitten update from your terminal on your development machine or manually update deployment servers from /🐱/settings/kitten/ or just wait a few hours for them to update automatically. You can also just run the installation command again.)
• Fixes issue with routes where dynamic routes with file names that had more than two extensions were not recognised as the correct type of route. e.g., A route called index.xml.get.js would previously have been treated as a static route instead of a dynamic GET route.
So. My mother is worried if she is using the internet at the same time as my dad is downloading an iPad update it could somehow “mess up” his iOS update. (They have 300/20Mbps cable and a modern router.)
I told her that due to TCP/IP it makes sure everything is delivered correctly, and there’s also checks on the iOS side. Only possible impact is a small slowdown.
She’s asked me this multiple times.
Can anyone on here let me know if I’m correct, or not?
@dragonarchitect
@DeltaWye this also is the advantage of #TCPIP: Only the #endpoints need to be able to rech each ither: All the complicated #Routing is transparent and thus changing routes don't result in lost connections.
Any computer program can be designed to run from a single file if you architect it wrong enough!
I wanted to create the simplest possible Fediverse server which can be used as an educational tool to show how ActivityPub / Mastodon works.
The design goals were:
Upload a single PHP file to the server.
No databases or separate config files.
Single Actor (i.e. not multi-user).
Allow the Actor to be followed.
Post plain-text messages to followers.
Be roughly standards compliant.
And those goals have all been met! Check it out on GitLab. I warn you though, it is the nadir of bad coding. There are no tests, bugger-all security, scalability isn't considered, and it is a mess. But it works.
Firstly, I've slightly cheated on my "single file" stipulation. There's an .htaccess file which turns example.com/whatever into example.com/index.php?path=whatever
The index.php file then takes that path and does stuff. It also contains all the configuration variables which is very bad practice.
Rather than using a database, it saves files to disk.
Again, this is not suitable for any real world use. This is an educational tool to help explain the basics of posting messages to the Fediverse. It requires absolutely no dependencies. You do not need to spin up a dockerised hypervisor to manage your node bundles and re-compile everything to WASM. Just FTP the file up to prod and you're done.
This is where you set up your account's name and bio. You also need to provide a public/private keypair. The posting page is protected with a password that also needs to be set here.
<span class="tempest-highlight-language"><img alt="" class="tempest-highlight-language-icon" height="32" src="https://shkspr.mobi/blog/wp-content/plugins/tempest-highlight//svg/php.svg" width="32"></img><span itemprop="programmingLanguage"> PHP</span></span>```
<span style="color: #008000;" translate="yes">// Set up the Actor's information</span> <span style="color: #001080;">$username</span> = <span style="color: #795E26;">rawurlencode</span>(<span style="color: #a31515;">"example"</span>); <span style="color: #008000;" translate="yes">// Encoded as it is often used as part of a URl</span> <span style="color: #001080;">$realName</span> = <span style="color: #a31515;">"E. Xample. Jr."</span>; <span style="color: #001080;">$summary</span> = <span style="color: #a31515;">"Some text about the user."</span>; <span style="color: #001080;">$server</span> = <span style="color: #001080;">$_SERVER</span>[<span style="color: #a31515;">"SERVER_NAME"</span>]; <span style="color: #008000;" translate="yes">// Domain name this is hosted on</span> <span style="color: #008000;" translate="yes">// Generate locally or from https://cryptotools.net/rsagen</span> <span style="color: #008000;" translate="yes">// Newlines must be replaced with "n"</span> <span style="color: #001080;">$key_private</span> = <span style="color: #a31515;">"-----BEGIN RSA PRIVATE KEY-----n...n-----END RSA PRIVATE KEY-----"</span>; <span style="color: #001080;">$key_public</span> = <span style="color: #a31515;">"-----BEGIN PUBLIC KEY-----n...n-----END PUBLIC KEY-----"</span>; <span style="color: #008000;" translate="yes">// Password for sending messages</span> <span style="color: #001080;">$password</span> = <span style="color: #a31515;">"P4ssW0rd"</span>;
### [Logging](#logging)
ActivityPub is a "chatty" protocol. This takes all the requests your server receives and saves them in `/logs/` as a datestamped text file.
### [WebFinger](#webfinger)
The [WebFinger Protocol](https://docs.joinmastodon.org/spec/webfinger/) is used to identify accounts.It is requested with `example.com/.well-known/webfinger?resource=acct:[email protected]`This server only has one user, so it ignores the query string and always returns the same details.
### [Following & Followers](#following-followers)
These JSON documents show how many users are following / followers-of this account.The information here is self-attested. So you can lie and use any number you want.
The /inbox is the main server. It receives all requests. This server only responds to "Follow" requests.A remote server sends a follow request which is a JSON file saying who they are.This code does not cryptographically validate the headers of the received message.The name of the remote user's server is saved to a file so that future messages can be delivered to it.An accept request is cryptographically signed and POST'd back to the remote server.
### [UUID](#uuid)
Every message sent should have a unique ID. This can be anything you like. Some servers use a random number.I prefer a date-sortable string.
Every message that your server sends needs to be cryptographically signed with your Private Key.This is a complicated process. Please read "How to make friends and verify requests" for more information.
### [User Interface for Writing](#user-interface-for-writing)
This creates a basic HTML form. Type in your message and your password. It then POSTs the data to the `/send` endpoint.
This takes the submitted message and checks the password is correct.It reads the followers.json file and sends the message to every server that is following this account.
[Next Steps](#next-steps)
-------------------------
This is *not* intended to be used in production. **Ever**. But if you would like to contribute more simple examples of how the protocol works, please [come and play on GitLab](https://gitlab.com/edent/activitypub-single-php-file/).
You can follow the test user `@[email protected]`
#activitypub #mastodon #php
What's your opinion on Ubiquiti/Unifi gear?
I bought into the ecosystem while taking my networking cert classes back in 2017. They were much cheaper than Cisco gear for business-grade networking, and overall I've been happy with them. ...