An open API service indexing awesome lists of open source software.

https://github.com/mwt/apfollow

Public follow service for ActivityPub
https://github.com/mwt/apfollow

activitypub fediverse hacktoberfest mastodon webfinger

Last synced: 6 days ago
JSON representation

Public follow service for ActivityPub

Awesome Lists containing this project

README

        

# AP Follow

## Basic usage

This is a remote follow tool for ActivityPub servers. With this tool, you can share links and buttons that allow people to follow you from their own ActivityPub instance. You can use by passing query parameters like so:

`https://apfollow.mwt.me/?user={username}&instance={domain.tld}`

[Here is a follow page generator](https://apfollow.mwt.me/)

[Here is an example follow page](https://apfollow.mwt.me/?user=mwt&instance=econtwitter.net).

## Advanced usage

The application does not rely on client-side javascript or relative links. So you can reverse proxy the service on your own domain. For example, you could add the following to an Apache `.htaccess` file to allow follows on the same paths used by Mastodon.

```apache

RewriteEngine On
RewriteBase /
RewriteRule ^users/(.*)/remote_follow$ "https://apfollow.mwt.me/?user=$1&instance=yourdomain.com" [P,L]

```
Similarly in Nginx:
```nginx
location ~ ^/users/(.*)/remote_follow$ {
proxy_pass https://apfollow.mwt.me/?user=$1&instance=yourdomain.com;
}
```

This is beneficial because your follow links can be picked up by [the simplified federation browser extension](https://github.com/rugk/mastodon-simplified-federation/). Which will skip users needing to fill in their handle.

## Example follow buttons

Just put your username and instance in the `href` field at the beginning of these links to get a follow button that you can put on your website.

### Gray AP button

![gray-ap-button-image](assets/ap-follow.png)

```html


Follow me

```

### Pink AP button

![pink-ap-button-image](assets/ap-follow2.png)

```html


Follow me

```

### Mastodon button

![mastodon-button-image](assets/mastodon-follow.png)

```html


Follow me

```

## Why do I need this?

The most popular ActivityPub implementations (such as Mastodon and Pleroma) have remote follow implementations. Mastodon provides a remote follow interface at `/users/{username}/remote_follow` on each instance [(an example)](https://mathstodon.xyz/users/mwt/remote_follow). You can share this link to allow people to follow you. However, an actual follow link does not exist in most other implementations. For example, Pleroma uses a POST request to start the flow from the remote follow button. Therefore, it not possible to provide a direct link.

Many other implementations of ActivityPub lack any builtin remote follow support. [The WordPress plugin](https://github.com/pfefferle/wordpress-activitypub) and Pixelfed are examples. Without this feature, the only way for users to follow your content is for them to manually search for your account handle.

Moreover, it is nice when making/using templates to have a standard follow link that can be used for any ActivityPub implementation.

## License and credits

This project is inspired by [this blog post by Hugh Rundle](https://www.hughrundle.net/how-to-implement-remote-following-for-your-activitypub-project/) which documents the procedure for remote follows.

## Requirements

This project depends on `php-curl` and `php-xml` (SimpleXML).