mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-11-15 03:04:28 +00:00
Allow to disable webmentions via config
This commit is contained in:
parent
018b7bf553
commit
a0a756d320
3 changed files with 10 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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(
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue