diff --git a/activities/models/post.py b/activities/models/post.py index 342e4b5..6cc93fa 100644 --- a/activities/models/post.py +++ b/activities/models/post.py @@ -94,6 +94,9 @@ class PostStates(StateGraph): """ For remote posts, sees if we can delete them every so often. """ + # Skip all of this if the horizon is zero + if settings.SETUP.REMOTE_PRUNE_HORIZON <= 0: + return # To be a candidate for deletion, a post must be remote and old enough if instance.local: return diff --git a/docs/releases/0.10.rst b/docs/releases/0.10.rst index 8ce4377..646dce3 100644 --- a/docs/releases/0.10.rst +++ b/docs/releases/0.10.rst @@ -13,7 +13,11 @@ This release's major changes: most situations (the context switching was costing more than the gains from talking to other servers asynchronously). -* TBC +* Old remote posts are now automatically pruned out of the database after a + configurable horizon time, defaulting to 90 days. Posts from local users and + posts that have been interacted with (liked, boosted, pinned) by local users + are never deleted. You can change the deletion horizon with the + ``TAKAHE_REMOTE_PRUNE_HORIZON`` setting. Minor changes also include: @@ -33,17 +37,16 @@ or use the image name ``jointakahe/takahe:0.10``. Upgrade Notes ------------- -VAPID keys and Push notifications -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Remote Pruning +~~~~~~~~~~~~~~ -Takahē now supports push notifications if you supply a valid VAPID keypair as -the ``TAKAHE_VAPID_PUBLIC_KEY`` and ``TAKAHE_VAPID_PRIVATE_KEY`` environment -variables. You can generate a keypair via `https://web-push-codelab.glitch.me/`_. - -Note that users of apps may need to sign out and in again to their accounts for -the app to notice that it can now do push notifications. Some apps, like Elk, -may cache the fact your server didn't support it for a while. +Post pruning is now in and comes *enabled by default*, as it is not directly +destructive (it will only delete content that has not been interacted with +locally and which can be re-fetched). +Nevertheless, if you want to avoid post deletion triggering on your server at +all, you should set the ``TAKAHE_REMOTE_PRUNE_HORIZON`` environment variable to +``0``. Migrations ~~~~~~~~~~ diff --git a/docs/releases/0.11.rst b/docs/releases/0.11.rst new file mode 100644 index 0000000..29fe2e5 --- /dev/null +++ b/docs/releases/0.11.rst @@ -0,0 +1,21 @@ +0.11 +==== + +*Released: Not Yet Released* + +Notes TBD. + + +Upgrade Notes +------------- + +VAPID keys and Push notifications +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Takahē now supports push notifications if you supply a valid VAPID keypair as +the ``TAKAHE_VAPID_PUBLIC_KEY`` and ``TAKAHE_VAPID_PRIVATE_KEY`` environment +variables. You can generate a keypair via `https://web-push-codelab.glitch.me/`_. + +Note that users of apps may need to sign out and in again to their accounts for +the app to notice that it can now do push notifications. Some apps, like Elk, +may cache the fact your server didn't support it for a while. diff --git a/docs/tuning.rst b/docs/tuning.rst index 5c59678..772a193 100644 --- a/docs/tuning.rst +++ b/docs/tuning.rst @@ -221,6 +221,17 @@ read-through cache that respects ``Cache-Control``, like Varnish, will also help if placed in front of Takahē. +Remote Content Pruning +---------------------- + +By default, Takahē will prune (delete) any remote posts or identities that +haven't been interacted with after 90 days. You can change this using the +``TAKAHE_REMOTE_PRUNE_HORIZON`` environment variable, which accepts an integer +number of days as its value. + +Setting this environment variable to ``0`` disables this feature entirely. + + Sentry.io integration ---------------------