activitypub-single-php-file/README.md

29 wiersze
1.3 KiB
Markdown
Czysty Zwykły widok Historia

2024-02-12 21:21:05 +00:00
# ActivityPub Server in a Single PHP File
2024-02-12 21:08:34 +00:00
2024-02-12 21:21:05 +00:00
This is a single PHP file - and an `.htaccess file` - which acts as an extremely basic ActivityPub server.
2024-02-12 21:08:34 +00:00
## Getting started
2024-02-12 21:21:05 +00:00
This is designed to be a lightweight educational tool to show you the basics of how ActivityPub works.
2024-02-12 21:08:34 +00:00
2024-02-12 21:21:05 +00:00
There are no tests, no checks, no security features, no header verifications, no containers, no gods, no masters.
2024-02-12 21:08:34 +00:00
2024-02-16 08:51:52 +00:00
Edit the `index.php` file to add a username, password, and keypair.
2024-02-12 21:08:34 +00:00
2024-02-16 08:51:52 +00:00
Upload `index.php` and `.htaccess` to the *root* directory of your domain. For example `test.example.com/`. It will not work in a subdirectory.
2024-02-12 21:08:34 +00:00
2024-02-12 21:21:05 +00:00
Optionally, upload an `icon.png` as well to make the account look nice.
2024-02-12 21:08:34 +00:00
2024-02-12 21:21:05 +00:00
## How this works
2024-02-12 21:08:34 +00:00
2024-02-12 21:21:05 +00:00
* 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.
2024-02-15 10:25:17 +00:00
* Log files are saved as .txt in the `/logs` directory.
2024-02-12 21:21:05 +00:00
* Post files are saved as .json in the `/posts` directory.
2024-02-16 08:51:52 +00:00
## Requirements
* PHP 8.3 (We live in the future now)
* The [OpenSSL Extension](https://www.php.net/manual/en/book.openssl.php) (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.)