activitypub-single-php-file/README.md

1.4 KiB

ActivityPub Server in a Single PHP File

This is a single PHP file - and an .htaccess file - which acts as an extremely basic ActivityPub server.

Getting started

This is designed to be a lightweight educational tool to show you the basics of how ActivityPub works.

There are no tests, no checks, no security features, no header verifications, no containers, no gods, no masters.

Edit the index.php file to add a username, password, and keypair.

Upload index.php and .htaccess to the root directory of your domain. For example test.example.com/. It will not work in a subdirectory.

Optionally, upload an icon.png to make the account look nice.

How this works

  • The .htaccess file transforms requests from example.com/whatever to example.com/index.php?path=whatever.
  • The index.php file performs a specific action depending on the path requested.
  • Log files are saved as .txt in the /logs directory.
  • Post files are saved as .json in the /posts directory.

Requirements

  • PHP 8.3 (We live in the future now)
  • The OpenSSL Extension (This is usually installed by default)
  • HTTPS certificate (Let's Encrypt is fine)
  • 50MB free disk space (ActivityPub is a very "chatty" protocol. Expect lots of logs.)
  • Docker, Node, MongoDB, Wayland, GLaDOS, React, LLM, Adobe Creative Cloud, Maven (Absolutely none of these!)