Commit Graph

14996 Commits

Author SHA1 Message Date
ilja 7695010268 Prune Objects --keep-threads option (#350)
ci/woodpecker/push/woodpecker Pipeline is pending Details
This adds an option to the prune_objects mix task.
The original way deleted all non-local public posts older than a certain time frame.
Here we add a different query which you can call using the option --keep-threads.

We query from the activities table all context id's where
    1. the newest activity with this context is still old
    2. none of the activities with this context is is local
    3. none of the activities with this context is bookmarked
and delete all objects with these contexts.

The idea is that posts with local activities (posts, replies, likes, repeats...) may be interesting to keep.
Besides that, a post lives in a certain context (the thread), so we keep the whole thread as well.

Caveats:
* ~~Quotes have a different context. Therefore, when someone quotes a post, it's possible the quoted post will still be deleted.~~ fixed in #379
* Although undocumented (in docs/docs/administration/CLI_tasks/database.md/#prune-old-remote-posts-from-the-database), the 'normal' delete action still kept old remote non-public posts. I added an option to keep this behaviour, but this also means that you now have to explicitly provide that option. **This could be considered a breaking change!**
* ~~Note that this removes from the objects table, but not from the activities.~~ See #427 for that.

Some statistics from explain analyse:
(cost=1402845.92..1933782.00 rows=3810907 width=62) (actual time=2562455.486..2562455.495 rows=0 loops=1)
 Planning Time: 505.327 ms
 Trigger for constraint chat_message_references_object_id_fkey: time=651939.797 calls=921740
 Trigger for constraint deliveries_object_id_fkey: time=52036.009 calls=921740
 Trigger for constraint hashtags_objects_object_id_fkey: time=20665.778 calls=921740
 Execution Time: 3287933.902 ms

***
**TODO**
1. [x] **Question:** Is it OK to keep it like this in regard to quote posts? If not (ie post quoted by local users should also be kept), should we give quotes the same context as the post they are quoting? (If we don't want to give them the same context, I'll have to see how/if I can do it without being too costly)
    * See #379
2. [x] **Question:** the "original" query only deletes public posts (this is undocumented, but you can check the code). This new one doesn't care for scope. From the docs I get that the idea is that posts can be refetched when needed. But I have from a trusted source that Pleroma can't refetch non-public posts. I assume that's the reason why they are kept here. I see different options to deal with this
    1. ~~We keep it as currently implemented and just don't care about scope with this option~~
    2. ~~We add logic to not delete non-public posts either (I'll have to see how costly that becomes)~~
    3. We add an extra --keep-non-public parameter. This is technically speaking breakage (you didn't have to provide a param before for this, now you do), but I'm inclined to not care much because it wasn't documented nor tested in the first place.
3. [x] See if we can do the query using Elixir
4. [x] Test on a bigger DB to see that we don't run into a timeout
5. [x] Add docs

Co-authored-by: ilja <git@ilja.space>
Reviewed-on: #350
Co-authored-by: ilja <akkoma.dev@ilja.space>
Co-committed-by: ilja <akkoma.dev@ilja.space>
2023-01-09 22:15:41 +00:00
floatingghost 357f80a714 Merge pull request 'Changed references of "Pleroma" to "Akkoma" in email text' (#428) from knova/akkoma:develop into develop
ci/woodpecker/push/woodpecker Pipeline is pending Details
Reviewed-on: #428
2023-01-09 22:13:45 +00:00
darkkirb a8cd859ef9 Use actual ISO8601 timestamps for masto API (#425)
ci/woodpecker/push/woodpecker Pipeline is pending Details
Some users post posts with spoofed timestamp, and some clients will have issues with certain dates. Tusky for example crashes if the date is any sooner than 1 BCE (“year zero” in the representation).

I limited the range of what is considered a valid date to be somewhere between the years 1583 and 9999 (inclusive).

The numbers have been chosen because:

- ISO 8601 only allows years before 1583 with “mutual agreement”
- Years after 9999 could cause issues with certain clients as well

Co-authored-by: Charlotte 🦝 Delenk <lotte@chir.rs>
Reviewed-on: #425
Co-authored-by: darkkirb <lotte@chir.rs>
Co-committed-by: darkkirb <lotte@chir.rs>
2023-01-09 22:12:28 +00:00
floatingghost 0d56adc16b Merge pull request 'exiftool doesn’t support JPEG XL either' (#426) from darkkirb/akkoma:exiftools-no-jxl into develop
ci/woodpecker/push/woodpecker Pipeline is pending Details
Reviewed-on: #426
2023-01-09 22:10:54 +00:00
knova 13d943667e Changed references of "Pleroma" to "Akkoma" in email text
ci/woodpecker/pr/woodpecker Pipeline is pending Details
I know this is probably small peanuts in the grand scheme of things, but it bugged me when I was messing around with my own Akkoma instance.
2023-01-08 03:29:09 +00:00
Charlotte 🦝 Delenk f2b925f32c
exiftool doesn’t support JPEG XL either
ci/woodpecker/pr/woodpecker Pipeline is pending Details
2023-01-07 14:49:58 +01:00
ihor b98fe4476c fix "exiftool not support svg files' (#421)
ci/woodpecker/push/woodpecker Pipeline was successful Details
Faced with this issue today, Pleroma responds with status 400 (Bad request) if Exiftool.StripLocation is added to the list of filter modules for uploads. Here is logs:

```
13:27:25.201 [info] POST /api/v1/media

13:27:25.232 request_id=FzdspaAnrA6cyv0APgVR [error] Elixir.Pleroma.Upload.Filter: Filter Elixir.Pleroma.Upload.Filter.Exiftool.StripLocation failed: {:error, "Elixir.Pleroma.Upload.Filter.Exiftool.StripLocation: %ErlangError{original: :enoent}"}

13:27:25.232 request_id=FzdspaAnrA6cyv0APgVR [error] Elixir.Pleroma.Upload store (using Pleroma.Uploaders.Local) failed: "Elixir.Pleroma.Upload.Filter.Exiftool.StripLocation: %ErlangError{original: :enoent}"
```

# This fix solves this problem.

Reviewed-on: #421
Co-authored-by: ihor <ikandreew@gmail.com>
Co-committed-by: ihor <ikandreew@gmail.com>
2023-01-05 15:22:48 +00:00
FloatingGhost 336d06b2a8 Significantly tighten HTTP CSP
ci/woodpecker/push/woodpecker Pipeline was successful Details
2023-01-02 15:21:19 +00:00
FloatingGhost 57e51fe62c Migrate Pleroma.Web to phoenix 1.6 formats
ci/woodpecker/push/woodpecker Pipeline is pending Details
2023-01-02 03:29:02 +00:00
FloatingGhost 6a333ade7f Fix task name for robotstxt
ci/woodpecker/push/woodpecker Pipeline was successful Details
Fixes #408
2023-01-01 18:54:08 +00:00
floatingghost 798d13d6e9 Merge pull request 'Use a genserver to periodically fetch metrics' (#413) from prom-leak into develop
ci/woodpecker/push/woodpecker Pipeline was successful Details
Reviewed-on: #413
2023-01-01 18:49:05 +00:00
FloatingGhost 6e646c4cbc Use a genserver to periodically fetch metrics
ci/woodpecker/push/woodpecker Pipeline is pending Details
ci/woodpecker/pr/woodpecker Pipeline was successful Details
Ref https://github.com/beam-telemetry/telemetry_metrics_prometheus_core/issues/52
2023-01-01 18:32:14 +00:00
floatingghost 6be3383a09 Merge pull request 'Add /api/v1/followed_tags' (#410) from followed-tags into develop
ci/woodpecker/push/woodpecker Pipeline is pending Details
Reviewed-on: #410
2022-12-31 18:29:09 +00:00
FloatingGhost c4b46ca460 Add /api/v1/followed_tags
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline was successful Details
2022-12-31 18:09:34 +00:00
ilja 745e15468e Use same context for quote posts as the post that's being quoted (#379)
ci/woodpecker/push/woodpecker Pipeline is pending Details
See #350 (comment)

When making quotes through Mast-API, they will now have the same context as the quoted post. This also results in them being showed when fetching the thread. I checked Misskey to see how it's there, and they show the quotes there as well, see e.g. <https://mk.toast.cafe/notes/98u1g0tulg>.

An example from Akkoma:

Co-authored-by: ilja <git@ilja.space>
Reviewed-on: #379
Reviewed-by: floatingghost <hannah@coffee-and-dreams.uk>
Co-authored-by: ilja <akkoma.dev@ilja.space>
Co-committed-by: ilja <akkoma.dev@ilja.space>
2022-12-31 18:09:27 +00:00
FloatingGhost b8f280b4b5 Rich media doesn't need to be a map
ci/woodpecker/push/woodpecker Pipeline is pending Details
2022-12-31 03:53:52 +00:00
FloatingGhost c8f2c4b638 add changelog entry for timeouts
ci/woodpecker/push/woodpecker Pipeline is pending Details
2022-12-31 03:52:52 +00:00
FloatingGhost bf7ff6a337 Put rich media processing in a Task
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-12-30 20:11:53 +00:00
FloatingGhost 5d4c291d52 update references to pleroma in docs
ci/woodpecker/push/woodpecker Pipeline is pending Details
2022-12-30 03:43:35 +00:00
timorl bca1c43dcb Add docs about emoji stealing (#364)
ci/woodpecker/push/woodpecker Pipeline was successful Details
I managed to steal some emoji, but I had to figure out the specifics the hard way. This should make it easier for future criminals.

Feel free to close if this documentation was omitted on purpose, I can imagine some reasons for why it might have.

Co-authored-by: timorl <timorl@disroot.org>
Reviewed-on: #364
Co-authored-by: timorl <timorl+akkomadev@disroot.org>
Co-committed-by: timorl <timorl+akkomadev@disroot.org>
2022-12-30 02:58:06 +00:00
floatingghost bdc676e433 Merge pull request 'docs/installation: update comment to reflect flavour change' (#394) from norm/akkoma:flavour-fix into develop
ci/woodpecker/push/woodpecker Pipeline is pending Details
Reviewed-on: #394
2022-12-30 02:54:09 +00:00
floatingghost 063cc61fc1 Merge pull request 'remove comment about old openssl versions in nginx config' (#395) from norm/akkoma:remove-old-openssl-comment into develop
ci/woodpecker/push/woodpecker Pipeline is pending Details
Reviewed-on: #395
2022-12-30 02:53:48 +00:00
floatingghost 084bb3b371 Merge pull request 'Don't treat js/css as binary in git anymore' (#397) from norm/akkoma:norm-patch-2 into develop
ci/woodpecker/push/woodpecker Pipeline is pending Details
Reviewed-on: #397
2022-12-30 02:50:52 +00:00
floatingghost 5624366056 Merge pull request 'docs: fedora install errata' (#398) from acuteaura/akkoma:acuteaura-patch-1 into develop
ci/woodpecker/push/woodpecker Pipeline is pending Details
Reviewed-on: #398
2022-12-30 02:50:34 +00:00
floatingghost 9be6caf125 argon2 password hashing (#406)
ci/woodpecker/push/woodpecker Pipeline was successful Details
Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk>
Reviewed-on: #406
2022-12-30 02:46:58 +00:00
floatingghost a5e98083f2 Add link verification in profile fields (#405)
ci/woodpecker/push/woodpecker Pipeline was successful Details
Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk>
Reviewed-on: #405
2022-12-29 20:56:06 +00:00
FloatingGhost 1121deb078 Document instance reboots
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-12-29 20:24:04 +00:00
FloatingGhost 5a405bdadf document dump_to_file and load_from_file
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-12-29 20:00:04 +00:00
FloatingGhost d1bf8aa9ed Add dump_to_file and load_from_file tasks 2022-12-29 19:56:35 +00:00
FloatingGhost e66bcb64a4 Check out the latest tag on update
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-12-29 15:42:25 +00:00
Stefan 11ec4e1b8f clean-up docs to avoid mismatches in BE and FE. Clearly state that stable-versions are installed 2022-12-29 15:41:20 +00:00
acuteaura e392662d76 docs: fedora install errata
ci/woodpecker/pr/woodpecker Pipeline is pending Details
2022-12-25 15:32:57 +00:00
Norm 5a6fa6717b Don't treat js/css as binary in git anymore
ci/woodpecker/pr/woodpecker Pipeline is pending Details
Since Akkoma doesn't include precompiled frontends in the main repo anymore, it doesn't make sense to keep treating the few js/css files remaining as binary files.
2022-12-23 18:03:14 +00:00
Norm 03a00d005a
remove comment about old openssl versions in nginx config
ci/woodpecker/pr/woodpecker Pipeline is pending Details
I doubt many people are actually still using OpenSSL 1.0.2 or older,
since that version was first released in 2015, and last updated in 2019.
2022-12-22 19:27:16 -05:00
Norm 6610a1d5fb
docs/installation: update comment to reflect flavour change
ci/woodpecker/pr/woodpecker Pipeline is pending Details
The comment still says the flavour is `amd64-musl` when it was updated
to just `amd64` in 64ccdadad3.
2022-12-22 19:18:54 -05:00
floatingghost 1fd5c4b221 Merge pull request 'doc-update / switch default flavor to amd64' (#393) from YokaiRick/akkoma:develop into develop
ci/woodpecker/push/woodpecker Pipeline was successful Details
Reviewed-on: #393
2022-12-22 23:39:35 +00:00
YokaiRick 64ccdadad3 switch default flavor to amd64
ci/woodpecker/pr/woodpecker Pipeline is pending Details
Most ppl probably need to set it to amd64.
This would help to remove some confusion while installing akkoma
2022-12-22 21:25:31 +00:00
FloatingGhost af7c3fab98 Do not crash on invalid atom in configDB
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-12-21 00:16:39 +00:00
Atsuko Karagi 4a78c431cf Simplified HTTP signature processing
ci/woodpecker/push/woodpecker Pipeline is pending Details
2022-12-19 20:41:48 +00:00
Atsuko Karagi e17c71a389 Respect restrict_unauthenticated in /api/v1/accounts/lookup 2022-12-19 20:32:16 +00:00
FloatingGhost 07ccfafd92 Mix format
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-12-19 13:07:29 +00:00
ilja c092fc9fd6 Add translation module for Argos Translate (#351)
ci/woodpecker/push/woodpecker Pipeline is pending Details
Argos Translate is a Python module for translation and can be used as a command line tool.

This is also the engine for LibreTranslate, for which we already have a module.
Here we can use the engine directly from our server without doing requests to a third party or having to install our own LibreTranslate webservice (obviously you do have to install Argos Translate).

One thing that's currently still missing from Argos Translate is auto-detection of languages (see <https://github.com/argosopentech/argos-translate/issues/9>). For now, when no source language is provided, we just return the text unchanged, supposedly translated from the target language. That way you get a near immediate response in pleroma-fe when clicking Translate, after which you can select the source language from a dropdown.

Argos Translate also doesn't seem to handle html very well. Therefore we give admins the option to strip the html before translating. I made this an option because I'm unsure if/how this will change in the future.

Co-authored-by: ilja <git@ilja.space>
Reviewed-on: #351
Co-authored-by: ilja <akkoma.dev@ilja.space>
Co-committed-by: ilja <akkoma.dev@ilja.space>
2022-12-19 13:06:39 +00:00
floatingghost 233c4bb3ba revert 28ab09d377
ci/woodpecker/push/woodpecker Pipeline is pending Details
revert Remove unused dependencies
2022-12-19 02:34:46 +00:00
FloatingGhost 28ab09d377 Remove unused dependencies
ci/woodpecker/push/woodpecker Pipeline is pending Details
2022-12-19 02:26:04 +00:00
FloatingGhost 3d546409b2 remove now-unused test
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-12-17 23:21:24 +00:00
FloatingGhost 52d8183787 drop admin scopes on create app instead of rejecting 2022-12-17 23:14:49 +00:00
FloatingGhost dcac8adb3d Add option to modify HTTP pool size
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-12-16 18:33:00 +00:00
FloatingGhost 126f1ca69c increase rich media backoff time
ci/woodpecker/push/woodpecker Pipeline is pending Details
2022-12-16 17:31:04 +00:00
FloatingGhost afab5585a0 Merge branch 'develop' of akkoma.dev:AkkomaGang/akkoma into develop
ci/woodpecker/push/woodpecker Pipeline is pending Details
2022-12-16 17:23:03 +00:00
FloatingGhost 7b76fdeed3 update stats every 5 minutes 2022-12-16 17:22:56 +00:00