Allow to disable webmentions via config

This commit is contained in:
Thomas Sileo 2019-09-08 12:13:18 +02:00
parent 018b7bf553
commit a0a756d320
3 changed files with 10 additions and 3 deletions

View file

@ -36,11 +36,12 @@
- with dark and light version
- IndieWeb citizen
- Microformats aware (exports `h-feed`, `h-entry`, `h-cards`, ...)
- Exports RSS/Atom/[JSON](https://jsonfeed.org/) feeds
- You stream/timeline is also available in an (authenticated) JSON feed
- Implements [IndieAuth](https://indieauth.spec.indieweb.org/) endpoints (authorization and token endpoint)
- U2F support
- You can use your ActivityPub identity to login to other websites/app
- Send [Webmentions](https://www.w3.org/TR/webmention/) (only for public notes)
- Exports RSS/Atom/[JSON](https://jsonfeed.org/) feeds
- You stream/timeline is also available in an (authenticated) JSON feed
- Comes with a tiny HTTP API to help posting new content and and read your inbox/notifications
- Deployable with Docker (Docker compose for everything: dev, test and deployment)
- Focused on testing

View file

@ -173,6 +173,8 @@ if conf.get("emoji_tpl"):
# Hosts blacklist
BLACKLIST = conf.get("blacklist", [])
DISABLE_WEBMENTIONS = conf.get("disable_webmentions", False)
# By default, we keep 14 of inbox data ; outbox is kept forever (along with bookmarked stuff, outbox replies, liked...)
DAYS_TO_KEEP = 14

View file

@ -9,6 +9,7 @@ from little_boxes import activitypub as ap
from poussetaches import PousseTaches
from config import MEDIA_CACHE
from config import DISABLE_WEBMENTIONS
from utils import parse_datetime
p = PousseTaches(
@ -43,6 +44,9 @@ class Tasks:
@staticmethod
def send_webmentions(activity: ap.Create, links: Set[str]) -> None:
if DISABLE_WEBMENTIONS:
return None
for link in links:
p.push(
{