z428, to random German

Deutlich später. Noch einmal den kühlen Boden unter den Füßen spüren. Eine Armlänge nur von Haustür und erleuchtetem Treppenhaus entfernt wirkt die Nacht weniger düster, auch wenn die Augen kaum weiter als bis zum Zaun blicken und der Ort dahinter vollständig mit der mondmatten Finsternis verschmilzt. (Imaginäre Musik. Ein Hund bellt. Die Müdigkeit drückt schwer auf das Bewusstsein.)

village other plains sleep in moments

i_lost_my_bagel, to random
@i_lost_my_bagel@mastodon.lilysthings.org avatar

fucking every fucking

stefan, to internet
@stefan@stefanbohacek.online avatar

This is pretty amazing! People are taking my WordPress plugin that lets you warn site visitors if they don't have an ad-blocking browser plugin installed, and making versions of the project for non-WordPress sites.

https://stefanbohacek.com/project/detect-missing-adblocker-wordpress-plugin/#other-implementations

astrid, to random
@astrid@fedi.astrid.tech avatar

i made a thing https://ooo.eeeee.ooo/

Seirdy,
@Seirdy@pleroma.envs.net avatar

@astrid this made me add a miku sticker to my badges page that links here.

bekopharm, to random
@bekopharm@social.tchncs.de avatar

Nothing warms my heart more than another website picking up the idea "Detect Missing Ad-blocker" of https://stefanbohacek.com/project/detect-missing-adblocker-wordpress-plugin/ (after seeing it on mine in action).

It's made for WordPress but the idea is so dead simple that it can be integrated in almost anything with some work (if nobody else did that work already :D)

stefan,
@stefan@stefanbohacek.online avatar

@macdonst @bekopharm This is great! I added a link to your blog to https://stefanbohacek.com/project/detect-missing-adblocker-wordpress-plugin/#other-implementations.

Thank you for putting this together!

anzo, to selfhosted in Is Radicale the way forward?

That’s not entirely correct. PhotoPrism offers WebDAV and SAMBA protocols, and their docs state that clearly: docs.photoprism.app/user-guide/…/mobile-devices/#… Furthermore, you can always sync files to the server via other means (e.g. SyncThing).

GetMusic, to epic
Ansi, to science
@Ansi@mastodon.cloud avatar
lencioni, to fediverse

I like the idea of syndicating the content that I share here across the Fediverse, so the recent announcement of an official WordPress ActivityPub plugin was one of the main reasons I decided to use WordPress when setting up my blog.

Though the plugin still has some rough edges and missing features, overall I think it is working pretty well for what I wanted. When I post on joelencioni.com, I can see my post in my Mastodon feed pretty quickly—though sometimes the formatting isn’t the best but I suppose that’s just the way it is. And, commenting is bi-directional: replies from Mastodon show up as comments on my blog, and replies to those comments from my blog show up as replies on Mastodon. Great!

The ActivityPub plugin watches for when the client sends a request HTTP header that is asking for content with the mime type of “application/activity+json”. If that type of content is requested, then instead of responding with the web page, it will respond with some JSON data meant for machine consumption instead of human consumption. This is how the syndication works, and that all seems fine.

However, I have been bumping into an issue due to the way this all works together with the CDN I chose for page caching, CloudFlare.

https://joelencioni.com/wp-content/uploads/2024/02/Screenshot_20240218-102959-edited.pngThis is what one of my blog posts looks like when the ActivityPub JSON is served instead of the web page. This is what one of my blog posts looks like when the ActivityPub JSON is served instead of the web page.

This is what one of my blog posts looks like when the ActivityPub JSON is served instead of the web page.

The problem is that CloudFlare will cache the first version of the page that is requested and serve that up to everyone going forward, regardless of the type of content being requested.

Normally, this is solved by setting a different HTTP header “Vary: accept” that tells caches that the server will vary its response based on the accept HTTP header. And the ActivityPub plugin recently added a way to easily have this vary header added to the responses.

I enabled this setting last week and thought I was good to go.

Unfortunately, it turns out that CloudFlare does not consider vary values in caching decisions, so this problem was still happening and sometimes breaking my website for some people.

Thankfully, I found a new approach to try. Using CloudFlare workers, I can program the CDN to vary the content based on this header with this bit of code:

export default {  async fetch(req) {    const acceptHeader = req.headers.get('accept');    const url = new URL(req.url);    if (acceptHeader?.indexOf("application/activity+json") > -1) {      url.searchParams.append("activitypub", "true");    }    return fetch(url.toString(), {      cf: {        // Always cache this fetch regardless of content type        // for a max of 5 minutes before revalidating the resource        cacheTtl: 300,        cacheEverything: true,      },    });  }}

This tells CloudFlare to look at the accept header, and if it has “application/activity+json”, it will add “activitypub=true” to the request query string (the part of the URL after the question mark) behind the scenes, which effectively makes it a different URL. This allows the different content to be cached and served up differently, which I think should solve the issue for me for good. If you still see this problem, please let me know!

Thanks to Dustin Rue for sharing this solution!

https://joelencioni.com/journal/making-wordpress-activitypub-play-nice-with-cloudflare-caching/

brianokken, to random
@brianokken@fosstodon.org avatar

“Time travel into the future to install not-yet-released packages is not supported (yet).” 😢 https://mastodon.social/@jonafato/111931830833317369

pradyunsg,
@pradyunsg@mastodon.social avatar
blog, (edited ) to fediverse
@blog@shkspr.mobi avatar

A (tiny, incomplete, single user, write-only) ActivityPub server in PHP
https://shkspr.mobi/blog/2024/02/a-tiny-incomplete-single-user-write-only-activitypub-server-in-php/

I've written an ActivityPub server which . That's all it does. It won't record favourites or reposts. There's no support for following other accounts or receiving replies. It cannot delete or update posts nor can it verify signatures. It doesn't have a database or any storage beyond flat files.

But it will happily send messages and allow itself to be followed.

This shows that it is totally possible to broadcast fully-featured ActivityPub messages to the Fediverse with minimal coding skills and modest resources.

Why

I wanted to create a service a bit like FourSquare. For this, I needed an ActivityPub server which allows posting geotagged locations to the Fediverse.

I didn't want to install a fully-featured server with lots of complex parts. So I (foolishly) decided to write my own. I had a lot of trouble with HTTP Signatures. Because they are cursed and I cannot read documentation. But mostly the cursed thing.

How

Creating a minimum viable Mastodon instance can be done with half a dozen static files. That gets you an account that people can see. They can't follow it or receive any posts though.

I wanted to use PHP to build an interactive server. PHP is supported everywhere and is simple to deploy. Luckily, Robb Knight has written an excellent tutorial, so I ripped off his code and rewrote it for Symfony.

The structure is relatively straightforward.

  • /.well-known/webfinger is a static file which gives information about where to find details of the account.
  • /[username] is a static file which has the user's metadata, public key, and links to avatar images.
  • /following and /followers are also static files which say how many users are being followed / are following.
  • /posts/[GUID] a directory with JSON files saved to disk - each ones contains the published ActivityPub note.
  • /photos/ is a directory with any uploaded media in it.
  • /outbox is a list of all the posts which have been published.
  • /inbox is an external API endpoint. An ActivityPub server sends it a follow request, the endpoint then POSTs a cryptographically signed Accept message to the follower's inbox. The follower's inbox address is saved to disk.
  • /logs is a listing of all the messages received by the inbox.
  • /new is a password protected page which lets you write a message. This is then sent to...
  • /send is an internal API endpoint. It constructs an ActivityPub note, with attached location metadata, and POSTs it to each follower's inbox with a cryptographic signature.

That's it.

The front-end grabs my phone's geolocation and shows the 25 nearest places within 100 metres. One click and the page posts to the /send endpoint which then publishes a message saying I'm checked in. It is also possible to attach to the post a short message and a single photo with alt text.

There's no database. Posts are saved as JSON documents. Images are uploaded to a directory. It is single-user, so there is no account management.

What Works

  • Users can find the account.
  • Users can follow the account and receive updates.
  • Posts contain geotag metadata.
  • Posts contain a description of the place.
  • Posts contain an OSM link to the place.
  • Posts contain a custom message.
  • Posts autolink #Hashtags (sort of).
  • Posts can have an image attached to them.
  • Messages to the inbox are recorded (but not yet integrated).

ToDo

  • My account only has a few dozen followers, some of whom share the same sever. Even with cURL multi handle, it takes time to post to several servers.
  • It posts plain text. It doesn't autolink websites
  • Hashtags are linked when viewed remotely, but they don't go anywhere locally.
  • There's no language selection - it is hard-coded to English.
  • The outbox isn't paginated.
  • The UI looks crap - but it is only me using it.
  • There's only a basic front-page showing a map of all my check-ins.
  • Replies are logged, but there's no easy way to see them.
  • Doesn't show any metadata about the place being checked-in to. It could use the item's website (if any) or hashtags for the type of amenity it is.
  • No way to handle being unfollowed.
  • No way to remove servers which have died.
  • Probably lots more.

Other Resources

I found these resources helpful while creating this project:

What's Next?

I've raised an issue on Mastodon to see if they can support showing locations in posts. Hopefully, one day, they'll allow adding locations and then I can shut this down.

The code needs tidying up - it is very much a scratch-my-own-itch development. Probably riddled with bugs and security holes.

World domination?

Where

You can laugh at my code on GitHub.

You can look at my check-ins on a map.

You can follow my location on the Fediverse at @edent_location@location.edent.tel

https://shkspr.mobi/blog/2024/02/a-tiny-incomplete-single-user-write-only-activitypub-server-in-php/

#ActivityPub #fediverse #mastodon #php #Symfony

zughy, to random Italian
@zughy@livellosegreto.it avatar
unRob, to mastodon

DAY 10/365 🗓

I've been posting on Mastodon for 10 days already and I like it a lot, more and more people are participating and responding to me.
Very surprised in a good way by the application and the community !

myhauger, to memes
@myhauger@mastodon.social avatar
myhauger, to Writers
@myhauger@mastodon.social avatar
myhauger,
@myhauger@mastodon.social avatar
z428, to random

9pm and on. Bach, Vivaldi, Händel: Echoes from another age, or: There's always something to be found in music. Also, watching the flickering of lights in a different city. Unfamiliar street patterns. Traffic of a late day. Fireworks of the impatient ones. Business as usual.

#outerworld #in between years #other cities

Ansi, to science
@Ansi@mastodon.cloud avatar
soc_i_ety, to random

More and more, young people buy less and less into nationalism and instead value humanity.

The old filthy rich class is increasingly uncomfortable with their ability to control the minds of the young, so now seek to disenfrancise them.

Vote like there's no tomorrow, or there won't be.

:mastodon:

_9CL7T9k8cjnD_,

@soc_i_ety The commonality of across all countries, all ethnicities, all religions is that they define or versus or and Discuss Laws https://youtu.be/bfF30GaL2sM?feature=shared

image/jpeg

Ansi, to Hololive
@Ansi@mastodon.cloud avatar
joranelias, to python
@joranelias@mastodon.social avatar

Is it normal or common style to do ‘foo = bar’ with spaces for assignment but ‘foo=bar’ with no spaces for function arguments?

hugovk,
@hugovk@mastodon.social avatar

@diazona @joranelias
It's in PEP 8:

Always surround these binary operators with a single space on either side, assignment (=)...

Don’t use spaces around the = sign when used to indicate a keyword argument, or when used to indicate a default value for an unannotated function parameter...

When combining an argument annotation with a default value, however, do use spaces around the = sign...

https://peps.python.org/pep-0008/#other-recommendations

PEP 8 is for the stdlib, you can ignore for your code.

toplesstopics, to random
@toplesstopics@eldritch.cafe avatar

just unfollowed someone because they , lmao. PLEASE STOP, OH MY GOD IS THAT ANNOYING. It's more obnoxious than old American comics that BOLD three words a sentence (which bothers me so much I struggle to even read the comment). Treat hashtags like you're shouting them into a crowded audience... do you really need TO shout random WORDS that ARE extremely COMMON and don't MAKE any kind of POINT?

hugovk, to random
@hugovk@mastodon.social avatar

Oh! It's not every day you get a shoutout from the !

"Some contributors have been of particular value, either because of the volume of their contributions or because they have consistently supplied quotations of particular significance; in this capacity we would like to thank: Chris Collier, Paul Cullen, Bill Mullins, Bryn Parry, Sir Edward Playfair, Barry Popik, Michael Quinion, David Shulman, Stuart Silverstein, Hugo van Kemenade, Peter Wexler, and Ben Zimmer."

https://www.oed.com/information/about-the-oed/oed-staff/#Other-advisers-and-contributors

MuSociety, to ableton German
@MuSociety@musicians.today avatar
matt, to random
@matt@isfeeling.social avatar
ChrisLawley,
@ChrisLawley@mastodon.social avatar

@matt , so are the for to them every word. that be biggest .

(No, I’m not petty or annoyed. Why do you ask?)

technotramp, (edited ) to random Czech

deleted_by_author

  • Loading...
  • technotramp,

    @Catweazle

    I . On the , a printed offers the to conveniently or . That's the of a QR code for me. No will naturally offer such an .

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • InstantRegret
  • mdbf
  • ngwrru68w68
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • osvaldo12
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • JUstTest
  • tacticalgear
  • ethstaker
  • provamag3
  • cisconetworking
  • tester
  • GTA5RPClips
  • cubers
  • everett
  • modclub
  • megavids
  • normalnudes
  • Leos
  • lostlight
  • All magazines