Because ActivityPub is quite generic, the goal here is not to implement every aspect of ActivityPub but just a coherent subset that can be used for understanding the protocol as well as for testing. Thus the use case is microblogging: users can only publish or like notes and follow each others.
Then add two new virtual hosts for alice.local and bob.local.
Here is an example nginx configuration file to achieve that:
server {
listen 80;
index index.html index.htm;
server_name alice.local;
server_name_in_redirect off;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header X-Forwarded-Host $host;
}
}
Copy the file and change `alice.local` to `bob.local` and the port to `8001`.
You'll also need two different Django configuration files. So copy `activitypub/settings.py` to `activitypub/settings-bob.py` and change the following values:
$ cat activitypub/settings-bob.py
...
ACTIVITYPUB_DOMAIN = "alice.local" # or bob.local
...
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'alice.sqlite3'), # or bob.sqlite3
}
}
Now you can run the migrations for alice (default) and bob:
If all works correctly they should be able to reach each others. To verify that, we need to first create users. The simplest way is to do it via the python shell:
$ ./manage.py shell
...
>>> from activitypub.models import Person
>>> alice = Person(username="alice", name="Alice in Wonderland")
>>> alice.save()
Alice's actor representation should be available at http://alice.local/@alice.