Add readme

This commit is contained in:
s3lph 2022-11-18 00:59:53 +01:00
parent e2db45168e
commit 367c3e9292
Signed by: s3lph
GPG key ID: 8AC98A811E5BEFF5
2 changed files with 84 additions and 0 deletions

16
LICENSE Normal file
View file

@ -0,0 +1,16 @@
Copyright 2022 s3lph
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

68
README.md Normal file
View file

@ -0,0 +1,68 @@
# ActivityPub Pelican Plugin
Warning: This is an experimental plugin, which most likely does not do
what you'd expect it to do. Please read
https://s3lph.me/activitypub-static-site.html for details.
## Configuration
Add the following to your pelicanconf.py:
```python
# Enable the plugin
PLUGINS = ['activitypub']
# Configure the author's profiles:
ACTIVITYPUB_AUTHORS = {
# This user will be known as @alice@{{ SITEURL }} in the Fediverse
'alice': {
'name': 'Alice',
'movedTo': 'https://fedi.example/users/alice',
'alsoKnownAs': ['https://fedi.example/users/alice'],
'summary': 'Hi, I\'m Alice! Please follow me at @alice@fedi.example.',
'attachment': [
{
'type': 'PropertyValue',
'name': 'Mastodon',
'value': '<a href="https://fedi.example/@alice">@alice@fedi.example</a>'
}
],
'icon': {
'type': 'Image',
'mediaType': 'image/png',
'url': SITEURL + 'authors/alice.png'
}
}
}
```
Apart from the ActivityPub resources, this plugin will also generate the following resources:
- `.well-known/host-meta`
- `.well-known/nodeinfo`
- `.well-known/webfinger`
If your Pelican site has multiple autors, you need to redirect `/.well-known/webfinger?resource=acct:alice@example.org` to `/.well-known/_webfinger/alice`. This can e.g. be achieved with Apache `.htaccess`:
```
RewriteEngine on
RewriteRule ^/.well-known/webfinger?resource=acct:([^@]+)@example.org$ /.well-known/_webfinger/$1 [L]
```
Apart from that, the following Content-Types have to be overwritten (again in Apache config):
```
<Location /activitypub>
Header set Content-Type "application/activity+json; charset=utf-8"
</Location>
<Location /.well-known/host-meta>
Header set Content-Type "application/xrd+xml; charset=utf-8"
</Location>
<Location /.well-known/webfinger>
Header set Content-Type "application/json; charset=utf-8"
</Location>
<Location /.well-known/nodeinfo>
Header set Content-Type "application/json; charset=utf-8"
</Location>
```