Compare commits

...

1620 Commits

Author SHA1 Message Date
lain a0cdc4cf9e Merge branch 'revert-0fe3f749' into 'develop'
Revert "Merge branch 'copyright-bump' into 'develop'"

See merge request pleroma/pleroma!3826
2023-01-02 21:06:52 +00:00
lain e853cfe7c3 Revert "Merge branch 'copyright-bump' into 'develop'"
This reverts merge request !3825
2023-01-02 20:38:50 +00:00
Haelwenn 0fe3f749ea Merge branch 'copyright-bump' into 'develop'
Bump copyright year

See merge request pleroma/pleroma!3825
2023-01-02 16:38:34 +00:00
marcin mikołajczak 10886eeaa2 Bump copyright year
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2023-01-01 12:13:06 +01:00
Haelwenn 2bc6911139 Merge branch 'weblate-extract' into 'develop'
Extract translatable strings

See merge request pleroma/pleroma!3818
2022-12-24 11:01:22 +00:00
weblate-extractor 64eef1eae4 Extract translatable strings 2022-12-24 06:06:39 +00:00
Haelwenn b367f22256 Merge branch 'mergeback/2.5.0' into 'develop'
Mergeback: 2.5.0

See merge request pleroma/pleroma!3817
2022-12-23 18:15:52 +00:00
Haelwenn (lanodan) Monnier 6126f203d3 mix: version 2.5.50 2022-12-23 18:46:14 +01:00
Haelwenn f76c1d4f70 Merge branch 'release/2.5.0' into 'stable'
Release 2.5.0

See merge request pleroma/pleroma!3816
2022-12-23 17:43:21 +00:00
Haelwenn (lanodan) Monnier 91c22637de mix: Release 2.5.0 2022-12-23 17:10:02 +01:00
Haelwenn (lanodan) Monnier ee7694fa91 CHANGELOG: Set 2.5.0 2022-12-23 17:09:57 +01:00
Haelwenn (lanodan) Monnier 5ce7db455c Git merge is not my favorite tool 2022-12-23 17:07:26 +01:00
Haelwenn (lanodan) Monnier 3fbd42061c Revert "Delete report notifs when demoting from superuser"
This reverts commit 4504c81080.
2022-12-23 17:06:09 +01:00
Haelwenn (lanodan) Monnier 7d68d64d63 Merge back 2.4.5 2022-12-23 17:05:05 +01:00
Haelwenn 6bce88b9e7 Merge branch 'pleromafe-2.5.0' into 'develop'
Update PleromaFE bundle to 2.5.0

See merge request pleroma/pleroma!3815
2022-12-23 14:32:10 +00:00
Haelwenn (lanodan) Monnier 2c5bc9cffd Update PleromaFE bundle to 2.5.0 2022-12-23 15:01:49 +01:00
Haelwenn 99ff91584d Merge branch 'adminfe-2.5.0' into 'develop'
Update AdminFE bundle to version 2.5.0

See merge request pleroma/pleroma!3814
2022-12-23 13:48:35 +00:00
Haelwenn 718ff64c3b Merge branch 'fine_grained_moderation_privileges' into 'develop'
fine grained moderation privileges (continued)

See merge request pleroma/pleroma!3812
2022-12-23 13:48:07 +00:00
Sean King 90681c720d
Make lint happy 2022-12-21 23:40:39 -07:00
Sean King 351b5a9df4
Use crazy hack to finally get pleroma:report notifications not visible after revoking privileges 2022-12-21 23:35:39 -07:00
Sean King 3bb78ac152 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into fine_grained_moderation_privileges 2022-12-21 22:36:54 -07:00
Haelwenn (lanodan) Monnier cf1d91c718 Update AdminFE bundle to version 2.5.0 2022-12-21 13:03:32 +01:00
lain 5910d58cf7 Merge branch 'weblate-extract' into 'develop'
Extract translatable strings

See merge request pleroma/pleroma!3813
2022-12-20 15:05:21 +00:00
weblate-extractor b3d250a70a Extract translatable strings 2022-12-20 06:11:50 +00:00
Sean King e07fb6e7dc Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into fine_grained_moderation_privileges 2022-12-19 22:02:44 -07:00
lain 0840ce5671 Merge branch 'deletion-resilience' into 'develop'
Deletion resilience

See merge request pleroma/pleroma!3237
2022-12-20 03:07:59 +00:00
Sean King d5d4c7c11d Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into fine_grained_moderation_privileges 2022-12-19 18:48:26 -07:00
lain 7aa17cd651 Merge branch 'doc_readme_nixos' into 'develop'
add nixos to supported distros

See merge request pleroma/pleroma!3600
2022-12-20 01:13:03 +00:00
lain c6dff687c0 Merge branch 'from/upstream/develop/tusooa/mrf-updates' into 'develop'
MRFs with Updates

See merge request pleroma/pleroma!3808
2022-12-20 00:51:41 +00:00
Sean King 1d95012758 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into fine_grained_moderation_privileges 2022-12-19 17:48:11 -07:00
lain 3311e0efed Merge branch 'fix/2980-rss-feed-generation' into 'develop'
fix atom and rss feeds for users and tags

See merge request pleroma/pleroma!3783
2022-12-20 00:19:27 +00:00
lain 3dfa009ec3 Merge branch 'develop' into 'fix/2980-rss-feed-generation'
# Conflicts:
#   CHANGELOG.md
2022-12-19 23:43:23 +00:00
feld 1946b49ebe Merge branch 'fix-twittercard-tags' into 'develop'
Fix TwitterCard meta tags

See merge request pleroma/pleroma!3811
2022-12-19 23:13:53 +00:00
Mark Felder 72d4d1b392 Fix TwitterCard meta tags
TwitterCard meta tags are supposed to use the attributes "name" and "content".
OpenGraph tags use the attributes "property" and "content".

Twitter itself is smart enough to detect broken meta tags and discover the TwitterCard
using "property" and "content", but other platforms that only implement parsing of TwitterCards
and not OpenGraph may fail to correctly detect the tags as they're under the wrong attributes.

> "Open Graph protocol also specifies the use of property and content attributes for markup while
> Twitter cards use name and content. Twitter’s parser will fall back to using property and content,
> so there is no need to modify existing Open Graph protocol markup if it already exists." [0]

[0] https://developer.twitter.com/en/docs/twitter-for-websites/cards/guides/getting-started
2022-12-19 17:23:12 -05:00
Sean King c58eb873dd
Fix CommonAPI delete function to use User.privileged? instead of User.superuser? 2022-12-18 22:05:07 -07:00
Sean King 60df2d8a97
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into fine_grained_moderation_privileges 2022-12-18 22:03:48 -07:00
faried nawaz fce2998481
use to_rfc2822 instead of pub_date in tests, too 2022-12-19 01:44:47 +05:00
faried nawaz 96cfc9575c
document rss/atom fix in changelog 2022-12-19 01:44:47 +05:00
faried nawaz c49316faee
modify user feed controller test to expect summary for title 2022-12-19 01:44:47 +05:00
faried nawaz 0f67eab384
remove pub_date() -- use to_rfc2822 instead
_tag_activity.xml.eex used activity_content() instead
of activity_description(), and did not escape html properly.
2022-12-19 01:44:46 +05:00
faried nawaz f597b1b3e6
remove ap_id test -- the element makes the feed break 2022-12-19 01:44:46 +05:00
faried nawaz 3f63caee2a
fix: add xmlns:thr for in-reply-to refs 2022-12-19 01:44:46 +05:00
faried nawaz 8d500977a6
fix: feed item title was escaped twice 2022-12-19 01:44:46 +05:00
Mark Felder f3253c0c6a
Implement RFC2822 timestamp formatting 2022-12-19 01:44:46 +05:00
faried nawaz 3f0783c0a5
fix atom and rss feeds for users and tags
Changes:
  - make the XML closer to spec (RSS does not pass w3c's validator, but works)
  - fix dates (RFC3339 for Atom, doc says RFC822 for RSS but RFC1123 is closer)
  - fix attachment/enclosure links (but see below)
  - set feed item title to post's "summary" if present
  - pruned several elements that validators did not like
    - examples: ap_enabled, user banner urls.

Specs:
  - https://www.rssboard.org/rss-specification
  - https://validator.w3.org/feed/docs/atom.html
  - https://www.intertwingly.net/wiki/pie/Rss20AndAtom10Compared

Validators:
  - https://validator.w3.org/feed/
  - https://rssatom.com/feedvalidator.php

Attachment/enclosure links should have a "length" field (mandatory
according to the spec).  This is not present in the object's data
map.
2022-12-19 01:44:41 +05:00
lain 8db82932a7 Merge branch 'fix-amd64-musl' into 'develop'
CI: Fix image for amd64-musl

See merge request pleroma/pleroma!3810
2022-12-16 20:29:48 +00:00
Lain Soykaf 8e6f2624a8 CI: Fix image for amd64-musl 2022-12-16 14:32:30 -05:00
tusooa 59eaab3e7d Merge branch 'weblate-extract' into 'develop'
Extract translatable strings

See merge request pleroma/pleroma!3764
2022-12-16 17:20:16 +00:00
weblate-extractor cfca9544e8 Extract translatable strings 2022-12-16 16:59:26 +00:00
tusooa a3985aac91 Merge branch 'fix-2856' into 'develop'
Uploading an avatar media exceeding max size returns a 413

Closes #2856

See merge request pleroma/pleroma!3804
2022-12-16 16:15:36 +00:00
lain 301eb86b35 Merge branch 'update-deps' into 'develop'
Update to Phoenix 1.6, Elixir 1.11, and chase dependencies

See merge request pleroma/pleroma!3766
2022-12-16 00:36:59 +00:00
lain c0cfc454ba Merge branch 'from/upstream-develop/tusooa/register-approval' into 'develop'
Fix failure when registering a user with no email when approval required

Closes #3021

See merge request pleroma/pleroma!3807
2022-12-15 23:07:49 +00:00
Lain Soykaf bb27e4134b AudioVideoValidator: Fix embedded attachment requirements 2022-12-15 18:06:28 -05:00
Lain Soykaf 4a32b584e1 StatusView: Fix warning 2022-12-15 18:02:33 -05:00
Lain Soykaf 9838790a7d AttachmentValidator: Actually require url 2022-12-15 17:46:20 -05:00
Lain Soykaf 63d00f8123 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into update-deps 2022-12-15 17:19:36 -05:00
tusooa 2554028097
Make SimplePolicy Update-aware
This is inspired by d5828f1c5e
2022-12-15 11:57:45 -05:00
tusooa dc7efcd08b
Make TagPolicy Update-aware
This is inspired by d5828f1c5e
2022-12-15 11:08:24 -05:00
tusooa 62c27e0164
Fix failure when registering a user with no email when approval required 2022-12-14 01:04:42 -05:00
duponin 9876742358 Return 413 when an actor's banner or background exceeds the size limit 2022-12-11 23:15:08 +01:00
duponin 452595baed Uploading an avatar media exceeding max size returns a 413
Until now it was returning a 500 because the upload plug were going
through the changeset and ending in the JSON encoder, which raised
because struct has to @derive the encoder.
2022-12-11 22:54:47 +01:00
Haelwenn 204fd6faae Merge branch 'from/upstream-develop/tusooa/report-fake' into 'develop'
Report an Object, not a Create Activity

Closes #2986

See merge request pleroma/pleroma!3788
2022-12-09 14:25:24 +00:00
tusooa da0c684344
Add tests for flagging non-Create activities 2022-12-08 20:51:08 -05:00
tusooa 1036acb6ae Merge branch 'release-template' into 'develop'
Add Gitlab Release™ into Release MR template

See merge request pleroma/pleroma!3797
2022-12-06 20:41:22 +00:00
lain 633a76b5b3 Merge branch 'jrabbit-develop-patch-67125' into 'develop'
Upgrade docs improvement: reccomend tagged releases over pulling stable branch

See merge request pleroma/pleroma!3800
2022-12-06 20:13:55 +00:00
jrabbit 8afad1e46e reccomend tagged releases over pulling stable 2022-12-06 17:24:04 +00:00
Haelwenn f60cb0f771 Merge branch 'ci/amd64-build-tags' into 'develop'
CI: Tag amd64 releases for amd64 runners

See merge request pleroma/pleroma!3799
2022-12-05 23:33:46 +00:00
Haelwenn eb7f4bc51b Merge branch 'weblate' into 'develop'
Translations update from Pleroma Weblate

See merge request pleroma/pleroma!3798
2022-12-05 23:15:44 +00:00
Haelwenn (lanodan) Monnier b6e96f63b4 CI: Tag amd64 releases for amd64 runners 2022-12-06 00:08:55 +01:00
Xnuk Shuman 3e8f49be67 Added translation using Weblate (Korean) 2022-12-01 17:17:03 +00:00
Haelwenn (lanodan) Monnier 1eb3ce956b Add Gitlab Release™ into Release MR template 2022-11-28 22:08:47 +01:00
Haelwenn d8e326467c Merge branch 'fix/2.4.5-release-date' into 'stable'
Fix changelog date

See merge request pleroma/pleroma!3796
2022-11-28 04:35:51 +00:00
Sean King 75c9f7770f
Fix changelog date 2022-11-27 20:17:48 -07:00
Haelwenn 20790c1dd3 Merge branch 'mergeback/2.4.5' into 'develop'
CHANGELOG.md: Fix date for 2.4.5

See merge request pleroma/pleroma!3795
2022-11-28 02:31:18 +00:00
Haelwenn 3394394e0f Merge branch 'develop' into 'develop'
Change follow_operation schema to use type BooleanLike

Closes #2999

See merge request pleroma/pleroma!3787
2022-11-28 00:13:35 +00:00
ave 0f88c2bca4 Change follow_operation schema to use type BooleanLike 2022-11-28 00:13:34 +00:00
Haelwenn (lanodan) Monnier d6cd447cfa CHANGELOG.md: Fix date for 2.4.5 2022-11-27 22:28:48 +01:00
Haelwenn 36789986c0 Merge branch 'mergeback/2.4.5' into 'develop'
Mergeback: 2.4.5

See merge request pleroma/pleroma!3794
2022-11-27 21:24:44 +00:00
Haelwenn 76bdb01c18 Merge branch 'release/2.4.5' into 'stable'
Release 2.4.5

See merge request pleroma/pleroma!3793
2022-11-27 21:24:19 +00:00
Haelwenn (lanodan) Monnier f6d55e1e77 Mergeback of release 2.4.5 2022-11-27 13:20:42 +01:00
Haelwenn (lanodan) Monnier 2614f431b9 Release 2.4.5 2022-11-27 13:17:21 +01:00
Hélène 542bb17258 ArticleNotePageValidator: fix replies fixing
Some software, like GoToSocial, expose replies as ActivityPub
Collections, but do not expose any item array directly in the object,
causing validation to fail via the ObjectID validator. Now, Pleroma will
drop that field in this situation too.
2022-11-27 04:54:19 +01:00
FloatingGhost 747311f623 fix resolution of GTS user keys 2022-11-27 04:54:18 +01:00
Tusooa Zhu 11d5ad24c5 Make local-only posts stream in local timeline 2022-11-27 04:39:32 +01:00
Tusooa Zhu e46c3a0595 Do not stream out Create of ChatMessage 2022-11-27 04:39:32 +01:00
Sean King 9b68778887 Fix fedi-fe build URL 2022-11-27 04:34:33 +01:00
Haelwenn (lanodan) Monnier f2221d539c script_test: Fix %ErlangError for Elixir 1.14 2022-11-27 04:25:48 +01:00
Haelwenn (lanodan) Monnier 915c7319c6 mix: Switch prometheus_ex to fix/elixir-1.14 branch 2022-11-27 04:25:48 +01:00
Haelwenn (lanodan) Monnier f12ddcd697 timeline_controller_test: Fix test name for elixir 1.14 2022-11-27 04:25:48 +01:00
Tusooa Zhu 09ab51eebb Make mutes and blocks behave the same as other lists 2022-11-27 04:21:58 +01:00
Haelwenn (lanodan) Monnier 7ec3469bea Transmogrifier: Use validating regex for "mediaType" 2022-11-27 04:21:31 +01:00
Haelwenn (lanodan) Monnier 8640d217b1 AttachmentValidator: Use custom ecto type and regex for "mediaType" 2022-11-27 04:21:31 +01:00
Haelwenn (lanodan) Monnier da71092003 EctoType: Add MIME validator 2022-11-27 04:21:31 +01:00
Ilja 4504c81080 Delete report notifs when demoting from superuser
When someone isn't a superuser any more, they shouldn't see the reporsts any more either.
Here we delete the report notifications from a user when that user gets updated from being a superuser to a non-superuser.
2022-11-27 04:20:11 +01:00
Haelwenn 3b289a1643 Merge branch 'skip-kanji-mac' into 'develop'
Skip two unicode/kanji tests that can't pass on Mac.

See merge request pleroma/pleroma!3791
2022-11-27 03:12:34 +00:00
Jeremy Huffman f531099d2d Skip two unicode/kanji tests that can't pass on Mac. 2022-11-27 03:12:34 +00:00
Haelwenn (lanodan) Monnier 508b438b53 scrubbers: Scrub img class attribute
Closes: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3790
2022-11-27 04:04:17 +01:00
Haelwenn (lanodan) Monnier 8f3e750530 scrubbers: Scrub img class attribute
Closes: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3790
2022-11-27 03:40:21 +01:00
Haelwenn 7f0b3161ea Merge branch 'akoma/deactivated-users' into 'develop'
Timeline query performance improvements

See merge request pleroma/pleroma!3779
2022-11-20 23:40:58 +00:00
tusooa afe4bb2307
Fix UtilsTest 2022-11-20 01:06:21 -05:00
tusooa 9d99e76a3a
Fix unit tests 2022-11-20 00:57:04 -05:00
tusooa 0e0c316c76
Fix report api 2022-11-20 00:35:52 -05:00
tusooa a69e9ae2ef
Flag an Object, not an Activity 2022-11-19 23:51:43 -05:00
feld f40ccce7e9 Merge branch 'quack-docs' into 'develop'
Remove Quack from docs and cheatsheet

See merge request pleroma/pleroma!3786
2022-11-18 16:38:08 +00:00
Mark Felder c7a0df8006 Remove Quack from docs and cheatsheet 2022-11-18 10:09:52 -05:00
feld bb63f72c11 Merge branch 'flash-support-csp' into 'develop'
Reduce CSP policy to make Ruffle work on chrome

See merge request pleroma/pleroma!3389
2022-11-17 17:29:36 +00:00
Mark Felder cddcafee7f Document inclusion of wasm-unsafe-eval 2022-11-17 12:03:29 -05:00
HJ a31d3589ed Update http_security_plug.ex 2022-11-17 12:03:01 -05:00
HJ 79bd363a68 Update lib/pleroma/web/plugs/http_security_plug.ex 2022-11-17 12:03:01 -05:00
Henry Jameson db76ea578a try to fix ruffle on chrome 2022-11-17 12:03:01 -05:00
feld a9d991d31e Merge branch 'develop' into 'akoma/deactivated-users'
# Conflicts:
#   CHANGELOG.md
2022-11-14 14:03:11 +00:00
lain 0e1356ef9c Merge branch 'akkoma/delete-improvements' into 'develop'
Alter priority of Delete activities to be lowest

See merge request pleroma/pleroma!3782
2022-11-14 07:24:46 +00:00
lain 76ed0da09f Merge branch 'bugfix/reset-unreachable-on-fetch' into 'develop'
Object.Fetcher: Set reachable on successful fetch

See merge request pleroma/pleroma!3780
2022-11-14 07:22:33 +00:00
Mark Felder 2186e9b62b Tell newer Credo it's OK to exit 0 on single with clauses and piping into anonymous functions for now 2022-11-13 18:46:02 -05:00
Mark Felder e9c3be262c Bump credo
Old credo is throwing errors on my Elixir 1.13 / OTP 25
2022-11-13 14:17:41 -05:00
Mark Felder 2e0089dd5c Alter priority of Delete activities to be lowest
This will prevent a user with a large number of posts from negatively affecting performance of the outgoing federation queue if they delete their account.
2022-11-13 14:11:48 -05:00
Haelwenn a2db64b12b Merge branch 'fix-typo-in-csp-report-to-header-name' into 'develop'
Fix typo in CSP Report-To header name

See merge request pleroma/pleroma!3768
2022-11-13 18:53:59 +00:00
Haelwenn e86ca8a436 Merge branch 'weblate' into 'develop'
Translations update from Pleroma Weblate

See merge request pleroma/pleroma!3772
2022-11-13 18:53:12 +00:00
Mark Felder 47b9847edd Deletes do not generate notifications of any kind, so skip trying 2022-11-13 12:25:52 -05:00
Haelwenn (lanodan) Monnier b2713357b9 Object.Fetcher: Set reachable on successful fetch 2022-11-13 16:51:12 +01:00
Mark Felder 39b24cdce6 Document query performance improvement 2022-11-12 18:32:49 -05:00
Mark Felder edaf0a05f8 Add same optimized join for excluding invisible users 2022-11-12 18:06:28 -05:00
Mark Felder 749445dd50 Fix reports which do not have a user
The check for deactivated users was being applied to report activities.
2022-11-12 17:54:11 -05:00
FloatingGhost 4d321be05c Extract deactivated users query to a join 2022-11-12 17:52:28 -05:00
Dmytro Poltavchenko 451c415fca Translated using Weblate (Ukrainian)
Currently translated at 100.0% (95 of 95 strings)

Translation: Pleroma/Pleroma Backend (domain errors)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-errors/uk/
2022-11-12 22:13:38 +00:00
Dmytro Poltavchenko 1c97a86b8d Added translation using Weblate (Ukrainian) 2022-11-12 22:13:38 +00:00
Dmytro Poltavchenko 3979eaf14a Added translation using Weblate (Ukrainian) 2022-11-12 22:13:38 +00:00
feld 3d1828f43b Merge branch 'oban-timeouts' into 'develop'
Define sane Oban Worker timeouts

See merge request pleroma/pleroma!3777
2022-11-12 22:13:28 +00:00
tusooa f38cb4ccac Merge branch 'from/upstream-develop/tusooa/no-strip-report' into 'develop'
Lint

See merge request pleroma/pleroma!3778
2022-11-12 19:48:26 +00:00
tusooa 14871fecd4
Lint 2022-11-12 14:16:52 -05:00
tusooa 1b0e47b79b Merge branch 'from/upstream-develop/tusooa/no-strip-report' into 'develop'
Give admin the choice to not strip reported statuses

Closes #2887

See merge request pleroma/pleroma!3773
2022-11-12 17:55:50 +00:00
tusooa e3e68b9377
Update config cheatsheet 2022-11-12 12:55:02 -05:00
Haelwenn c2cfe0c690 Clarify config description 2022-11-12 17:44:31 +00:00
Mark Felder a977e1ef96 Document Oban workers getting timeouts defined 2022-11-12 11:12:00 -05:00
Haelwenn 7c8618dc9a Merge branch 'no-ducks' into 'develop'
Remove Quack logging backend

See merge request pleroma/pleroma!3776
2022-11-12 05:40:07 +00:00
tusooa 7991364380
Lint 2022-11-11 18:32:08 -05:00
Mark Felder 8be7f87e1f Define sane Oban Worker timeouts 2022-11-11 13:46:27 -05:00
Mark Felder 572751bec7 Clean up stale entries in mix.lock
mix deps.clean --unlock --unused
2022-11-11 12:48:13 -05:00
feld ceb07772d0 Merge branch 'custom-db-port' into 'develop'
allow custom db port

Closes #2981

See merge request pleroma/pleroma!3775
2022-11-11 17:38:51 +00:00
Mark Felder 7d0175dc3a Document removal of Quack 2022-11-11 12:36:38 -05:00
Mark Felder 8a3b450397 Add migration to remove Quack from ConfigDB 2022-11-11 12:36:34 -05:00
Mark Felder 6b87b3f2ea Remove Quack logging backend 2022-11-11 12:36:29 -05:00
lain e7c40c2509 fix envvar 2022-11-11 15:40:32 +00:00
Iván Raskovsky 36519bdbee allow custom db port 2022-11-11 12:22:21 -03:00
lain 39a96876ef Merge branch 'soapbox-ref' into 'develop'
Update links to Soapbox

See merge request pleroma/pleroma!3774
2022-11-11 12:04:47 +00:00
marcin mikołajczak eb70676931 Update links to Soapbox
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-11-11 12:13:30 +01:00
tusooa 717c5901f8
Render a generated reported activity properly 2022-11-09 23:02:27 -05:00
tusooa 6f047cc308
Do not strip reported statuses when configured not to 2022-11-09 22:36:57 -05:00
tusooa 481f50bcfd Merge branch 'docs/object_age-strip_followers' into 'develop'
ObjectAgePolicy: Make strip_followers behavior for followers-only explicit

See merge request pleroma/pleroma!3770
2022-11-07 14:07:30 +00:00
Haelwenn (lanodan) Monnier 648e012022 ObjectAgePolicy: Make strip_followers behavior for followers-only explicit 2022-11-07 14:58:47 +01:00
tusooa 8d704d384d Merge branch 'ci-coverage' into 'develop'
Test coverage: Switch to covertool to get cobertura output

See merge request pleroma/pleroma!3745
2022-11-06 02:19:27 +00:00
Thomas Citharel bdedc41cbc
Fix typo in CSP Report-To header name
The header name was Report-To, not Reply-To.

In any case, that's now being changed to the Reporting-Endpoints HTTP
Response Header.
https://w3c.github.io/reporting/#header
https://github.com/w3c/reporting/issues/177

CanIUse says the Report-To header is still supported by current Chrome
and friends.
https://caniuse.com/mdn-http_headers_report-to

It doesn't have any data for the Reporting-Endpoints HTTP header, but
this article says Chrome 96 supports it.
https://web.dev/reporting-api/

(Even though that's come out one year ago, that's not compatible with
Network Error Logging which's still using the Report-To version of the
API)

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2022-11-04 09:43:13 +01:00
feld 9f708037d7 Merge branch 'tusooa/caveats-webfinger' into 'develop'
Document some caveats of webfinger domain setting

See merge request pleroma/pleroma!3767
2022-11-03 22:24:38 +00:00
tusooa f2e4b425e1 Document some caveats of webfinger domain setting 2022-11-03 21:13:00 +00:00
Mark Felder 7c64f705f6 Update to Phoenix 1.6 and chase dependencies
Also bump minimum Elixir to 1.11
2022-11-03 16:13:07 +00:00
Haelwenn 127e7b8ff9 Merge branch 'feature/1469-webfinger-expanding' into 'develop'
Feature/1469 webfinger expanding

Closes #1469 and #2517

See merge request pleroma/pleroma!3361
2022-11-03 15:03:50 +00:00
Alexander Strizhakov 8407e26b0c rebase fix 2022-11-03 10:06:36 -04:00
Alexander Strizhakov a57c025594 docs update 2022-11-03 09:48:59 -04:00
Alexander Strizhakov 5a9ea98baf XML WebFinger user representation correct domain 2022-11-03 09:48:59 -04:00
Alexander Strizhakov 30ded8876a docs & changelog 2022-11-03 09:48:57 -04:00
Alexander Strizhakov 4121bca895 expanding WebFinger 2022-11-03 09:48:24 -04:00
Haelwenn da0ef154a6 Merge branch 'from/upstream-develop/tusooa/2930-get-or-fetch' into 'develop'
Fix User.get_or_fetch/1 with usernames starting with http

Closes #2930

See merge request pleroma/pleroma!3751
2022-10-30 00:38:21 +00:00
tusooa 9fbf01f7a9 Merge branch 'push-updates' into 'develop'
Push.Impl: support edits

See merge request pleroma/pleroma!3760
2022-10-27 12:51:29 +00:00
feld 7a519b6a66 Merge branch 'fix-deprecation-text' into 'develop'
Fix deprecation warning for Gun timeout

See merge request pleroma/pleroma!3759
2022-10-24 14:22:49 +00:00
Haelwenn 705ba6d615 Merge branch 'security/PleromaAPI-delete' into 'develop'
CommonAPI: generate ModerationLog for all admin/moderator deletes

See merge request pleroma/pleroma!3765
2022-10-15 12:54:20 +00:00
Haelwenn (lanodan) Monnier 16b06160ac CommonAPI: generate ModerationLog for all admin/moderator deletes
As a side-effect it also changes the ChatMessage delete ID to an
Activity.id rather than MessageReference.id

Closes: https://git.pleroma.social/pleroma/pleroma/-/issues/2958
2022-10-14 18:51:08 +02:00
tusooa c830282628 Merge branch 'weblate-extract' into 'develop'
Extract translatable strings

See merge request pleroma/pleroma!3752
2022-10-11 21:21:36 +00:00
weblate-extractor 1ac9bd0b4c Extract translatable strings 2022-10-11 06:13:00 +00:00
tusooa 8042e0ebe1 Merge branch 'mergeback/2.4.4' into 'develop'
mergeback: 2.4.4

See merge request pleroma/pleroma!3762
2022-10-09 04:29:09 +00:00
Tusooa Zhu dd82fd234f
Merge branch 'release/2.4.4' into mergeback/2.4.4 2022-10-08 22:15:09 -04:00
tusooa 59b8c920f6 Merge branch 'release/2.4.4' into 'stable'
Release/2.4.4

See merge request pleroma/pleroma!3761
2022-10-09 02:05:27 +00:00
marcin mikołajczak 1b238a4fad Push.Impl: support edits
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-10-01 23:28:02 +02:00
Mark Felder 1958f23fe7 Fix deprecation warning for Gun timeout 2022-09-30 12:22:06 -04:00
Haelwenn 3f1c31b7cd Merge branch 'fix/exclude-deactivated-in-search' into 'develop'
User: search: exclude inactive users from user search

See merge request pleroma/pleroma!3755
2022-09-27 23:58:45 +00:00
Haelwenn d43d02bf41 Merge branch 'from/upstream-develop/tusooa/fix-static-tests' into 'develop'
Make instance document controller test sync

Closes #2940

See merge request pleroma/pleroma!3757
2022-09-27 21:50:43 +00:00
Haelwenn 757a21554f Merge branch 'from/upstream-develop/tusooa/2169-queue-limit' into 'develop'
Reduce incoming and outgoing federation queue sizes to 5

Closes #2169

See merge request pleroma/pleroma!3756
2022-09-27 21:50:06 +00:00
Haelwenn 5d7d623390 Merge branch 'bugfix/elixir-1.14' into 'develop'
Bugfix: Elixir 1.14

See merge request pleroma/pleroma!3740
2022-09-27 21:46:03 +00:00
Ilja 2d7ea263a1 Add extra routes to :users_manage_credentials privilege 2022-09-24 13:52:28 +02:00
Tusooa Zhu e66c02b775
Make instance document controller test sync 2022-09-20 12:34:10 -04:00
tusooa ac95b8b4f3 Merge branch 'websocketex' into 'develop'
Use Websockex to replace websocket_client

See merge request pleroma/pleroma!3743
2022-09-18 17:09:12 +00:00
Tusooa Zhu 467b6cad6f
Reduce incoming and outgoing federation queue sizes to 5 2022-09-17 16:34:33 -04:00
tusooa 1a7107f4a5 Merge branch 'remove_from_followers' into 'develop'
MastoAPI: POST /api/v1/accounts/:id/remove_from_followers

See merge request pleroma/pleroma!3647
2022-09-16 23:24:13 +00:00
a1batross 7f63b4c315 User: search: exclude deactivated users from user search
This way we don't pollute search results with deactivated and deleted users
2022-09-16 00:49:16 +03:00
Tusooa Zhu ea60c4e709
Fix wrong relationship direction 2022-09-14 20:24:04 -04:00
tusooa 90d4b7d604 Merge branch 'fix/user-factory-speed' into 'develop'
tests/Factory: improve user generation performance

See merge request pleroma/pleroma!3754
2022-09-12 00:53:14 +00:00
FloatingGhost 6bdf451ce8
Use set of pregenerated RSA keys
Randomness is a huge resource sink, so let's just use
a some that we made earlier
2022-09-11 21:33:20 +02:00
tusooa ac427de851 Merge branch 'fix/undo-boosts' into 'develop'
ObjectView: do not fetch an object for its ID

See merge request pleroma/pleroma!3753
2022-09-11 17:10:26 +00:00
Hélène 0b19625bfb
ObjectView: do not fetch an object for its ID
Non-Create/Listen activities had their associated object field
normalized and fetched, but only to use their `id` field, which is both
slow and redundant. This also failed on Undo activities, which delete
the associated object/activity in database.

Undo activities will now render properly and database loads should
improve ever so slightly.
2022-09-11 04:54:04 +02:00
Tusooa Zhu 50923f5438
Fix User.get_or_fetch/1 with usernames starting with http 2022-09-08 11:58:17 -04:00
Haelwenn 453a66f8c2 Merge branch 'weblate-extract' into 'develop'
Extract translatable strings

See merge request pleroma/pleroma!3748
2022-09-06 17:17:40 +00:00
weblate-extractor 3d32c92b37 Extract translatable strings 2022-09-06 16:45:08 +00:00
tusooa c0b265b404 Merge branch 'birthday-config-description' into 'develop'
Clarify `birthday_min_age` config description

See merge request pleroma/pleroma!3747
2022-09-06 12:40:02 +00:00
marcin mikołajczak c6bc523914 Clarify `birthday_min_age` config description
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-09-05 20:25:01 +02:00
Haelwenn b8d6cb5845 Merge branch 'from/upstream-develop/tusooa/2892-backup-scope' into 'develop'
Make backups require its own scope

Closes #2892

See merge request pleroma/pleroma!3721
2022-09-05 15:42:02 +00:00
Haelwenn 346c130ddc Merge branch 'fix/user-private-key-generation' into 'develop'
User: generate private keys on user creation

See merge request pleroma/pleroma!3737
2022-09-05 15:38:15 +00:00
tusooa f7c2073103 Merge branch 'bump/min-elixir-1.10' into 'develop'
Bump minimum Elixir version to 1.10

See merge request pleroma/pleroma!3741
2022-09-05 15:19:34 +00:00
tusooa 9874b4c985 Merge branch 'develop' into 'from/upstream-develop/tusooa/2892-backup-scope'
# Conflicts:
#   CHANGELOG.md
2022-09-05 15:00:19 +00:00
Hélène cfb1bc967f
Migrations: generate unset user keys
User keys are now generated on user creation instead of "when needed",
to prevent race conditions in federation and a few other issues. This
migration will generate keys missing for local users.
2022-09-05 03:51:35 +02:00
Hélène cd237d22f1
User: generate private keys on user creation
This fixes a race condition bug where keys could be regenerated
post-federation, causing activities and HTTP signatures from an user to
be dropped due to key differences.
2022-09-05 03:51:17 +02:00
tusooa f8afba95b2 Merge branch 'fix/gts-federation' into 'develop'
GoToSocial federation fixes

See merge request pleroma/pleroma!3725
2022-09-05 01:10:34 +00:00
tusooa 20347898e2 Merge branch 'fix/federation-context-issues' into 'develop'
Fix reply context fixing (Pleroma replies to Misskey threads) and removal of context objects

See merge request pleroma/pleroma!3717
2022-09-04 18:43:36 +00:00
Haelwenn c63cf954de Merge branch 'from/upstream-develop/tusooa/streaming-fix' into 'develop'
Streaming fix

Closes #2796

See merge request pleroma/pleroma!3738
2022-09-03 18:24:28 +00:00
tusooa 71839cb890 Merge branch 'changes/embed-metadata' into 'develop'
Metadata/Utils: use summary as description if set

Closes #2491

See merge request pleroma/pleroma!3733
2022-09-03 16:21:08 +00:00
Haelwenn (lanodan) Monnier 80a2528fd1 ci-base: Document building and pushing a new image 2022-09-03 18:19:58 +02:00
Hélène 4477c6baff
Metadata/Utils: use summary as description if set
When generating OpenGraph and TwitterCard metadata for a post, the
summary field will be used first if it is set to generate the post
description.
2022-09-03 17:17:48 +02:00
Haelwenn 257601d67d Merge branch 'ssh-bbs-improvements' into 'develop'
BBS: add functionnalities and readability

See merge request pleroma/pleroma!3675
2022-09-03 11:15:07 +00:00
Haelwenn (lanodan) Monnier be411ad3bc Test coverage: Switch to covertool to get cobertura output
This allows to have coverage information integrated into Gitlab
2022-09-03 05:03:50 +02:00
Tusooa Zhu d19696cf60
Lint 2022-09-02 22:58:35 -04:00
Haelwenn 299255b9bb Merge branch 'from/upstream-develop/tusooa/assoc-object-id' into 'develop'
Add function to calculate associated object id

Closes #2307

See merge request pleroma/pleroma!3692
2022-09-03 02:50:40 +00:00
Haelwenn e40c221c31 Merge branch 'from/upstream-develop/tusooa/edits' into 'develop'
Editing

Closes #1429, #2859, and #2288

See merge request pleroma/pleroma!3678
2022-09-03 02:16:42 +00:00
Haelwenn 07ef72f493 Merge branch 'from/develop/tusooa/2807-remote-xact-post' into 'develop'
Remote interaction with posts

Closes #2807 and #978

See merge request pleroma/pleroma!3587
2022-09-03 02:03:48 +00:00
Haelwenn (lanodan) Monnier ec80a1e405 Bump minimum Elixir version to 1.10
1.9 being end-of-life
2022-09-03 03:58:22 +02:00
Haelwenn (lanodan) Monnier 24af2e1c58 script_test: Fix %ErlangError for Elixir 1.14 2022-09-03 03:58:22 +02:00
Haelwenn (lanodan) Monnier e124776d14 Elixir 1.14 formatting 2022-09-03 03:58:22 +02:00
Haelwenn (lanodan) Monnier 93ed6da4a3 mix: Switch prometheus_ex to fix/elixir-1.14 branch 2022-09-03 03:58:22 +02:00
Haelwenn (lanodan) Monnier 2f301bbb87 timeline_controller_test: Fix test name for elixir 1.14 2022-09-03 03:58:22 +02:00
Tusooa Zhu 6d148b6637 Use Websockex to replace websocket_client 2022-09-03 02:13:00 +02:00
Haelwenn 0a05ebf789 Merge branch 'revert-01239456' into 'develop'
Revert "Merge branch 'rewrite/integration-test-websocket-client' into 'develop'"

See merge request pleroma/pleroma!3742
2022-09-02 23:58:02 +00:00
Haelwenn b439e91f57 Revert "Merge branch 'rewrite/integration-test-websocket-client' into 'develop'"
This reverts merge request !3649
2022-09-02 22:35:40 +00:00
Haelwenn e22a772240 Merge branch 'weblate' into 'develop'
Translations update from Pleroma Weblate

See merge request pleroma/pleroma!3735
2022-09-02 22:10:44 +00:00
Haelwenn (lanodan) Monnier 21ab7369ca Bump minimum Elixir version to 1.10
With the release of Elixir 1.14, Elixir 1.9 is now end-of-life.

Elixir 1.10 Release Notes:
https://github.com/elixir-lang/elixir/releases/tag/v1.10.0
2022-09-02 22:53:54 +02:00
Fristi 0d8c6b0488 Translated using Weblate (Dutch)
Currently translated at 63.8% (30 of 47 strings)

Translation: Pleroma/Pleroma Backend (domain posix_errors)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-posix_errors/nl/
2022-09-02 19:18:40 +00:00
Fristi 9af5da6666 Translated using Weblate (Dutch)
Currently translated at 100.0% (83 of 83 strings)

Translation: Pleroma/Pleroma Backend (domain static_pages)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-static_pages/nl/
2022-09-02 19:18:40 +00:00
Fristi 425fbce7be Translated using Weblate (Dutch)
Currently translated at 100.0% (106 of 106 strings)

Translation: Pleroma/Pleroma Backend (domain errors)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-errors/nl/
2022-09-02 19:18:40 +00:00
Fristi a6195c7127 Added translation using Weblate (Dutch) 2022-09-02 19:18:40 +00:00
Fristi e949378476 Added translation using Weblate (Dutch) 2022-09-02 19:18:40 +00:00
Haelwenn 01239456a1 Merge branch 'rewrite/integration-test-websocket-client' into 'develop'
Rewrite integration-test websocket client with Mint.WebSocket, closes #2812

Closes #2812

See merge request pleroma/pleroma!3649
2022-09-02 19:18:22 +00:00
Tusooa Zhu c32e28e1b0
Fix SideEffectsTest 2022-09-01 07:33:58 -04:00
Tusooa Zhu 20a0dd6516
Exclude Announce instead of restricting to Create in visibility_tags 2022-08-31 22:14:54 -04:00
Tusooa Zhu ffd379456b
Do not stream out Announces to public timelines 2022-08-31 15:57:06 -04:00
Tusooa Zhu f9b86c3c22
Make local-only posts stream in local timeline 2022-08-27 19:34:56 -04:00
Tusooa Zhu 3afa1903ee
Do not stream out Create of ChatMessage 2022-08-27 17:51:41 -04:00
tusooa 497cd5d5da Merge branch 'fix/fedi-fe-build-url' into 'develop'
Fix fedi-fe build URL, addresses #2920

See merge request pleroma/pleroma!3736
2022-08-27 01:13:03 +00:00
tusooa a546e6f042 Merge branch 'feature/emoji-15-support' into 'develop'
emoji-test: update to latest 15.0 draft

See merge request pleroma/pleroma!3726
2022-08-27 00:59:22 +00:00
tusooa 780fb4514d Merge branch 'from/upstream-develop/tusooa/static-page-styles' into 'develop'
Improve static page style

See merge request pleroma/pleroma!3729
2022-08-27 00:58:18 +00:00
tusooa 84a573877a Merge branch 'fix_erratic_tests' into 'develop'
Fix flaky rate_limiter_test.exs test "it restricts based on config values"

See merge request pleroma/pleroma!3688
2022-08-25 18:39:38 +00:00
tusooa 6811237ffd Merge branch 'fix_flaky_transfer_task_test.exs' into 'develop'
Fix flaky/erratic test/pleroma/config/transfer_task_test.exs

See merge request pleroma/pleroma!3703
2022-08-25 18:38:18 +00:00
tusooa 6f10f93d62 Merge branch 'fix_erratic_participation_test' into 'develop'
fix flaky participation_test.exs

See merge request pleroma/pleroma!3689
2022-08-25 18:36:47 +00:00
Ilja dc72a523c4 fix flaky participation_test.exs 2022-08-25 18:36:46 +00:00
Sean King d67d191344
Fix fedi-fe build URL 2022-08-24 23:39:02 -06:00
tusooa 8ec985eea1 Merge branch 'fix_flaky_filter_controller_test.exs_200' into 'develop'
fix flaky test filter_controller_test.exs:200

See merge request pleroma/pleroma!3699
2022-08-24 15:24:57 +00:00
Ilja 5b2e3a303c fix flaky test filter_controller_test.exs:200 2022-08-24 15:24:57 +00:00
tusooa 59109f8f74 Merge branch 'fix_flaky_test_user_relationship_test.exs_81' into 'develop'
fix flaky test_user_relationship_test.exs:81

See merge request pleroma/pleroma!3697
2022-08-24 15:24:07 +00:00
Ilja 47e3a72b6e fix flaky test_user_relationship_test.exs:81 2022-08-24 15:24:07 +00:00
tusooa 85c1e1ff4d Merge branch 'fix/oauth-token-user-caching' into 'develop'
OAuthPlug: use user cache instead of joining

See merge request pleroma/pleroma!3734
2022-08-24 15:23:20 +00:00
tusooa 38d9ec41be Merge branch 'add/glitch-lily-fe' into 'develop'
Add glitch-lily as an installable frontend

See merge request pleroma/pleroma!3727
2022-08-24 12:18:02 +00:00
Hélène 439c1baf25
OAuthPlug: use user cache instead of joining
As this plug is called on every request, this should reduce load on the
database by not requiring to select on the users table every single
time, and to instead use the by-ID user cache whenever possible.
2022-08-24 03:40:05 +02:00
Tusooa Zhu c59a0bd12f
Add margin to forms and make inputs fill whole width 2022-08-20 21:52:20 -04:00
tusooa a022b9d733 Merge branch 'from/upstream-develop/tusooa/alpine-bump' into 'develop'
Use latest alpine version for docker image

See merge request pleroma/pleroma!3719
2022-08-21 01:25:25 +00:00
Tusooa Zhu c59ee1f172
Expose availability of GET /main/ostatus via instance 2022-08-20 21:19:31 -04:00
Tusooa Zhu 4ec9eeb3f8
Make remote interaction page translatable 2022-08-20 21:14:26 -04:00
Tusooa Zhu ec0e912c52
Add changelog 2022-08-20 21:14:25 -04:00
Tusooa Zhu 1218adacc5
Display status link in remote interaction form 2022-08-20 21:13:52 -04:00
Tusooa Zhu b7c75db0f7
Lint 2022-08-20 21:13:51 -04:00
Tusooa Zhu 779457d9a4
Add GET endpoints for remote subscription forms
There are two reasons for adding a GET endpoint:

0: Barely displaying the form does not change anything on the server.

1: It makes frontend development easier as they can now use a link,
instead of a form, to allow remote users to interact with local ones.
2022-08-20 21:13:51 -04:00
Tusooa Zhu a243a217a7
Fix form item name in status_interact.html 2022-08-20 21:13:51 -04:00
Tusooa Zhu 2701628786
Add remote interaction ui for posts 2022-08-20 21:13:51 -04:00
Tusooa Zhu f047088a93
Update thread visibility function 2022-08-20 21:06:12 -04:00
Tusooa Zhu 4e7ed563c0
Lint 2022-08-20 20:43:47 -04:00
Tusooa Zhu 3885ee182a
Switch to associated_object_id index 2022-08-20 20:43:46 -04:00
Tusooa Zhu 06678fb4ad
Add function to calculate associated object id 2022-08-20 20:43:40 -04:00
Sean King cc0f32c253
Add glitch-lily as an installable frontend 2022-08-19 22:54:56 -06:00
Tusooa Zhu 31fd41de0c
Release 2.4.4 2022-08-19 20:29:06 -04:00
Tusooa Zhu 5a2c8ef4cc
Refactor streamer test 2022-08-19 20:24:24 -04:00
Tusooa Zhu a31d6bb52c
Execute session disconnect in background 2022-08-19 20:24:24 -04:00
Tusooa Zhu f459c1260b
Lint 2022-08-19 20:24:24 -04:00
Tusooa Zhu 3522852c61
Test that server will disconnect websocket upon token revocation 2022-08-19 20:24:24 -04:00
Tusooa Zhu eb42e90c4f
Use Websockex to replace websocket_client 2022-08-19 20:24:21 -04:00
Tusooa Zhu c62a4f1c17
Disconnect streaming sessions when token is revoked 2022-08-19 20:22:45 -04:00
feld 6ccab516a3 Merge branch 'varnish-fix-changelog' into 'develop'
Document the changes for Varnish 7.0+ compatibility and RFC compliance

See merge request pleroma/pleroma!3723
2022-08-19 22:41:42 +00:00
Hélène 0cee3c6e93
emoji-test: update to latest 15.0 draft 2022-08-20 00:21:07 +02:00
Hélène 4661b56720
ArticleNotePageValidator: fix replies fixing
Some software, like GoToSocial, expose replies as ActivityPub
Collections, but do not expose any item array directly in the object,
causing validation to fail via the ObjectID validator. Now, Pleroma will
drop that field in this situation too.
2022-08-19 02:45:49 +02:00
Hélène 61254111e5
HttpSignaturePlug: accept standard (request-target)
The (request-target) used by Pleroma is non-standard, but many HTTP
signature implementations do it this way due to a misinterpretation of
the draft 06 of HTTP signatures: "path" was interpreted as not having
the query, though later examples show that it must be the absolute path
with the query part of the URL as well.

This behavior is kept to make sure most software (Pleroma itself,
Mastodon, and probably others) do not break, but Pleroma now accepts
signatures for a (request-target) containing the query, as expected by
many HTTP signature libraries, and clarified in the draft 11 of HTTP
signatures.

Additionally, the new draft renamed (request-target) to @request-target.
We now support both for incoming requests' signatures.
2022-08-18 17:01:34 +02:00
FloatingGhost f41d970a59
fix resolution of GTS user keys 2022-08-16 18:51:34 +02:00
Hélène 88c1c76d3e
Migrations: delete contexts with BaseMigrator
Due to the lengthiness of this task, the migration has been adapted into
a BaseMigrator migration, running in the background instead.
2022-08-15 01:47:09 +02:00
Hélène bb02ee99f5
CommonFixes: more predictable context generation
`context` fields for objects and activities can now be generated based
on the object/activity `inReplyTo` field or its ActivityPub ID, as a
fallback method in cases where `context` fields are missing for incoming
activities and objects.
2022-08-15 01:46:55 +02:00
Mark Felder 80c32ae00b Document the changes for Varnish 7.0+ compatibility and RFC compliance 2022-08-12 15:06:45 -04:00
Haelwenn 06f9324afe Merge branch 'from/upstream-develop/tusooa/2912-receiver-reject-mrf' into 'develop'
Treat MRF rejects as success in Oban worker

Closes #2912

See merge request pleroma/pleroma!3720
2022-08-12 01:37:40 +00:00
Haelwenn 837d4dc87f Merge branch 'fix_flaky_tests_where_we_sometimes_loose_db_connections' into 'develop'
Fix flaky tests with DB connections; Allow higher amount of restarts for Pleroma.Repo during testing

See merge request pleroma/pleroma!3696
2022-08-12 01:36:11 +00:00
Haelwenn 93f12c0d0d Merge branch 'from/upstream-develop/tusooa/sync-settings' into 'develop'
Synchronized settings for apps (frontends)

See merge request pleroma/pleroma!3698
2022-08-12 01:34:36 +00:00
Haelwenn 6ce3f76b5d Merge branch 'from/upstream-develop/floatingghost/follow-state' into 'develop'
Backport: bugfix/follow-state

Closes #2902

See merge request pleroma/pleroma!3718
2022-08-12 01:32:20 +00:00
feld 514caed573 Merge branch 'fix-varnish7-support' into 'develop'
Fix Varnish7 support

See merge request pleroma/pleroma!3722
2022-08-11 15:14:16 +00:00
Mark Felder 73b4d0d9a7 Fix the mocks to use uppercase as well 2022-08-10 21:46:56 +00:00
Mark Felder 243ed7d60f Update the recommended VCL configuration 2022-08-10 17:18:06 -04:00
Mark Felder cbdc13b767 Fix Varnish 7 support by ensuring Media Preview Proxy fetches headers with a capitalized HEAD verb 2022-08-10 17:09:58 -04:00
Hélène 3b6784b1de
CreateGenericValidator: fix reply context fixing
Incoming Pleroma replies to a Misskey thread were rejected due to a
broken context fix, which caused them to not be visible until a
non-Pleroma user interacted with the replies.

This fix properly sets the post-fix object context to its parent Create
activity as well, if it was changed.
2022-08-10 02:29:38 +02:00
Hélène c559c240d1
Migrations: delete context objects
These objects represent from 30 to 70% of the rows on the objects table,
based on numbers from a few live instances (single-user, small, large.)

As those pseudo-objects prevent creating objects with those actual IDs,
deleting them is a better solution. This could have happened if an
object used another object's ID as its context.
2022-08-10 02:29:38 +02:00
Hélène def0f5dc2e
StatusView: implement pleroma.context field
This field replaces the now deprecated conversation_id field, and now
exposes the ActivityPub object `context` directly via the MastoAPI
instead of relying on StatusNet-era data concepts.
2022-08-10 02:29:38 +02:00
Tusooa Zhu e06f2b9f5e
Add changelog 2022-08-09 18:17:07 -04:00
Tusooa Zhu 738ca484fd
Update api spec to reflect OAuth scope change 2022-08-09 18:15:25 -04:00
Hélène a9111bcaf2
StatusView: clear MSB on calculated conversation_id
This field seems to be a left-over from the StatusNet era.
If your application uses `pleroma.conversation_id`: this field is
deprecated.

It is currently stubbed instead by doing a CRC32 of the context, and
clearing the MSB to avoid overflow exceptions with signed integers on
the different clients using this field (Java/Kotlin code, mostly; see
Husky and probably other mobile clients.)

This should be removed in a future version of Pleroma. Pleroma-FE
currently depends on this field, as well.
2022-08-09 20:10:43 +02:00
Hélène 7f71e3d0fe
CommonFields: remove context_id 2022-08-09 20:10:43 +02:00
Hélène f3e061c964
Object: remove context_id field
30 to 70% of the objects in the object table are simple JSON objects
containing a single field, 'id', being the context's ID. The reason for
the creation of an object per context seems to be an old relic from the
StatusNet era, and has only been used nowadays as an helper for threads
in Pleroma-FE via the `pleroma.conversation_id` field in status views.
An object per context was created, and its numerical ID (table column)
was used and stored as 'context_id' in the object and activity along
with the full 'context' URI/string.

This commit removes this field and stops creation of objects for each
context, which will also allow incoming activities to use activity IDs
as contexts, something which was not possible before, or would have been
very broken under most circumstances.

The `pleroma.conversation_id` field has been reimplemented in a way to
maintain backwards-compatibility by calculating a CRC32 of the full
context URI/string in the object, instead of relying on the row ID for
the created context object.
2022-08-09 20:10:43 +02:00
Tusooa Zhu a7f01ffc1d
Make backups require its own scope 2022-08-09 00:34:04 -04:00
Tusooa Zhu d487e0160c
Treat containment failure as cancel in ReceiverWorker 2022-08-08 08:41:33 -04:00
Ilja b53cf7d4b3 Change default moderator privileges to better match what we previously had
Moderators were able to delete statusses via pleroma-fe. For that reason I now gave them :messages_delete by default.

They are also able to recieve reports through the notifications. For that reason I now gave them :reports_manage_reports by default.

They were also able to see deactivated accounts through pleroma-fe. However
* they were unable to tell if the account is deactivated or not (which was a bug and fixed by thes privileges MR this commit is part of)
* they were not able to actually change the activation state.
Because of this, I decided to *not* give them the privilege :users_manage_activation_state as this would give significantly more
privileges, while not giving it will actually improve the current experience as it works around the existing bug of not showing activation state.
2022-08-07 07:22:33 +02:00
Tusooa Zhu 88e0e6acd5
Fix FederatorTest 2022-08-06 00:42:10 -04:00
Tusooa Zhu a0166e92fa
Treat MRF rejects as success in Oban worker 2022-08-06 00:33:18 -04:00
Tusooa Zhu 5d900a5cd1
Use latest alpine version for docker image 2022-08-05 23:47:53 -04:00
floatingghost f2a9285ff0
bugfix/follow-state (#104)
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/104
2022-08-03 01:07:53 -04:00
Tusooa Zhu a4fa286d20
Use actor_types() to determine whether the Update is for user 2022-08-02 10:37:28 -04:00
Haelwenn b2ba307f4d Merge branch 'from/upstream-develop/tusooa/2871-fix-local-public' into 'develop'
local only fixes

Closes #2871

See merge request pleroma/pleroma!3660
2022-08-02 05:39:50 +00:00
Haelwenn 7299795eb4 Merge branch 'from/upstream-develop/tusooa/backup-without-email' into 'develop'
Allow users to create backups without providing email address

See merge request pleroma/pleroma!3665
2022-08-02 05:23:49 +00:00
Haelwenn f8540b0a9d Merge branch 'weblate' into 'develop'
Translations update from Pleroma Weblate

See merge request pleroma/pleroma!3716
2022-08-02 05:10:51 +00:00
Yating Zhan 99d4823ab1 Translated using Weblate (Chinese (Simplified))
Currently translated at 18.9% (189 of 998 strings)

Translation: Pleroma/Pleroma Backend (domain config_descriptions)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-config_descriptions/zh_Hans/
2022-07-31 22:00:56 +00:00
tusooa cc533e6956 Translated using Weblate (Chinese (Simplified))
Currently translated at 18.9% (189 of 998 strings)

Translation: Pleroma/Pleroma Backend (domain config_descriptions)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-config_descriptions/zh_Hans/
2022-07-31 22:00:56 +00:00
Haelwenn 7de21ec991 Merge branch 'from/develop/tusooa/emit-move' into 'develop'
Implement moving account

See merge request pleroma/pleroma!3524
2022-07-31 22:00:40 +00:00
Haelwenn 5ef2dc317d Change test case wording 2022-07-31 21:34:23 +00:00
tusooa c80096522c Merge branch 'develop' into 'from/develop/tusooa/emit-move'
# Conflicts:
#   CHANGELOG.md
#   test/pleroma/user_test.exs
2022-07-31 21:32:49 +00:00
Haelwenn b5266097a1 Merge branch 'mutes' into 'develop'
MastoAPI: Use `duration` param for mute expiration duration

See merge request pleroma/pleroma!3715
2022-07-31 19:41:25 +00:00
marcin mikołajczak 5d3d6a58f7 Use `duration` param for mute expiration duration
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-07-31 17:22:34 +02:00
Haelwenn 0814d0e0cb Merge branch 'fix/proper-emoji-qualification' into 'develop'
Emoji: implement full-qualifier using combinations

See merge request pleroma/pleroma!3709
2022-07-28 04:46:15 +00:00
Haelwenn 0f9f3d2897 Merge branch 'from/upstream-develop/tusooa/2384-pagination' into 'develop'
Make mutes and blocks behave the same as other lists

Closes #2384

See merge request pleroma/pleroma!3693
2022-07-28 04:37:10 +00:00
Haelwenn 18d6a58c7e Merge branch 'from/upstream-develop/tusooa/gettext-extract' into 'develop'
Extract translatable strings

See merge request pleroma/pleroma!3712
2022-07-28 04:33:17 +00:00
Hélène 7167de592e
Emoji: apply recommended tail call changes
Behavior matches previous code.

Co-authored-by: Tusooa Zhu <tusooa@kazv.moe>
2022-07-27 02:08:46 +02:00
Tusooa Zhu 4bdd8e349c
Extract translatable strings 2022-07-26 10:50:29 -04:00
tusooa 36d79468ec Merge branch 'authorized-fetch' into 'develop'
Add authorized_fetch_mode to description.exs

See merge request pleroma/pleroma!3710
2022-07-26 14:48:00 +00:00
Hélène b99f5d6183
Emoji: split qualification variation into a module 2022-07-26 02:04:12 +02:00
marcin mikołajczak 5153eba3a8 Add authorized_fetch_mode to description.exs
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-07-25 19:53:51 +02:00
Hélène fb3f6e1975
EmojiReactValidator: use new qualification method 2022-07-25 16:49:23 +02:00
Hélène 01d396585e
Emoji: implement full-qualifier using combinations
This implements fully_qualify_emoji/1, which will return the
fully-qualified version of an emoji if it knows of one, or return the
emoji unmodified if not.
This code generates combinations per emoji: for each FE0F, all possible
combinations of the character being removed or staying will be
generated. This is made as an attempt to find all partially-qualified
and unqualified versions of a fully-qualified emoji.

I have found *no cases* for which this would be a problem, after
browsing the entire emoji list in emoji-test.txt. This is safe, and,
sadly, most likely the sanest too.
2022-07-25 16:20:12 +02:00
tusooa d39f803bdd Merge branch 'fix/emoji-react-qualification' into 'develop'
EmojiReactValidator: fix emoji qualification

See merge request pleroma/pleroma!3708
2022-07-24 21:36:43 +00:00
Hélène 388bbc4978
EmojiReactValidator: fix emoji qualification
Tries fully-qualifying emoji when receiving them, by adding the emoji
variation sequence to the received reaction emoji.

This issue arises when other instance software, such as Misskey, tries
reacting with emoji that have unqualified or minimally qualified
variants, like a red heart. Pleroma only accepts fully qualified emoji
in emoji reactions, and refused those emoji. Now, Pleroma will attempt
to properly qualify them first, and reject them if checks still fail.

This commit contains changes to tests proposed by lanodan.

Co-authored-by: Haelwenn <contact+git.pleroma.social@hacktivis.me>
2022-07-24 13:36:06 +02:00
Tusooa Zhu 997f08b350
Make AntiLinkSpamPolicy history-aware 2022-07-24 00:18:09 -04:00
Tusooa Zhu d877d2a4e7
Make HashtagPolicy history-aware 2022-07-24 00:02:39 -04:00
Tusooa Zhu 82c8fc1ede
Make NoEmptyPolicy work with Update 2022-07-23 23:24:25 -04:00
Tusooa Zhu 46a5c06853
Make NormalizeMarkup history-aware 2022-07-23 22:50:38 -04:00
Tusooa Zhu fc7ce5f93c
Make NoPlaceholderTextPolicy history-aware 2022-07-23 22:41:04 -04:00
Tusooa Zhu dce7e42928
Make MediaProxyWarmingPolicy history-aware 2022-07-23 22:34:03 -04:00
Tusooa Zhu 0a337063e1
Make ForceMentionsInContent history-aware 2022-07-23 22:23:57 -04:00
Tusooa Zhu cd19537f39
Make EnsureRePrepended history-aware 2022-07-23 17:48:39 -04:00
Tusooa Zhu eba9b0760f
Make MRF Keyword history-aware 2022-07-23 15:56:36 -04:00
tusooa 301ce5bc62 Merge branch 'mute-expiration' into 'develop'
MastoAPI: Show mutes expiration date

See merge request pleroma/pleroma!3682
2022-07-23 00:34:15 +00:00
Haelwenn 21e587ff1a Merge branch 'revert-454f892f' into 'develop'
Revert "Merge branch 'fix/emoji-react-qualification' into 'develop'"

See merge request pleroma/pleroma!3707
2022-07-22 23:56:52 +00:00
Haelwenn cfb21d011f Revert "Merge branch 'fix/emoji-react-qualification' into 'develop'"
This reverts merge request !3684
2022-07-22 23:19:49 +00:00
Haelwenn e077da27fe Merge branch 'weblate' into 'develop'
Translations update from Pleroma Weblate

See merge request pleroma/pleroma!3705
2022-07-22 22:46:37 +00:00
Haelwenn c057ec6878 Translated using Weblate (French)
Currently translated at 100.0% (34 of 34 strings)

Translation: Pleroma/Pleroma Backend (domain default)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-default/fr/
2022-07-22 19:00:37 +00:00
Yating Zhan 4217ac4074 Translated using Weblate (Chinese (Simplified))
Currently translated at 13.0% (130 of 998 strings)

Translation: Pleroma/Pleroma Backend (domain config_descriptions)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-config_descriptions/zh_Hans/
2022-07-22 19:00:37 +00:00
tusooa 1b091c7950 Translated using Weblate (Chinese (Simplified))
Currently translated at 13.0% (130 of 998 strings)

Translation: Pleroma/Pleroma Backend (domain config_descriptions)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-config_descriptions/zh_Hans/
2022-07-22 19:00:37 +00:00
Yating Zhan 0ad115ddf0 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.0% (102 of 103 strings)

Translation: Pleroma/Pleroma Backend (domain errors)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-errors/zh_Hans/
2022-07-22 19:00:37 +00:00
Yating Zhan a543161ba9 Translated using Weblate (Chinese (Simplified))
Currently translated at 88.2% (30 of 34 strings)

Translation: Pleroma/Pleroma Backend (domain default)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-default/zh_Hans/
2022-07-22 19:00:37 +00:00
Yating Zhan 2fffca8ef3 Translated using Weblate (Chinese (Simplified))
Currently translated at 82.9% (39 of 47 strings)

Translation: Pleroma/Pleroma Backend (domain posix_errors)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-posix_errors/zh_Hans/
2022-07-22 19:00:37 +00:00
tusooa 13e41ab8ba Translated using Weblate (Chinese (Simplified))
Currently translated at 82.9% (39 of 47 strings)

Translation: Pleroma/Pleroma Backend (domain posix_errors)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-posix_errors/zh_Hans/
2022-07-22 19:00:37 +00:00
tusooa ca8341a96c Translated using Weblate (Chinese (Simplified))
Currently translated at 11.8% (118 of 998 strings)

Translation: Pleroma/Pleroma Backend (domain config_descriptions)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-config_descriptions/zh_Hans/
2022-07-22 19:00:37 +00:00
Yating Zhan 5ca95a4f1a Translated using Weblate (Chinese (Simplified))
Currently translated at 11.8% (118 of 998 strings)

Translation: Pleroma/Pleroma Backend (domain config_descriptions)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-config_descriptions/zh_Hans/
2022-07-22 19:00:37 +00:00
tusooa aff4d5df1c Translated using Weblate (Chinese (Simplified))
Currently translated at 88.2% (30 of 34 strings)

Translation: Pleroma/Pleroma Backend (domain default)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-default/zh_Hans/
2022-07-22 19:00:37 +00:00
tusooa 48bd45acec Translated using Weblate (Chinese (Simplified))
Currently translated at 99.0% (102 of 103 strings)

Translation: Pleroma/Pleroma Backend (domain errors)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-errors/zh_Hans/
2022-07-22 19:00:37 +00:00
Haelwenn 0b2243f17e Translated using Weblate (French)
Currently translated at 100.0% (47 of 47 strings)

Translation: Pleroma/Pleroma Backend (domain posix_errors)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-posix_errors/fr/
2022-07-22 19:00:37 +00:00
Haelwenn 9399fd4abd Translated using Weblate (French)
Currently translated at 100.0% (34 of 34 strings)

Translation: Pleroma/Pleroma Backend (domain default)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-default/fr/
2022-07-22 19:00:37 +00:00
tusooa 54cf23f2f8 Translated using Weblate (Chinese (Simplified))
Currently translated at 3.3% (33 of 998 strings)

Translation: Pleroma/Pleroma Backend (domain config_descriptions)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-config_descriptions/zh_Hans/
2022-07-22 19:00:37 +00:00
tusooa 8b55661ae6 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (83 of 83 strings)

Translation: Pleroma/Pleroma Backend (domain static_pages)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-static_pages/zh_Hans/
2022-07-22 19:00:37 +00:00
Haelwenn 8c3684ee8c Added translation using Weblate (French) 2022-07-22 19:00:37 +00:00
Haelwenn bc488824f8 Added translation using Weblate (French) 2022-07-22 19:00:37 +00:00
Haelwenn 77ebde450e Translated using Weblate (French)
Currently translated at 32.3% (11 of 34 strings)

Translation: Pleroma/Pleroma Backend (domain default)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-default/fr/
2022-07-22 19:00:37 +00:00
tusooa 21bd168226 Translated using Weblate (Chinese (Simplified))
Currently translated at 1.6% (16 of 998 strings)

Translation: Pleroma/Pleroma Backend (domain config_descriptions)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-config_descriptions/zh_Hans/
2022-07-22 19:00:37 +00:00
Haelwenn 6da0b50645 Translated using Weblate (French)
Currently translated at 100.0% (83 of 83 strings)

Translation: Pleroma/Pleroma Backend (domain static_pages)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-static_pages/fr/
2022-07-22 19:00:37 +00:00
Haelwenn 37ea9e014a Added translation using Weblate (French) 2022-07-22 19:00:37 +00:00
Haelwenn 99ad602577 Added translation using Weblate (French) 2022-07-22 19:00:37 +00:00
tusooa cc40640f54 Translated using Weblate (Chinese (Simplified))
Currently translated at 0.5% (5 of 998 strings)

Translation: Pleroma/Pleroma Backend (domain config_descriptions)
Translate-URL: http://weblate.pleroma-dev.ebin.club/projects/pleroma/pleroma-backend-domain-config_descriptions/zh_Hans/
2022-07-22 19:00:37 +00:00
tusooa ffe8459349 Added translation using Weblate (Chinese (Simplified)) 2022-07-22 19:00:37 +00:00
Haelwenn 3b2bac7a0f Merge branch 'fix-owncast' into 'develop'
Fix owncast

See merge request pleroma/pleroma!3706
2022-07-22 19:00:23 +00:00
Haelwenn (lanodan) Monnier eba1666575 AttachmentValidator: fix_media_type/1 fallback to application/octet-stream 2022-07-22 20:30:45 +02:00
FloatingGhost 09e0304b9c Add test for broken owncast federation 2022-07-22 20:30:45 +02:00
Haelwenn (lanodan) Monnier be98900904 ArticleNotePageValidator: Fix when attachments are a Map (ie. owncast) 2022-07-22 20:30:45 +02:00
tusooa c589b8445f Merge branch 'birthday_fix' into 'develop'
Allow to unset birthday

See merge request pleroma/pleroma!3702
2022-07-21 21:27:16 +00:00
Haelwenn 454f892f37 Merge branch 'fix/emoji-react-qualification' into 'develop'
EmojiReactValidator: fix emoji qualification

See merge request pleroma/pleroma!3684
2022-07-21 17:45:47 +00:00
Tusooa Zhu 4350a205a4
Merge remote-tracking branch 'upstream/develop' into HEAD 2022-07-21 13:44:16 -04:00
Haelwenn 1f18ab36b5 Merge branch 'resolve/notice-compatibility-routes-nginx' into 'develop'
Document way to do notice compatibility routes with Nginx reverse-proxy, fixes #2900

Closes #2900

See merge request pleroma/pleroma!3701
2022-07-20 16:57:05 +00:00
Haelwenn fff7571e0d Merge branch 'fix-cycles' into 'develop'
CI: Remove cache on cycles

See merge request pleroma/pleroma!3704
2022-07-20 16:52:15 +00:00
Haelwenn (lanodan) Monnier 65a5c713e9 CI: Remove cache on cycles
cycles uses a different system than the rest of the testing_cache, creating errors like libcrypto.so.1 being missing
2022-07-20 17:49:56 +02:00
Ilja ba31af021c Fix flaky/erratic tests in Pleroma.Config.TransferTaskTest
There were async calls happening, so they weren't always finished when assert happened.
2022-07-20 13:26:26 +02:00
Ilja 9a6280cdb9 Fix warnings ":logger is used by the current application but the current application does not depend on :logger"
During compilation, we had the following warning which is now fixed

```
==> restarter
Compiling 1 file (.ex)
warning: Logger.__do_log__/4 defined in application :logger is used by the current application but the current application does not depend on :logger. To fix this, you must do one of:

  1. If :logger is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :logger is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :logger, you may optionally skip this warning by adding [xref: [exclude: [Logger]]] to your "def project" in mix.exs

Invalid call found at 2 locations:
  lib/pleroma.ex:65: Restarter.Pleroma.handle_cast/2
  lib/pleroma.ex:78: Restarter.Pleroma.handle_cast/2

warning: Logger.__should_log__/2 defined in application :logger is used by the current application but the current application does not depend on :logger. To fix this, you must do one of:

  1. If :logger is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :logger is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :logger, you may optionally skip this warning by adding [xref: [exclude: [Logger]]] to your "def project" in mix.exs

Invalid call found at 2 locations:
  lib/pleroma.ex:65: Restarter.Pleroma.handle_cast/2
  lib/pleroma.ex:78: Restarter.Pleroma.handle_cast/2

warning: Logger.debug/1 defined in application :logger is used by the current application but the current application does not depend on :logger. To fix this, you must do one of:

  1. If :logger is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :logger is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :logger, you may optionally skip this warning by adding [xref: [exclude: [Logger]]] to your "def project" in mix.exs

Invalid call found at 2 locations:
  lib/pleroma.ex:65: Restarter.Pleroma.handle_cast/2
  lib/pleroma.ex:78: Restarter.Pleroma.handle_cast/2
```
2022-07-20 13:26:26 +02:00
Sean King 3da1b2548d
Actually fix with forward slashes being restricted inside nickname 2022-07-18 21:30:57 -06:00
Hélène 1a67a20364 Apply ilja's suggestion(s) to 1 file(s) 2022-07-18 05:40:24 +00:00
Hélène f9fc3a153d Apply ilja's suggestion(s) to 1 file(s) 2022-07-18 05:40:10 +00:00
Hélène ce0a6737e7 Apply ilja's suggestion(s) to 1 file(s) 2022-07-18 05:40:02 +00:00
Hélène 97e8c8a10a Apply ilja's suggestion(s) to 1 file(s) 2022-07-18 05:39:26 +00:00
Hélène d24d74b1a7 Apply ilja's suggestion(s) to 1 file(s) 2022-07-18 05:39:21 +00:00
Hélène db789acf1e Apply ilja's suggestion(s) to 1 file(s) 2022-07-18 05:39:11 +00:00
Hélène d622fe8d48 Apply ilja's suggestion(s) to 1 file(s) 2022-07-18 05:39:03 +00:00
Hélène 02b4b4da47 Apply ilja's suggestion(s) to 1 file(s) 2022-07-18 05:38:45 +00:00
Hélène 02947bafeb Apply ilja's suggestion(s) to 1 file(s) 2022-07-18 05:38:30 +00:00
Hélène ad730c2135 Apply ilja's suggestion(s) to 1 file(s) 2022-07-18 05:38:23 +00:00
Hélène 2baf3084a1 Apply ilja's suggestion(s) to 1 file(s) 2022-07-18 05:38:01 +00:00
Hélène 92da9c4a47 Apply ilja's suggestion(s) to 1 file(s) 2022-07-18 05:37:41 +00:00
Hélène 275c60208b Apply ilja's suggestion(s) to 1 file(s) 2022-07-18 05:37:27 +00:00
Sean King 2c7eed122e
Don't accept forward slash character for nicknames 2022-07-17 12:50:01 -06:00
marcin mikołajczak fb268c4378 Allow to unset birthday
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-07-17 19:46:29 +02:00
Haelwenn 3193f18cf3 Merge branch 'shrink-ci' into 'develop'
Shrink CI

See merge request pleroma/pleroma!3691
2022-07-17 17:34:47 +00:00
Haelwenn bb4860e222 Merge branch 'from/upstream-develop/tusooa/config-translatable' into 'develop'
Translatable config descriptions

Closes pleroma-meta#65

See merge request pleroma/pleroma!3695
2022-07-17 17:34:21 +00:00
Sean King 64e16e6a4b
Document way to do notice compatibility routes with Nginx reverse-proxy instead 2022-07-16 23:44:37 -06:00
tusooa 8aba7c08d1 Merge branch 'notification_types' into 'develop'
MastoAPI: Use `types` for filtering notifications

See merge request pleroma/pleroma!3648
2022-07-17 03:17:43 +00:00
tusooa eb4b7f6efa Merge branch 'docs__setting_up_a_gitlab_runner' into 'develop'
DOCS: Add some small piece about setting up a Gitlab-runner

See merge request pleroma/pleroma!3694
2022-07-17 02:36:28 +00:00
marcin mikołajczak 597f56b4c4 Use :utc_datetime
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-07-16 16:28:22 +02:00
Tusooa Zhu 8113dd31ee
Add api docs for settings endpoint 2022-07-16 01:27:16 -04:00
Tusooa Zhu 8371fd8ca2
Implement settings api 2022-07-16 01:20:25 -04:00
Tusooa Zhu 1d7e8d6e01
Pass in msgctxt for config translation strings 2022-07-14 17:41:33 -04:00
floatingghost 28626eafc1 Allow higher amount of restarts for Pleroma.Repo during testing
This was done by floatingghost as part of a bigger commit in Akkoma.
See <37ae047e16/lib/pleroma/application.ex (L83)>.

As explained in <https://ihatebeinga.live/objects/860d23e1-dc64-4b07-8b4d-020b9c56cff6>

> there are so many caches that clearing them all can nuke the supervisor, which by default will become an hero if it gets more than 3 restarts in <5 seconds

And further down the thread

> essentially we've got like 11 caches (37ae047e16/lib/pleroma/application.ex (L165))
> then in test we fetch them all (https://akkoma.dev/AkkomaGang/akkoma/src/branch/develop/test/support/data_case.ex#L50) and call clear on them
> so if this clear fails on any 3 of them, the pleroma supervisor itself will die

How it fails?

> idk maybe cachex dies, maybe :ets does a weird thing
> it doesn't log anything, it just consistently dies during cache clearing so i figured it had to be that

> honestly my best bet is locksmith and queuing
> https://github.com/whitfin/cachex/blob/master/lib/cachex/actions/clear.ex#L26
> clear is thrown into a locksmith transaction

> locksmith says
> >If the process is already in a transactional context, the provided function will be executed immediately. Otherwise the required keys will be locked until the provided function has finished executing.

> so if we get 2 clears too close together, maybe it locks, then doesn't like the next clear?
2022-07-14 13:50:44 +02:00
Ilja c045a49909 Add privilege for announcements 2022-07-14 08:40:26 +02:00
Ilja 44d14e8a9c Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma into fine_grained_moderation_privileges 2022-07-14 07:07:19 +02:00
tusooa 3fb9171694 Merge branch 'from/upstream-develop/tusooa/zh-translation' into 'develop'
Translate static_pages.po (Simplified Chinese)

See merge request pleroma/pleroma!3655
2022-07-13 23:39:46 +00:00
Tusooa Zhu 074a94e90d
Extract translatable strings 2022-07-13 18:57:57 -04:00
Tusooa Zhu 7473868880
Fix compile error 2022-07-13 18:46:21 -04:00
Tusooa Zhu 20588517fc
Make admin api use translated config descriptions 2022-07-13 18:31:35 -04:00
Tusooa Zhu 36f6d92d98
Add tests for translator compiler 2022-07-13 18:31:01 -04:00
Tusooa Zhu b2a0718e83
Extract config descriptions for translation 2022-07-13 18:01:47 -04:00
marcin mikołajczak 9022d855cd Check refute User.following?
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-07-13 22:57:42 +02:00
Ilja 8ddea16b0d DOCS: Add some small piece about setting up a Gitlab-runner
This is based on me setting one up, but I kept it general with mostly linking to other documentation.
The idea is that to just provide some Pleroma-specific info, maybe give some pointers, and point to the right (external) docs.
2022-07-13 20:54:24 +02:00
tusooa fdc71f6051 Merge branch 'short-description' into 'develop'
Add short_description instance field

Closes #2865

See merge request pleroma/pleroma!3651
2022-07-13 04:42:24 +00:00
Tusooa Zhu eb2a1652bf
Add tests for short_description 2022-07-13 00:40:46 -04:00
Tusooa Zhu c1874bc8f9
Make mutes and blocks behave the same as other lists 2022-07-12 19:03:18 -04:00
Haelwenn (lanodan) Monnier 12d888e04e CI: cycles: Use current stable elixir image 2022-07-12 13:13:24 +02:00
Haelwenn (lanodan) Monnier 6e158bba2c CI: template for change policies based on build stage 2022-07-12 12:13:34 +02:00
Haelwenn (lanodan) Monnier e574408b33 CI: Run stages when .gitlab-ci.yml changes 2022-07-11 10:15:18 +02:00
Haelwenn (lanodan) Monnier 702a41ce23 CI: Run lint and cycles in alpine 2022-07-11 10:12:18 +02:00
Haelwenn (lanodan) Monnier 08c8814ef0 CI: Run postgres services in alpine 2022-07-11 09:29:18 +02:00
tusooa 311fda32f3 Merge branch 'fix/case-sensitivity-restricted-nicknames-blacklisted-domains' into 'develop'
Make checking blacklisted domains and restricted nicknames case-insensitive

Closes #2894 and #2888

See merge request pleroma/pleroma!3687
2022-07-11 04:04:36 +00:00
Tusooa Zhu 8bb2e52d2e
Make lint happy 2022-07-10 23:43:49 -04:00
Haelwenn 420da14b61 Merge branch 'from/upstream-develop/tusooa/2830-remote-fo-mp' into 'develop'
Pass remote follow avatar into media proxy

Closes #2830

See merge request pleroma/pleroma!3690
2022-07-10 16:19:16 +00:00
Sean King 3cf6c2b7ea
Use is_binary instead of is_bitstring for restricted nicknames tests 2022-07-09 23:39:35 -06:00
Tusooa Zhu 2efc0ffcf0
Pass remote follow avatar into media proxy 2022-07-10 00:12:53 -04:00
Tusooa Zhu 04ded94a50
Fix remote emoji in subject disappearing after edits 2022-07-09 18:00:42 -04:00
Ilja 26080b4b5c Fix rate_limiter_test.exs test "it restricts based on config values"
It used a timer to sleep.
But time also goes on when doing other things, so depending on hardware, the timings could be off.
I slightly changed the tests so we still test what we functionally want.
Instead of waiting until the cache expires I now have a function to expire the test and use that.

That means we're not testing any more if the cache really expires after a certain amount of time,
but that's the responsability of the dependency imo, so shouldn't be a problem.

I also changed `Pleroma.Web.Endpoint, :http, :ip` to `127.0.0.1` because that's the setting people typically have,
and I see no reason to do it differently.
Especially since it's an exernal ip, which may come over as weird or suspicious to people.
2022-07-09 07:19:18 +02:00
marcin mikołajczak 0b16ce79f9 Add test for rendering mute expiration date
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-07-08 20:59:58 +02:00
Tusooa Zhu 11a6e88420
Test that Question updates are viable 2022-07-07 15:22:04 -04:00
Tusooa Zhu 069554e925
Guard against outdated Updates
It is possible for an earlier Update to be received by us later.
For this, we now
(1) only allows Updates to poll counts if there is no updated field,
    or the updated field is the same as the last updated date or
    creation date;
(2) does not allow updating anything if the updated field
    is older than the last updated date or creation date;
(3) allows updating updatable fields otherwise (normal updates);
(4) if only the updated field is changed, it does not create
    a new history item on its own.
2022-07-07 15:11:29 -04:00
Sean King 6e7b919637
Make validation functions for restricted nicknames and blacklisted domains; do restricted nickname validation in LDAP account registration 2022-07-06 20:15:49 -06:00
Tusooa Zhu f84ed44cea
Fix cannot get full history on object fetch 2022-07-06 01:19:53 -04:00
Sean King 0d4aceb9b0
Make checking blacklisted domains and restricted nicknames case-insenstive 2022-07-05 20:36:47 -06:00
Ilja f88ed1df75 Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma into fine_grained_moderation_privileges 2022-07-05 12:05:19 +02:00
Ilja 6ef38c6523 Improve tests after code review 2022-07-05 08:57:50 +02:00
Haelwenn 29f4ab640b Merge branch 'from/upstream-develop/tusooa/report-too-long' into 'develop'
Fix long report notes giving errors on creation

See merge request pleroma/pleroma!3679
2022-07-04 05:21:20 +00:00
Haelwenn 8c78fef56f EmojiReactValidator: apply lanodan's suggestions
These changes make the encoding for the fully-qualified heart emoji very visible in editors.
2022-07-04 00:25:54 +00:00
Tusooa Zhu 5ce118d970
Validate object data for incoming Update activities
In Create validator we do not validate the object data,
but that is because the object itself will go through the
pipeline again, which is not the case for Update. Thus,
we added validation for objects in Update activities.
2022-07-03 20:21:46 -04:00
Tusooa Zhu 4367489a3e
Pass history items through ObjectValidator for updatable object types 2022-07-03 20:02:52 -04:00
Tusooa Zhu 4edc867b87 Merge branch 'develop' into 'from/upstream-develop/tusooa/edits'
# Conflicts:
#   lib/pleroma/constants.ex
2022-07-03 22:24:57 +00:00
Haelwenn c50ade26ba Merge branch 'fix/eblurhash-binaries' into 'develop'
mix: update eblurhash to 1.2.2

See merge request pleroma/pleroma!3686
2022-07-03 22:02:17 +00:00
Haelwenn eefa981e0a Merge branch 'indexing-hotspots' into 'develop'
Add index hotspots

See merge request pleroma/pleroma!3664
2022-07-03 22:01:37 +00:00
Haelwenn de37583c49 Merge branch 'image_description_from_exif_data' into 'develop'
Use EXIF data of image for image description

See merge request pleroma/pleroma!3535
2022-07-03 21:14:25 +00:00
Haelwenn a15b45a589 Merge branch 'bugfix/mime-validation-no-list' into 'develop'
Bugfix: Validate mediaType only by it's format

See merge request pleroma/pleroma!3597
2022-07-03 21:04:41 +00:00
Haelwenn 6b937d1473 Merge branch 'from/upstream-develop/tusooa/server-announcements' into 'develop'
Server announcements (1st pass)

See merge request pleroma/pleroma!3643
2022-07-03 20:58:20 +00:00
Hélène c3a0944ce5
mix: update eblurhash to 1.2.2
Previous eblurhash versions bundled precompiled binaries which caused
issues on non-Darwin operating systems.
2022-07-02 14:52:28 +02:00
Ilja 42d4bd3a5d Rename pipelines and add forgotten tags
I renamed some tags before, but forgot to rename the pipelines
I also had some tags which I forgot to add to the config, description, etc.

These have now been done/added
2022-07-02 08:55:14 +02:00
Ilja 15748fd301 Add better explanation in the Cheatsheet about what each tag does 2022-07-02 08:17:22 +02:00
Ilja 51f87ba30c Change order of privilege tags to make more sense
The tags were listed in different places
They were listed in a rather randomly order
I reordered them in a way I think makes more sense
2022-07-02 07:59:46 +02:00
Ilja c0e4b1b3e2 Fix typo's
priviledge |-> privilege
2022-07-02 07:52:39 +02:00
Ilja 56227ef7ba Descriptions from exif data with only whitespeces are considered empty
I noticed that pictures taken with Ubuntu-Touch have whitespace in one of the fields
This should just be ignored imo
2022-07-01 13:47:23 +02:00
Ilja 8c761942b1 update moduledoc 2022-07-01 12:15:02 +02:00
Ilja 4a9ed319b8 Change test pictures
The previous pictures were labeled as public domain, but are actually a collage of pictures under other licenses.

I now replaced them with a jpeg of simply a white pixel.
2022-07-01 12:15:02 +02:00
Ilja 7d234d097c Add option to docs about instance gen 2022-07-01 12:15:02 +02:00
Ilja 81afaee374 Better way of getting keys
I used keyword_list[:key], but if the key doesn't exist, it will return nil. I actually expect a list and further down the code I use that list.
I believe the key should always be present, but in case it's not, it's better to return an empty list instead of nil. That way the code wont fail further down the line.
2022-07-01 12:15:02 +02:00
Ilja 75ea766824 Migration failed when no value for Pleroma.Upload was set 2022-07-01 12:15:02 +02:00
Ilja cc5686bbd6 Migration for exiftool filter
Rename to Exiftool.StripLocation
2022-07-01 12:15:02 +02:00
Ilja d0d48a9e88 Add deprecation warnings 2022-07-01 12:15:02 +02:00
Ilja 8303af84ce Rename the Exiftool module
No migrations or checks yet
2022-07-01 12:15:02 +02:00
Ilja 551721e41a Rename the new module 2022-07-01 12:13:46 +02:00
Ilja cd316d7269 Use EXIF data of image to prefill image description
During attachment upload Pleroma returns a "description" field. Pleroma-fe has an MR to use that to pre-fill the image description field, <https://git.pleroma.social/pleroma/pleroma-fe/-/merge_requests/1399>

* This MR allows Pleroma to read the EXIF data during upload and return the description to the FE
    * If a description is already present (e.g. because a previous module added it), it will use that
    * Otherwise it will read from the EXIF data. First it will check -ImageDescription, if that's empty, it will check -iptc:Caption-Abstract
    * If no description is found, it will simply return nil, just like before
* When people set up a new instance, they will be asked if they want to read metadata and this module will be activated if so

This was taken from an MR i did on Pleroma and isn't finished yet.
2022-07-01 12:13:46 +02:00
Ilja 0d697bc15a Add docs and CHANGELOG entries 2022-07-01 10:50:32 +02:00
Ilja 37fdf148b0 Rename privilege tags
I first focussed on getting things working
Now that they do and we know what tags there are, I put some thought in providing better names

I use the form <what_it_controls>_<what_it_allows_you_to_do>

:statuses_read    => :messages_read
:status_delete    => :messages_delete

:user_read        => :users_read
:user_deletion    => :users_delete
:user_activation  => :users_manage_activation_state
:user_invite      => :users_manage_invites
:user_tag         => :users_manage_tags
:user_credentials => :users_manage_credentials

:report_handle    => :reports_manage_reports

:emoji_management => :emoji_manage_emoji
2022-07-01 10:28:09 +02:00
Hélène 11f9f2ef27
EmojiReactValidator: fix emoji qualification
Tries fully-qualifying emoji when receiving them, by adding the emoji
variation sequence to the received reaction emoji.

This issue arises when other instance software, such as Misskey, tries
reacting with emoji that have unqualified or minimally qualified
variants, like a red heart. Pleroma only accepts fully qualified emoji
in emoji reactions, and refused those emoji. Now, Pleroma will attempt
to properly qualify them first, and reject them if checks still fail.
2022-06-28 21:33:57 +02:00
Tusooa Zhu 014096aeef
Make outbound transmogrifier aware of edit history 2022-06-25 11:20:46 -04:00
Tusooa Zhu 5321fd0012
Do not put meta[:object_data] for local Updates 2022-06-25 10:03:19 -04:00
Tusooa Zhu 9c6dae942d
Fix local updates causing emojis to be lost 2022-06-25 09:23:09 -04:00
Tusooa Zhu e98579b1da
Verify that formerRepresentation provided in Update is used 2022-06-25 01:17:09 -04:00
Tusooa Zhu 40953a8f5c
Reuse formerRepresentations from remote if possible 2022-06-25 01:03:46 -04:00
Tusooa Zhu 99a6f50316
Unify the logic of updating objects 2022-06-25 00:32:22 -04:00
Tusooa Zhu e0d6da4e7d
Fix CommonAPITest 2022-06-24 10:54:11 -04:00
Tusooa Zhu ee07383191
Use meta[:object_data] in SideEffects for Update 2022-06-24 10:28:58 -04:00
Tusooa Zhu 01321c88b5
Convert incoming Updated object into Pleroma format 2022-06-24 10:25:22 -04:00
Tusooa Zhu 06da000c5d
Add editing to features 2022-06-21 12:32:44 -04:00
Ilja 4e4eb81749 Add nodes and privileges to nodeinfo
I didn't add it to /api/v1/instance
I was wondering if I should, but since it e.g. also didn't show staff, it felt better not to
2022-06-21 12:10:27 +02:00
Ilja 211e561e2a Show privileges to FE
I added an extra key
We already had is_admin and is_moderator, now we have an extra privileges key
2022-06-21 12:10:27 +02:00
Ilja 143ea7b80a Add deactivated status for privileged users
Deactivated users are only visible to users privileged with :user_activation since fc317f3b17
Here we also make sure the users who are deactivated get the status deactivated for users who are allowed to see these users
2022-06-21 12:10:27 +02:00
Ilja e21ef5aef3 report notifications for privileged users
Instead of `Pleroma.User.all_superusers()` we now use `Pleroma.User.all_superusers(:report_handle)`

I also changed it for sending emails, but there were no tests.
2022-06-21 12:10:27 +02:00
Ilja 34adea8d28 Add Pleroma.User.all_users_with_privilege/1
This should eventually replace the Pleroma.User.all_superusers/0 function

* I added a new param `is_privileged` in User.query
* Now we can fetch all users with a specified privilege
2022-06-21 12:10:27 +02:00
Ilja a1c8aa4721 Remove function superuser?
Everything now happens with privileged?/2
2022-06-21 12:10:27 +02:00
Ilja eab13fed3e Hide pleroma:report for non-privileged users
Before we deleted the notifications, but that was a side effect and didn't always trigger any more.
Now we just hide them when an unprivileged user asks them.
2022-06-21 12:10:27 +02:00
Ilja e45faddb38 Revert "Delete report notifs when demoting from superuser"
This reverts commit 89667189b8 and cdc5bbe836.

This is a side effect when changing user role.
The goal was to not have report notifications when someone isn't admin or moderator any more.
But this won't be triggered when we change the privilege tags for a role, so we can't use this sollution any more.
There was another solution to filter out report notifications during fetch.
It wasn't merged because this seemed 'cleaner' at the time, but now it seems the better sollution.
I'll add it in the next commit.
2022-06-21 12:10:27 +02:00
Ilja edf0013ff3 User.visible_for/2
According to the tests, this was only used for unconfirmed accounts.
So this just needed to be restricted to users with privilege :user_activation
2022-06-21 12:10:27 +02:00
Ilja bb61cfee8d Validator for deleting statusses is now done with priviledge instead of superuser 2022-06-21 12:10:27 +02:00
Ilja 7cf473c500 delete statusses is now privileged by :status_delete
Instead of superusers, you now need a role with privilige :status_delete to delete other users statusses
I also cleaned up some other stuff I saw
2022-06-21 12:10:27 +02:00
Ilja 7adfc2e0f4 Add Pleroma.User.privileged?/2
This should eventually replace Pleroma.User.superuser?/1
2022-06-21 12:10:27 +02:00
Ilja 9da81f41c6 Fix warning during test user_test.exs
Fixed the warning
    [warning] Please change `clear_config([section], key: value)` to `clear_config([section, key], value)`
2022-06-21 12:10:27 +02:00
Ilja c842e62675 Add last priviliges
I still had three endpoints I didn't really know what to do with them. I added them under separate tags
* :instance_delete
* :moderation_log_read
* :stats_read

I also checked and these are the last changes done by MR https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3480/diffs this is trying to fix
2022-06-21 12:10:27 +02:00
Ilja ecd42a2ce1 Add privilige :emoji_management 2022-06-21 12:10:27 +02:00
Ilja 0ee8f33250 Add privilige :status_delete
It also allows to update a message, so it's not just deleting. I need a better name...
2022-06-21 12:10:27 +02:00
Ilja 34a98990db last off :statuses_read
From the endpoints left to do, I believe these should be under :statuses_read.
These should be the last for that privilege for this MR
2022-06-21 12:10:27 +02:00
Ilja 4cb0dbb5dc Mark relevant tests synchronous
One of the things we do during the tests is change the config. But that's global state and different tests were interfering.
E.g. one test would set `clear_config([:instance, :admin_privileges], [:statuses_read])`, but while that runs, another test may
do `clear_config([:instance, :admin_privileges], [:user_invite])`. Now the code for the first test checks the setting, and it
finds `:user_invite` instead of `:statuses_read`.

Now the modules where this happens are marked to run synchronously, so they don't interfere with each other.
2022-06-21 12:10:27 +02:00
Ilja cbb26262a5 Add privileges for :user_read 2022-06-21 12:10:27 +02:00
Ilja 3f26f1b30f Add privileges for :report_handle 2022-06-21 12:10:27 +02:00
Ilja 14e697a64f Add privileges for :user_invite 2022-06-21 12:10:27 +02:00
Ilja e102d25d23 Add privileges for :user_activation 2022-06-21 12:10:27 +02:00
Ilja cb60cc4e02 Add privileges for :user_tag 2022-06-21 12:10:27 +02:00
Ilja 5a65e2dac5 Remove privileged_staff
Everything that was done through this setting, can now be set by giving the proper privileges to the roles.
2022-06-21 12:10:27 +02:00
Ilja b1ff5241c2 Add priviledges for :statuses_read
This was the last in :require_privileged_staff. I'll remove that in the next commit
2022-06-21 12:10:27 +02:00
Ilja 8a9144ca8b Add priviledges for :user_credentials
I only moved the ones from the :require_privileged_staff block for now
2022-06-21 12:10:27 +02:00
Ilja 9f6c364759 Add privilege :user_deletion 2022-06-21 12:10:27 +02:00
Ilja 5b19543f0a Add new setting and Plug to allow for privilege settings for staff 2022-06-21 12:10:26 +02:00
marcin mikołajczak b0f83aea29 Store mutes expiration date
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-06-16 20:38:37 +02:00
Tusooa Zhu 44613db853
Show original status at the first of history 2022-06-11 19:52:07 -04:00
Tusooa Zhu 95b3922328
Workaround with_index does not support function in Elixir 1.9 2022-06-11 17:02:29 -04:00
Tusooa Zhu 7451f0e81f
Send the correct update in streamer
get_create_by_ap_id_with_object() seems to fetch the old object.
Why this happens needs further investigation.
2022-06-11 12:02:16 -04:00
Tusooa Zhu 27f3d802f2
Expose history and source apis to anon users 2022-06-11 10:35:36 -04:00
Tusooa Zhu c3593639ad
Fix incorrectly cached content after editing 2022-06-09 11:39:51 -04:00
Tusooa Zhu aafd7a687d
Return the corresponding object id in attachment view 2022-06-08 11:45:24 -04:00
Tusooa Zhu 237b220d71
Add object id to uploaded attachments 2022-06-08 11:05:48 -04:00
lain 75f912c63f Merge branch 'hackney_reenable_TLSv1.3' into 'develop'
hackney adapter helper: enable TLSv1.3

See merge request pleroma/pleroma!3661
2022-06-06 11:36:21 +00:00
Tusooa Zhu d2d3532e5f
Lint 2022-06-05 16:35:01 -04:00
Tusooa Zhu 532f6ae3ed
Return update notification in mastodon api 2022-06-05 16:34:42 -04:00
Tusooa Zhu 06a3998013
Create Update notifications 2022-06-05 15:02:25 -04:00
Tusooa Zhu 97eabb2047
Fix CommonAPITest 2022-06-04 13:15:07 -04:00
Tusooa Zhu fe2d4778ee
Expose content type of status sources 2022-06-04 12:57:30 -04:00
Tusooa Zhu 72ac940618
Fix SideEffectsTest 2022-06-03 21:50:49 -04:00
Tusooa Zhu 3249ac1f12
Show edited_at in MastodonAPI/show 2022-06-03 21:47:40 -04:00
Tusooa Zhu fdaa864083
Test that own edits are streamed 2022-06-03 21:17:16 -04:00
Tusooa Zhu 8bac8147d4
Stream out edits 2022-06-03 21:15:17 -04:00
Tusooa Zhu b096fbba1a
Fix long report notes giving errors on creation 2022-06-02 01:28:39 -04:00
Tusooa Zhu fa31ae50e6
Inject history when object is refetched 2022-06-01 19:49:04 -04:00
Tusooa Zhu 410e177b2a
Strip internal fields in formerRepresentation 2022-06-01 12:02:03 -04:00
Tusooa Zhu b613a9ec6b
Implement mastodon api for editing status 2022-05-31 14:32:28 -04:00
Pierre-Louis Bonicoli 6f23fc8e08
Add tlsv1.3 to suggestions 2022-05-31 00:51:48 +02:00
Pierre-Louis Bonicoli a158774364
hackney adapter helper & reverse proxy client: enable TLSv1.3
The list of TLS versions was added by
8bd2b6eb13 when hackney version was
pinned to 1.15.2. Later hackney version was upgraded
(166455c884) but the list of TLS
versions wasn't removed. From the hackney point of view, this list has
been replaced by the OTP defaults since 0.16.0
(734694ea4e24f267864c459a2f050e943adc6694).

It looks like the same issue already occurred before:
0cb7b0ea84.

A way to test this issue (where example.com is an ActivityPub site
which uses TLSv1.3 only):

   $ PLEROMA_CONFIG_PATH=/path/to/config.exs pleroma start_iex
   Erlang/OTP 22 [erts-10.7.2.16] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]

   Erlang/OTP 22 [erts-10.7.2.16] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]

   Interactive Elixir (1.10.4) - press Ctrl+C to exit (type h() ENTER for help)
   iex(pleroma@127.0.0.1)2> Pleroma.Object.Fetcher.fetch_and_contain_remote_object_from_id("https://example.com/@/Nick/")
   {:error,
    {:tls_alert,
     {:protocol_version,
      'TLS client: In state hello received SERVER ALERT: Fatal - Protocol Version\n'}}}

With this patch, the output is the expected one:

   iex(pleroma@127.0.0.1)3> Pleroma.Object.Fetcher.fetch_and_contain_remote_object_from_id("https://example.com/@/Nick/")
   {:error,
   {:ok,
    %{
      "@context" => [
        "https://www.w3.org/ns/activitystreams",
        "https://w3id.org/security/v1",
        %{
          "Emoji" => "toot:Emoji",
          "Hashtag" => "as:Hashtag",
          "atomUri" => "ostatus:atomUri",
          "conversation" => "ostatus:conversation",
          "featured" => "toot:featured",
          "focalPoint" => %{"@container" => "@list", "@id" => "toot:focalPoint"},
          "inReplyToAtomUri" => "ostatus:inReplyToAtomUri",
          "manuallyApprovesFollowers" => "as:manuallyApprovesFollowers",
          "movedTo" => "as:movedTo",
          "ostatus" => "http://ostatus.org#",
          "sensitive" => "as:sensitive",
          "toot" => "http://joinmastodon.org/ns#"
        }
      ],
      "endpoints" => %{"sharedInbox" => "https://example.com/inbox"},
      "followers" => "https://example.com/@/Nick/followers",
      "following" => nil,
      "icon" => %{
        "type" => "Image",
        "url" => "https://example.com/static/media/[...].png"
      },
      "id" => "https://example.com/@/Nick/",
      "inbox" => "https://example.com/@/Nick/inbox",
      "liked" => nil,
      "name" => "Nick",
      "outbox" => "https://example.com/@/Nick/outbox",
      "preferredUsername" => "Nick",
      "publicKey" => %{
        "id" => "https://example.com/@/Nick/#main-key",
        "owner" => "https://example.com/@/Nick/",
        "publicKeyPem" => "[...]
      },
      "summary" => "",
      "type" => "Person",
      "url" => "https://example.com/@/Nick/"
    }}

A way to test the reverse proxy bits of this issue (where example.com allows TLSv1.3 only):

    iex(pleroma@127.0.0.1)1> Pleroma.ReverseProxy.Client.Hackney.request("GET", "https://example.com", [], [])
    {:error,
     {:tls_alert,
      {:protocol_version,
       'TLS client: In state hello received SERVER ALERT: Fatal - Protocol Version\n'}}}
2022-05-31 00:51:45 +02:00
Tusooa Zhu 393b508846
Implement viewing source 2022-05-30 00:59:23 -04:00
Tusooa Zhu c004eb0fa2
Implement mastodon api for showing edit history 2022-05-29 23:50:31 -04:00
Tusooa Zhu 8acfe95f3e
Allow updating polls 2022-05-29 22:16:03 -04:00
Tusooa Zhu 5e8aac0e07
Record edit history for Note and Question Updates 2022-05-29 13:54:16 -04:00
Tusooa Zhu 0f6a5eb9a2
Handle Note and Question Updates 2022-05-29 12:54:57 -04:00
Tusooa Zhu 547def67a7
Allow Updates by every actor on the same origin 2022-05-29 11:36:00 -04:00
Haelwenn 7466136ad3 Merge branch 'lewdthewides-develop-patch-48691' into 'develop'
Instruct users to run 'git pull' as the pleroma user

See merge request pleroma/pleroma!3667
2022-05-22 17:09:54 +00:00
duponin 5ca1ac041f BBS: add repeat functionality 2022-05-22 03:19:24 +02:00
duponin 5951d637a9 BBS: show post ID when posted 2022-05-22 02:40:56 +02:00
duponin fffd9059d6 BBS: add post favourite feature 2022-05-22 02:39:56 +02:00
Hélène a4659d993d Apply Hélène suggestions 2022-05-21 23:23:55 +00:00
duponin e3e8ff06f9 BBS: mark notification as read 2022-05-21 05:10:48 +02:00
duponin c04c7f9e45 BBS: show notifactions 2022-05-21 05:10:22 +02:00
duponin 33ced2c2ed BBS: put a new line for each HTML break in an activity
Otherwise it would just put each line on the first one, which is not
really readable
2022-05-21 04:17:34 +02:00
lain bdca5f5d68 Merge branch 'fix/mrf-steal-emoji-regex' into 'develop'
StealEmojiPolicy: fix String rejected_shortcodes

See merge request pleroma/pleroma!3673
2022-05-19 08:55:39 +00:00
duponin b128e1d6c5 decode HTML to be human readable in BBS 2022-05-19 01:38:13 +02:00
duponin 5086d6d5e9 add thread show in BBS frontend 2022-05-19 00:56:20 +02:00
Hélène a74ce2d77a
StealEmojiPolicy: fix String rejected_shortcodes
* rejected_shortcodes is defined as a list of strings in the
  configuration description. As such, database-based configuration was
  led to handle those settings as strings, and not as the actually
  expected type, Regex.
* This caused each message passing through this MRF, if a rejected
  shortcode was set and the emoji did not exist already on the instance,
  to fail federating, as an exception was raised, swiftly caught and
  mostly silenced.
* This commit fixes the issue by introducing new behavior: strings are
  now handled as perfect matches for an emoji shortcode (meaning that if
  the emoji-to-be-pulled's shortcode is in the blacklist, it will be
  rejected), while still supporting Regex types as before.
2022-05-18 21:25:10 +02:00
duponin 39c47073a3 fix Ctrl-c catch on SSH BBS 2022-05-18 20:06:16 +02:00
duponin e606b9ab3f add missing extra application to start the SSH BBS 2022-05-18 20:05:42 +02:00
lewdthewides 7977dd6ac7 Instruct users to run 'git pull' as the pleroma user 2022-05-12 16:02:58 +00:00
Tusooa Zhu f1722a9f4a
Make lint happy
Ref: fix-local-public
2022-05-09 18:53:32 -04:00
Tusooa Zhu 6e5ef7f2eb
Test local-only in ap c2s outbox
Ref: fix-local-public
2022-05-09 18:53:32 -04:00
Tusooa Zhu 38444aa92a
Allow authenticated users to access local-only posts in MastoAPI
Ref: fix-local-public
2022-05-09 18:53:18 -04:00
Haelwenn 4605efe272 Merge branch 'improve_anti_followbot_policy' into 'develop'
Also use actor_type to determine if an account is a bot in antiFollowbotPolicy

Closes #2561

See merge request pleroma/pleroma!3498
2022-05-08 18:10:40 +00:00
Ilja a8093732bd Also use actor_type to determine if an account is a bot in antiFollowbotPolicy 2022-05-08 18:10:40 +00:00
Tusooa Zhu 221cb3fb81
Allow users to create backups without providing email address
Ref: backup-without-email
2022-05-07 00:23:55 -04:00
Pete aa51fd068b Add index hotspots
squash
2022-05-06 18:48:08 -07:00
Tusooa Zhu fe933b9bf2
Prevent remote access of local-only posts via /objects
Ref: fix-local-public
2022-05-06 13:54:21 -04:00
Tusooa Zhu 466568ae36
Lint
Ref: fix-local-public
2022-05-06 13:54:13 -04:00
Tusooa Zhu 826deb7375
Make local-only statuses searchable
Ref: fix-local-public
2022-05-06 13:54:13 -04:00
Tusooa Zhu 38af42968d
Test that anonymous users cannot see local-only posts
Ref: fix-local-public
2022-05-06 13:54:12 -04:00
Tusooa Zhu c48be59f58
Show local-only statuses in public timeline for authenticated users
Ref: fix-local-public
2022-05-06 13:54:02 -04:00
Haelwenn 214ef7ff73 Merge branch 'security/2.4.3-develop' into 'develop'
Merge back 2.4.3

See merge request pleroma/pleroma!3663
2022-05-06 08:27:03 +00:00
Haelwenn (lanodan) Monnier f9943b2065 mix: Bump to 2.4.52 for 2.4.3 mergeback 2022-05-06 10:23:43 +02:00
Tusooa Zhu 57c030a0a7 Skip cache when /objects or /activities is authenticated
Ref: fix-local-public
2022-05-06 10:23:26 +02:00
Tusooa Zhu e2d24eda57 Allow to skip cache in Cache plug
Ref: fix-local-public
2022-05-06 10:23:26 +02:00
Ilja c3b2b71ea2 update sweet_xml [Security] 2022-05-06 10:23:25 +02:00
Haelwenn b22843a982 Merge branch 'security/2.4.3' into 'stable'
Release: 2.4.3

See merge request pleroma/pleroma!3662
2022-05-06 08:19:03 +00:00
Haelwenn (lanodan) Monnier 57c486014c Release 2.4.3 2022-05-06 09:01:33 +02:00
Tusooa Zhu fa3157df96 Skip cache when /objects or /activities is authenticated
Ref: fix-local-public
2022-05-06 08:44:03 +02:00
Tusooa Zhu 4d482b765f Allow to skip cache in Cache plug
Ref: fix-local-public
2022-05-06 08:39:42 +02:00
Ilja 85cbf773f0 update sweet_xml [Security] 2022-05-06 08:36:58 +02:00
Haelwenn 8517bc18aa Merge branch 'from/upstream-develop/tusooa/fix-en-fallback' into 'develop'
Fix incorrect fallback when English is set to first language

See merge request pleroma/pleroma!3656
2022-04-18 03:31:44 +00:00
Tusooa Zhu be08d9305b
Fix incorrect fallback when English is set to first language 2022-04-17 22:39:52 -04:00
Tusooa Zhu 6599607226
Translate static_pages.po (Simplified Chinese) 2022-04-07 17:42:19 -04:00
Haelwenn a5d7e98de0 Merge branch 'fix_eratic_test_for_report_notes' into 'develop'
Fix eratic test for POST /api/pleroma/admin/reports/:id/notes

See merge request pleroma/pleroma!3653
2022-04-05 12:11:53 +00:00
Ilja 5f37db330f Fix eratic test for POST /api/pleroma/admin/reports/:id/notes
It retrieved two ReportNotes and then checked one of them. But the order isn't guaranteed, while the test tested on the content of the first ReportNote.

I made the test on the content more generic
2022-04-05 13:21:09 +02:00
Tusooa Zhu 7d1dae3bef
Restrict mastodon api announcements to logged-in users only 2022-04-02 02:25:13 -04:00
marcin mikołajczak fbf9eced11 Add short_description field
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-03-29 14:04:27 +02:00
Sean King 4194559ea6
Fix lint errors 2022-03-20 17:26:07 -06:00
Haelwenn d7c53da77a Merge branch 'from/upstream-develop/tusooa/translate-pages' into 'develop'
Translate backend-rendered pages

See merge request pleroma/pleroma!3634
2022-03-20 18:14:37 +00:00
Haelwenn e63d49d238 Merge branch 'caddyfile-v2' into 'develop'
Update Caddyfile to Caddy v2

Closes #2764

See merge request pleroma/pleroma!3641
2022-03-20 18:14:00 +00:00
Haelwenn b76340511d Merge branch 'delete_report_notifs_when_demoting_from_superuser' into 'develop'
Delete report notifs when demoting from superuser

Closes #2840

See merge request pleroma/pleroma!3642
2022-03-20 18:13:19 +00:00
Sean King d0c1997d48
Rewrite integration-test websocket client with Mint.WebSocket 2022-03-19 23:33:37 -06:00
Tusooa Zhu 0c78ab4a88
Use utc_datetime in db schema 2022-03-18 11:17:22 -04:00
Haelwenn (lanodan) Monnier 83338c25a5 Transmogrifier: Use validating regex for "mediaType" 2022-03-17 22:37:26 +01:00
Haelwenn (lanodan) Monnier 030183b35f AttachmentValidator: Use custom ecto type and regex for "mediaType" 2022-03-17 22:37:26 +01:00
Haelwenn (lanodan) Monnier 4ea9886faa EctoType: Add MIME validator 2022-03-17 22:37:26 +01:00
Haelwenn 2db640632b Merge branch 'bugfix/mix-dotgit' into 'develop'
mix: Check `.git` presence

See merge request pleroma/pleroma!3638
2022-03-17 21:21:59 +00:00
marcin mikołajczak 31ff467eff Use `types` for filtering notifications
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-03-16 21:15:44 +01:00
marcin mikołajczak ffe081bf44 Use reject_follow_request
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-03-16 19:18:15 +01:00
marcin mikołajczak 6754d1f272 POST /api/v1/accounts/:id/remove_from_followers
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-03-16 16:52:33 +01:00
Tusooa Zhu ebcda5265b
Format announcements into html 2022-03-08 23:00:51 -05:00
Tusooa Zhu 0e0a1758f7
Add doc for Admin Announcement APIs 2022-03-08 21:48:41 -05:00
Tusooa Zhu eb1a29640f
Add pagination to AdminAPI.AnnouncementController.index 2022-03-08 21:26:05 -05:00
Tusooa Zhu 11a1996bf5
Implement update announcement admin api 2022-03-08 20:55:41 -05:00
Tusooa Zhu 881179ec72
Remove GET /api/v1/announcements/:id 2022-03-08 19:22:28 -05:00
Tusooa Zhu d569694ae9
Show only visible announcements in MastodonAPI 2022-03-08 19:20:29 -05:00
Tusooa Zhu cf8334dbc1
Add starts_at, ends_at and all_day parameters 2022-03-08 19:12:01 -05:00
Tusooa Zhu fcf3c9057e
Implement visibility filtering for announcements 2022-03-08 18:21:20 -05:00
Tusooa Zhu 009817c9ee
Correct docstring for AnnouncementController.show 2022-03-08 17:00:49 -05:00
Tusooa Zhu 2b39b36e49
Implement POST /api/v1/announcements/:id/dismiss 2022-03-08 16:59:20 -05:00
Tusooa Zhu aa1fff279e
Implement GET /api/v1/announcements/:id 2022-03-08 16:19:35 -05:00
Tusooa Zhu 5169ad8f14
Implement announcement read relationships 2022-03-08 13:09:49 -05:00
Tusooa Zhu c867d23250
Fill properties of announcements from Mastodon API spec 2022-03-08 09:35:35 -05:00
Tusooa Zhu d7af67012f
Implement first pass of announcement admin api
CCBUG: https://git.pleroma.social/pleroma/pleroma/-/issues/2836
CCBUG: https://git.pleroma.social/pleroma/pleroma/-/issues/1470
2022-03-08 01:01:27 -05:00
Ilja cdc5bbe836 After code review
Use patern matching to see if someone was superuser before
2022-03-07 14:00:42 +01:00
Haelwenn 4458db3201 Merge branch 'fix_test_get_user_apps' into 'develop'
Fix test get_user_apps/1

See merge request pleroma/pleroma!3636
2022-03-06 18:40:49 +00:00
Haelwenn ee32e36b01 Merge branch 'copyright-bump-2022' into 'develop'
Copyright bump for 2022

See merge request pleroma/pleroma!3593
2022-03-06 18:29:37 +00:00
Tusooa Zhu 79ccb6b999
Support fallbacking to other languages 2022-03-06 11:43:31 -05:00
Ilja 89667189b8 Delete report notifs when demoting from superuser
When someone isn't a superuser any more, they shouldn't see the reporsts any more either.
Here we delete the report notifications from a user when that user gets updated from being a superuser to a non-superuser.
2022-03-06 17:36:30 +01:00
sleepycrow 9b69ccb35b Update Caddyfile to Caddy v2 2022-03-06 14:24:32 +01:00
Tusooa Zhu cd42e2bed0
Lint 2022-03-03 09:49:55 -05:00
Tusooa Zhu aca11fb70e
Support multiple locales from userLanguage cookie 2022-03-03 02:31:36 -05:00
Tusooa Zhu 7ea330b4fe
Support multiple locales formally
elixir gettext current does not fully support fallback to another language [0].
But it might in the future. We adapt it so that all languages in Accept-Language
headers are received by Pleroma.Web.Gettext. User.languages is now a comma-separated
list.

[0]: https://github.com/elixir-gettext/gettext/issues/303
2022-03-03 02:03:44 -05:00
Tusooa Zhu d3f3f30c6a
Make lint happy 2022-03-02 22:56:19 -05:00
Tusooa Zhu bc59da96c5
Add test for fallbacking to a general language 2022-03-02 20:04:30 -05:00
Tusooa Zhu 8de573b047
Fallback to a variant if the language in general is not supported
For an example, here, zh is not supported, but zh_Hans and zh_Hant
are. If the user asks for zh, we should choose a variant for them
instead of fallbacking to default.

Some browsers (e.g. Firefox) does not allow users to customize
their language codes. For example, there is no zh-Hans, but only
zh, zh-CN, zh-TW, zh-HK, etc. This provides a workaround for
those users suffering from bad design decisions.
2022-03-02 19:59:11 -05:00
Tusooa Zhu 1a917cfeec
Add changelog 2022-03-02 09:51:46 -05:00
Tusooa Zhu 5e38887080
Document API addition 2022-03-02 09:47:51 -05:00
Tusooa Zhu e644f8dea5
Allow user to register with custom language 2022-03-02 01:41:13 -05:00
Tusooa Zhu 396f036b13
Allow update_credentials to update User.language 2022-03-02 00:58:02 -05:00
Tusooa Zhu 0149ea4538
Send emails i18n'd using backend-stored user language 2022-03-01 22:19:13 -05:00
Tusooa Zhu af82f09ce3
Make all emails translatable 2022-03-01 20:45:59 -05:00
Tusooa Zhu 8b0c2890f9
Fix digest test 2022-03-01 20:27:45 -05:00
Tusooa Zhu 1deab33fb0
Make mail and mailer translatable 2022-03-01 19:17:11 -05:00
Tusooa Zhu 32e4aa42d3
Make static fe translatable 2022-03-01 18:48:08 -05:00
feld 0b686c6e54 Merge branch 'revert-ee05abe0' into 'develop'
Revert "Merge branch 'revert/notice-routes' into 'develop'"

See merge request pleroma/pleroma!3639
2022-03-01 19:02:48 +00:00
feld 9c52a496f7 Revert "Merge branch 'revert/notice-routes' into 'develop'"
This reverts merge request !3576
2022-03-01 19:02:28 +00:00
Tusooa Zhu fdbf9b06e5
Fix tests 2022-02-28 11:23:15 -05:00
Tusooa Zhu cadca083ea
Make mfa pages translatable 2022-02-28 11:07:28 -05:00
Tusooa Zhu 50a316cd63
Make oauth pages translatable 2022-02-28 02:11:57 -05:00
Tusooa Zhu f63d9b7835
Use proper lang attributes in htmls 2022-02-28 01:28:23 -05:00
Tusooa Zhu 0cc6557716
Make tag feed translatable 2022-02-28 01:13:39 -05:00
Tusooa Zhu 1edbda39e1
Make password reset pages translatable 2022-02-28 01:04:04 -05:00
HJ ee05abe052 Merge branch 'revert/notice-routes' into 'develop'
Revert notice compatibility routes merge request

See merge request pleroma/pleroma!3576
2022-02-26 16:24:49 +00:00
Sean King 17aa3644be
Copyright bump for 2022 2022-02-25 23:11:42 -07:00
Haelwenn (lanodan) Monnier 56197192bb mix: Check .git presence 2022-02-25 10:39:12 +01:00
Ilja 6ba93c2cb3 Fix test get_user_apps/1
For some reason I had a test who suddenly failed, mix test test/pleroma/web/o_auth/app_test.exs:54. A user has a list of applications and this test adds them and then sees if the list it gets back is the same as the apps it added.

When I ran mix test a day before I didn't have this problem and when I pushed code today in a different MR, the pipeline succeeded (see https://git.pleroma.social/ilja/pleroma/-/jobs/205827), yet locally it failed. So it seems the test can sometimes succeed and sometimes fail, which makes it untrustworthy.

The failure I see is because the returned list is in reverse order. I assume that's not per sé wrong. You just want to know if the apps you added are actually there. I fixed the test by first ordering the lists before comparing.

AFAICT (and as far as that's relevant) the test got introduced in commit cb2a072e62
2022-02-22 18:56:26 +01:00
Tusooa Zhu 9f4c5743e8
Make lint happy 2022-02-21 19:12:32 -05:00
Tusooa Zhu 2fa1ca84e6
Extract translatable text 2022-02-21 18:44:36 -05:00
Tusooa Zhu a867107437
Make remote follow pages translatable 2022-02-21 18:43:45 -05:00
Tusooa Zhu 0fd3695b9c
Prefer userLanguage cookie over Accept-Language header in detecting locale
https://git.pleroma.social/pleroma/pleroma-meta/-/issues/60
2022-02-21 18:02:19 -05:00
lain d91e9cee04 Merge branch 'unicode-14.0-backend' into 'develop'
Unicode 14 Support

See merge request pleroma/pleroma!3633
2022-02-21 19:38:52 +00:00
Sam Therapy 061cb749cd
Add unicode 14 support
and add a test with a unicode 14 emoji
2022-02-21 12:28:33 -06:00
Alex Gleason fa8e2ffa3f Merge branch 'max_media_attachments' into 'develop'
Allow specifying max media attachment count

Closes #2665

See merge request pleroma/pleroma!3630
2022-02-06 18:25:14 +00:00
marcin mikołajczak e473bcf7a0 Max media attachment count
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-02-06 17:41:15 +01:00
Alex Gleason 60deddb7e5 Merge branch 'fix-tests-warn' into 'develop'
Fix tests matching on "warn"

See merge request pleroma/pleroma!3629
2022-02-02 19:57:03 +00:00
Alex Gleason 7c044a1841
FilterControllerTest: tag erratic test 2022-02-02 13:10:39 -06:00
Haelwenn (lanodan) Monnier d1cc9e4eaf
Fix tests matching on "warn"
Moving it to "warning" would break tests on 1.12.x
2022-02-02 12:45:26 -06:00
Alex Gleason 71c80204c9 Merge branch 'roadhouse' into 'develop'
Roadhouse debugging

See merge request pleroma/pleroma!3628
2022-02-02 18:44:09 +00:00
Alex Gleason bd81af731e
Tag erratic test 2022-02-02 12:29:53 -06:00
Alex Gleason 2d77976305
Add tests for mismatched context in replies 2022-02-02 12:19:35 -06:00
Alex Gleason 5a4e3aa715
Test that a Create/Note from Roadhouse validates 2022-02-02 11:02:23 -06:00
Alex Gleason 61dfeca1cc
Test that a Note from Roadhouse validates 2022-02-02 10:38:30 -06:00
Alex Gleason de99fd7804 Merge branch 'birth-dates' into 'develop'
Birthdays: Fix outgoing federation of birth dates

See merge request pleroma/pleroma!3626
2022-02-01 15:21:34 +00:00
marcin mikołajczak f8f2a17754 Birthdays: Fix outgoing federation of birth dates
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-02-01 12:00:26 +01:00
Alex Gleason 64944c164f Merge branch 'mention-mrf-md' into 'develop'
ForceMentionsInContent: improve display of Markdown posts

See merge request pleroma/pleroma!3625
2022-01-28 16:53:40 +00:00
Alex Gleason 3bf257171f
ForceMentionsInContent: improve display of Markdown posts 2022-01-27 14:15:06 -06:00
Alex Gleason a146f6acab Merge branch 'mentions-mrf-replies-only' into 'develop'
ForceMentionsInContent: don't apply it to top-level posts

See merge request pleroma/pleroma!3624
2022-01-27 19:57:28 +00:00
Alex Gleason 27cb3d6273
ForceMentionsInContent: don't apply it to top-level posts 2022-01-26 21:24:26 -06:00
Alex Gleason 2bab9dd175 Merge branch 'fix-bot-policy' into 'develop'
ForceBotUnlistedPolicy: fix to stop unlisting my posts >:(

See merge request pleroma/pleroma!3623
2022-01-26 23:25:58 +00:00
bot a4de79ced0 ForceBotUnlistedPolicy: fix to stop unlisting my posts >:( 2022-01-26 22:53:02 +00:00
Alex Gleason 8951be7710 Merge branch 'inline-mention-self' into 'develop'
ForceMentionsInContent: don't mention self

See merge request pleroma/pleroma!3622
2022-01-25 21:49:33 +00:00
Alex Gleason 0604b0dd09
ForceMentionsInContent: don't mention self 2022-01-25 12:33:47 -06:00
Alex Gleason 0f4e0e667e Merge branch 'recipients-inline' into 'develop'
ForceMentionsInContent: wrap mentions in a span, fix the formatting

See merge request pleroma/pleroma!3620
2022-01-25 17:43:39 +00:00
Alex Gleason 99e9c2c668 Merge branch 'birth-dates' into 'develop'
Fix show_birthday

See merge request pleroma/pleroma!3621
2022-01-25 16:59:07 +00:00
Alex Gleason 65b4d2ce84
ForceMentionsInContent: fix order of mentions 2022-01-25 10:42:34 -06:00
marcin mikołajczak ab12a05a43 AccountView: Add test for show_birthday
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-25 17:34:36 +01:00
marcin mikołajczak c1ae35ff2c Fix show_birthday
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-25 17:04:41 +01:00
Alex Gleason dd7977bb68 Merge branch 'birth-dates' into 'develop'
Birth dates

See merge request pleroma/pleroma!3608
2022-01-25 15:35:47 +00:00
marcin mikołajczak 249fe88d12 Birthdays: users_birthday_month_day_index
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-25 11:49:42 +01:00
Alex Gleason 267184b70e
ForceMentionsInContentTest: return mentions in a not terrible format 2022-01-24 20:03:43 -06:00
Alex Gleason c5a20c80c4
ForceMentionsInContent: simplify finding users 2022-01-24 19:44:44 -06:00
Alex Gleason d5644a52aa
ForceMentionsInContent: wrap inline mentions with span tag 2022-01-24 19:11:45 -06:00
Alex Gleason 1bbc701a3a
ForceMentionsInContent: use `to` instead of `tag` 2022-01-24 19:11:14 -06:00
Alex Gleason 19d557c870 Merge branch 'revert-6e27fc9c' into 'develop'
Revert "Merge branch 'log-slow-queries' into 'develop'"

See merge request pleroma/pleroma!3619
2022-01-24 19:06:33 +00:00
Alex Gleason 53de3a9d44 Revert "Merge branch 'log-slow-queries' into 'develop'"
This reverts merge request !3553
2022-01-24 18:54:43 +00:00
Alex Gleason 7b87cac6cc Merge branch 'preserve-mentions-order' into 'develop'
Preserve order of mentioned users

See merge request pleroma/pleroma!3617
2022-01-23 15:23:56 +00:00
marcin mikołajczak 75c4fefb1c Add a test
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-23 13:03:00 +01:00
marcin mikołajczak 1dba3bc4dc Preserve order of mentioned users
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-23 12:29:01 +01:00
marcin mikołajczak 61bae9a407 Create index for `show_birthday`
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-23 12:07:05 +01:00
marcin mikołajczak e3d394eef6 Birthdays: Fix tests, add test for misskey
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-23 09:41:21 +01:00
marcin mikołajczak 0266bc3c96 Birthdays: hide_birthday -> show_birthday
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-23 09:13:33 +01:00
Alex Gleason aaa9314f4c
Merge remote-tracking branch 'origin/develop' into birth-dates 2022-01-22 14:24:50 -06:00
Alex Gleason 9983799ccb Merge branch 'less_erratic_expiration_test' into 'develop'
Make test less erratic by adding five second tolerance

See merge request pleroma/pleroma!3614
2022-01-22 20:09:09 +00:00
Alex Gleason 98ce239ebc
Update description.exs 2022-01-22 13:28:00 -06:00
Alex Gleason 66e8c6f90f
Birthdays: birth_date --> birthday 2022-01-22 13:21:55 -06:00
NEETzsche 7a015b1fe2 Make test less erratic by adding five second tolerance 2022-01-22 12:07:54 -07:00
Alex Gleason 263b42a73d Merge branch 'apple_autofill_suggestions' into 'develop'
Add autocompelete values suggested by Apple

See merge request pleroma/pleroma!3612
2022-01-22 18:38:03 +00:00
Alex Gleason 78c6aeee1b Merge branch 'erratic-filter-test' into 'develop'
FilterTest: tag erratic test

See merge request pleroma/pleroma!3613
2022-01-22 18:32:34 +00:00
Alex Gleason f5d4ef50b4
FilterTest: tag erratic test 2022-01-22 12:13:09 -06:00
Finn Behrens 8328289619 Add autocompelete values suggested by Apple
Link: https://developer.apple.com/documentation/security/password_autofill/enabling_password_autofill_on_an_html_input_element
2022-01-22 10:00:43 +01:00
Finn Behrens 7b56690af4 add nixos to supported distros 2022-01-22 09:39:02 +01:00
Alex Gleason 6ffe43af70 Merge branch 'private-pins' into 'develop'
Support private pinned posts from Mastodon

See merge request pleroma/pleroma!3611
2022-01-20 23:18:24 +00:00
Alex Gleason 560bcd58ab Merge branch 'from/develop/tusooa/add-glitch-lily' into 'develop'
Add glitch-lily to clients.md

See merge request pleroma/pleroma!3610
2022-01-20 23:11:35 +00:00
Alex Gleason 00523bdf5e
Test pinned private statuses in AccountController 2022-01-20 16:54:43 -06:00
marcin mikołajczak 88c21b9282 Support private pinned posts from Mastodon
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-20 12:35:32 +01:00
Tusooa Zhu 9faac1094f
Add glitch-lily to clients.md 2022-01-19 23:56:57 -05:00
rinpatch 787a02c4b1 Merge branch 'feat/force-mentions-mrf' into 'develop'
Add ForceMentionsInContentPolicy

See merge request pleroma/pleroma!3609
2022-01-20 00:27:29 +00:00
marcin mikołajczak 74cf0f0355 Update changelog
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-19 23:52:46 +01:00
rinpatch a02cfd7f52 Add ForceMentionsInContentPolicy
Even though latest PleromaFE supports displaying these properly, mobile
apps still exist, so I think we should offer a workaround to those who
want it.
2022-01-19 21:04:57 +03:00
marcin mikołajczak c180f9276f check if remote bday is valid
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-19 17:19:28 +01:00
marcin mikołajczak dfb2808535 Birth dates: Add tests
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-18 23:15:31 +01:00
marcin mikołajczak 397f67fef8 Format code, expose instance configuration related to birth dates
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-18 18:18:38 +01:00
Alex Gleason 70fbd1f09e Merge branch 'document-oauth-tokens' into 'develop'
Docs: PleromaAPI oauth_tokens endpoints

See merge request pleroma/pleroma!3607
2022-01-18 17:18:00 +00:00
Alex Gleason 1dfb67f1e0
Docs: PleromaAPI oauth_tokens endpoints 2022-01-18 11:02:23 -06:00
Alex Gleason 69b089c894 Merge branch 'erratic-allow-failure' into 'develop'
unit-testing-erratic: allow failure

See merge request pleroma/pleroma!3606
2022-01-18 14:56:26 +00:00
marcin mikołajczak b108b05650 Birth dates, birthday reminders API, allow instance admins to require minimum age
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-18 14:57:48 +01:00
Alex Gleason 72d5e29117 Merge branch 'hakabahitoyo-develop-patch-44025' into 'develop'
[Document] Update cheatsheet.md. Add `Pleroma.Web.ActivityPub.MRF.KeywordPolicy`.

See merge request pleroma/pleroma!3604
2022-01-18 13:18:36 +00:00
Alex Gleason ac434f83c3
unit-testing-erratic: allow failure 2022-01-15 13:35:22 -06:00
Alex Gleason ecdc81b37a Merge branch 'linkify-0.5.2' into 'develop'
Upgrade Linkify to v0.5.2

Closes #2376, #2386, and #2485

See merge request pleroma/pleroma!3605
2022-01-15 19:13:56 +00:00
Alex Gleason 39c5ebb1f6
mix format 2022-01-15 12:55:12 -06:00
Alex Gleason cd8f1aac47
CHANGELOG: hashtags markdown fix 2022-01-15 12:36:33 -06:00
Alex Gleason 31148c1857
FormatterTest: fix nesting in expected output 2022-01-15 12:31:36 -06:00
Alex Gleason db90c9e3b0
Merge remote-tracking branch 'mkfain/test-for-breaking-markdown' into linkify-0.5.2 2022-01-15 12:27:42 -06:00
Alex Gleason d5eb44e8b3
Upgrade Linkify to v0.5.2 2022-01-15 12:27:16 -06:00
Hakaba Hitoyo 790081540d Update cheatsheet.md. Add `Pleroma.Web.ActivityPub.MRF.KeywordPolicy`. 2022-01-15 12:26:33 +00:00
Alex Gleason 71baa713bc Merge branch 'show_blockers_visible' into 'develop'
Add blockers_visible to features list when it's enabled

See merge request pleroma/pleroma!3603
2022-01-14 23:08:34 +00:00
NEETzsche 6284353025 Add blockers_visible to features list when it's enabled 2022-01-14 23:08:33 +00:00
rinpatch 8b5a658991 Merge branch 'mergeback' into 'develop'
Merge stable back into develop

Closes #2753

See merge request pleroma/pleroma!3602
2022-01-14 22:15:10 +00:00
Alex Gleason a4436bcc3f
Merge remote-tracking branch 'origin/stable' into mergeback 2022-01-14 12:37:00 -06:00
Alex Gleason 84dcb55b0f Merge branch 'account-endorsements' into 'develop'
Account endorsements

See merge request pleroma/pleroma!3601
2022-01-13 19:02:21 +00:00
marcin mikołajczak eedf551eed Add more tests
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-12 22:41:34 +01:00
marcin mikołajczak 0f90fd5805 WIP account endorsements
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-12 18:15:10 +01:00
rinpatch 62a45747d9 Merge branch 'release/2.4.2' into 'stable'
2.4.2 Release

See merge request pleroma/pleroma!3599
2022-01-11 20:47:02 +00:00
Lain Soykaf b34f0a6e51 CI: Conservatively update release images so they keep building. 2022-01-11 13:59:53 +03:00
Lain Soykaf e4cfdfd701 CI: Upload the image for all platforms
For some reason the other platforms started failing, too. This
fixes it. Why? Don't know.
2022-01-11 13:59:28 +03:00
rinpatch a98a127718 Pleroma-FE bundle: update to b13d8f7e6339e877a38a28008630dc8ec64abcdf 2022-01-11 13:49:06 +03:00
rinpatch ea204dbca1 mix.lock: sync with mix.exs
hackney version was bumped in mix.exs, but mix.lock was not updated
2022-01-11 13:48:33 +03:00
rinpatch f4bc2f5975 Add 2.4.2 changelog entry and bump mix version 2022-01-11 13:39:23 +03:00
Alex Gleason cd3175c7fe Merge branch 'fix/rich-media-test-escape-unicrud' into 'develop'
Escape unicode RTL overrides in rich media parser tests

See merge request pleroma/pleroma!3598
2022-01-11 13:39:23 +03:00
lain bf0b32c9aa Merge branch 'pleroma-result-1_13' into 'develop'
move result into with guard

See merge request pleroma/pleroma!3557
2022-01-11 13:39:23 +03:00
marcin mikołajczak 4f249b2397 Merge remote-tracking branch 'origin/develop' into account-endorsements 2022-01-10 20:04:14 +01:00
Alex Gleason 753a9b3f32 Merge branch 'fix/rich-media-test-escape-unicrud' into 'develop'
Escape unicode RTL overrides in rich media parser tests

See merge request pleroma/pleroma!3598
2022-01-10 15:07:09 +00:00
rinpatch fd043b0ab3 Escape unicode RTL overrides in rich media parser tests
Elixir 1.13 does not allow them in raw form anymore, resulting in errors
like this when running the test:

== Compilation error in file test/pleroma/web/rich_media/parser_test.exs ==
** (SyntaxError) test/pleroma/web/rich_media/parser_test.exs:136:45: invalid bidirectional formatting character in string: \u202C. If you want to use such character, use it in its escaped \u202C form instead
2022-01-10 17:51:53 +03:00
lain 991b26f494 Merge branch 'update-hackney' into 'develop'
Mix: upgrade Hackney to 1.18.0

Closes #2753

See merge request pleroma/pleroma!3549
2022-01-10 17:40:31 +03:00
Alex Gleason 2451d65bd8 Merge branch 'api-docs-fixes' into 'develop'
Docs: fix various Pleroma API endpoints paths, fix MFA response

See merge request pleroma/pleroma!3596
2022-01-07 20:29:28 +00:00
Alex Gleason e8b340aaa7
Docs: fix various Pleroma API endpoints paths, fix MFA response 2022-01-07 12:51:54 -06:00
Alex Gleason a3094b64df Merge branch 'change/web-push-encryption-dep' into 'develop'
Upgrade web_push_encryption to 0.3.1

See merge request pleroma/pleroma!3592
2022-01-02 15:41:56 +00:00
Sean King bf995a7770
Upgrade web_push_encryption to 0.3.1 2022-01-01 21:02:09 -07:00
Alex Gleason c8026fe492 Merge branch 'change/concurrent-limiter-dep' into 'develop'
Change concurrent_limiter to version 0.1.1

See merge request pleroma/pleroma!3591
2022-01-01 22:15:08 +00:00
Sean King 91ea394cd0
Change concurrent_limiter to Hex PM version 0.1.1 2022-01-01 14:49:57 -07:00
Alex Gleason 86e692aeb1 Merge branch 'erratic-streamer-test' into 'develop'
StreamerTest: tag erratic test

See merge request pleroma/pleroma!3590
2021-12-31 16:40:14 +00:00
Alex Gleason 2ae867842b
StreamerTest: tag erratic test 2021-12-31 10:29:50 -06:00
Sean King dafcf896d9 Merge more stuff from upstream develop branch 2021-12-30 14:25:45 -07:00
lain e25af3f2d8 Merge branch 'more-efficient-ci' into 'develop'
CI: Use own package as base

See merge request pleroma/pleroma!3577
2021-12-30 15:53:33 +00:00
Sean King ffeae7ef2c
Fix merge conflict in CHANGELOG.md 2021-12-29 18:08:50 -07:00
lain 84420d9439 Merge branch 'chore/user-relationships-target-id-rel-type-index' into 'develop'
Added index on [:target_id, :relationship_type] to :user_relationships

See merge request pleroma/pleroma!3588
2021-12-29 13:06:47 +00:00
Ivan Tashkinov a7bdefc208 `mix format` 2021-12-29 11:44:33 +03:00
Ivan Tashkinov 0c7fb520bf Added index on [:target_id, :relationship_type] to :user_relationships (speeds up `Notification.exclude_blockers/_`). 2021-12-29 11:41:21 +03:00
Alex Gleason a61ed5c488 Merge branch 'changelog' into 'develop'
Update CHANGELOG.md

See merge request pleroma/pleroma!3586
2021-12-28 21:42:39 +00:00
Alex Gleason 5f87472cdf
Update CHANGELOG.md 2021-12-28 15:14:09 -06:00
Alex Gleason b5b98f9e10 Merge branch 'mastodon-lookup' into 'develop'
MastoAPI: Add `GET /api/v1/accounts/lookup`

See merge request pleroma/pleroma!3584
2021-12-28 21:00:09 +00:00
marcin mikołajczak 1657db656c AccountController.lookup: skip auth
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-12-28 20:02:59 +01:00
marcin mikołajczak 0dd1caa841 AccountController.lookup: skip visibility check
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-12-28 18:24:48 +01:00
marcin mikołajczak 9032d065e6 wip
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-12-28 18:07:19 +01:00
marcin mikołajczak 746c9daa62 Merge remote-tracking branch 'pleroma/develop' into mastodon-lookup
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-12-28 16:27:27 +01:00
marcin mikołajczak f734579965 MastoAPI: Add `GET /api/v1/accounts/lookup`
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-12-28 16:11:17 +01:00
Alex Gleason de7f84deb3 Merge branch 'apps-api-endpoint' into 'develop'
Apps API endpoint

See merge request pleroma/pleroma!3583
2021-12-28 14:38:02 +00:00
Tusooa Zhu 9a27cb4f9d
Deal with target not found error in add_alias
Ref: emit-move
2021-12-28 01:11:08 -05:00
Tusooa Zhu 3fd13b70ec
Test that the target account is re-fetched in move_account
Ref: emit-move
2021-12-28 01:11:08 -05:00
Tusooa Zhu eb383ef8d3
Make move_account endpoint process non-existent users properly
Ref: emit-move
2021-12-28 01:11:08 -05:00
Tusooa Zhu a677c621e8
Make move_following worker follow then unfollow
Ref: emit-move
2021-12-28 01:11:08 -05:00
Tusooa Zhu 4f44fd32ea
Federate unfollow activity in move_following properly
0: Use the CommonAPI unfollow function to make sure the
unfollow activity is federated.

1: Limit the follow and unfollow to local followers only,
while let the romote servers decide whether to move their followers.

Ref: emit-move
2021-12-28 01:11:08 -05:00
Tusooa Zhu e41eee5ed1
Make Move activity federate properly
Ref: emit-move
2021-12-28 01:11:08 -05:00
Tusooa Zhu 1d8abf2511
Document aliases endpoints
Ref: emit-move
2021-12-28 01:11:08 -05:00
Tusooa Zhu 54d7b4354c
Add deleting alias endpoint
Ref: emit-move
2021-12-28 01:11:08 -05:00
Tusooa Zhu c1aa3c98ac
Add get and add aliases endpoints
Ref: emit-move
2021-12-28 01:11:08 -05:00
Tusooa Zhu 60081a8818
Add User.add_alias/2 and User.alias_users/1
Ref: emit-move
2021-12-28 01:11:07 -05:00
Tusooa Zhu 3092558bc1
Add changelog 2021-12-28 01:11:06 -05:00
Tusooa Zhu df90b3e66a
Document move_account API
Ref: emit-move
2021-12-28 01:10:39 -05:00
Tusooa Zhu 0af77b20c1
Implement moving account
Ref: emit-move
2021-12-28 01:10:34 -05:00
Alex Gleason 52a3f0f08b Merge branch 'ensure-staff-privileged-strict' into 'develop'
EnsureStaffPrivilegedPlug: don't let non-moderators through

See merge request pleroma/pleroma!3582
2021-12-28 00:53:11 +00:00
Alex Gleason 5c80d4087d
PleromaAPI.AppView: add test 2021-12-27 18:52:34 -06:00
Alex Gleason 7704a722c0
AppController: remove unnecessary `require Logger` 2021-12-27 18:30:16 -06:00
Alex Gleason cb2a072e62
Apps: add test for get_user_apps/1 2021-12-27 18:29:03 -06:00
Alex Gleason 2e4a1c56c3
AppController: test creating with and without a user 2021-12-27 18:14:15 -06:00
Alex Gleason fa35e24a5e
Apps: add user_id index 2021-12-27 18:05:35 -06:00
Alex Gleason f5c3d45120
Merge remote-tracking branch 'origin/develop' into apps-api-endpoint 2021-12-27 18:01:25 -06:00
Alex Gleason 138f5a4517
EnsureStaffPrivilegedPlug: don't let non-moderators through 2021-12-27 17:18:26 -06:00
Alex Gleason 264f0fde1b Merge branch 'admin-fix-duplicated-endpoints' into 'develop'
AdminAPI: fix duplicated routes

See merge request pleroma/pleroma!3581
2021-12-27 23:12:14 +00:00
Alex Gleason a3fa987611
AdminAPI: fix duplicated routes 2021-12-27 16:58:10 -06:00
Alex Gleason fd9260d1b5 Merge branch 'finch' into 'develop'
Finch support

See merge request pleroma/pleroma!3565
2021-12-27 18:27:13 +00:00
Alex Gleason 9b5dbd20b0 Merge branch 'tag-gun-erratic' into 'develop'
ConnectionPoolTest: tag erratic test

See merge request pleroma/pleroma!3580
2021-12-27 17:41:28 +00:00
Alex Gleason 326575d5b7
Merge remote-tracking branch 'origin/develop' into finch 2021-12-27 11:31:15 -06:00
Alex Gleason d61a5515e6
ConnectionPoolTest: tag erratic test 2021-12-27 11:27:25 -06:00
Alex Gleason a659428024 Merge branch 'restricted-moderators' into 'develop'
AdminAPI: Optionally restrict moderators from accessing sensitive data

See merge request pleroma/pleroma!3578
2021-12-27 17:06:22 +00:00
Alex Gleason 479fc5fff8
EnsureStaffPrivilegedPlug: add tests 2021-12-27 10:39:59 -06:00
Alex Gleason 6e27fc9c12 Merge branch 'log-slow-queries' into 'develop'
Log slow Ecto queries

See merge request pleroma/pleroma!3553
2021-12-27 15:41:06 +00:00
Ivan Tashkinov 08c0f09bad Made slow queries logging disabled by default. 2021-12-27 09:13:31 +03:00
Alibek Omarov f02715c4b2 Fix lint errors 2021-12-27 03:42:03 +03:00
Alibek Omarov f66675f349 API: fix duplicate :get_password_token route 2021-12-27 02:57:54 +03:00
Alibek Omarov 1c223331fc API: show info about privileged staff in instance metadata 2021-12-27 02:28:09 +03:00
Alibek Omarov cd1041c3a4 API: optionally restrict moderators from accessing sensitive data 2021-12-27 02:27:48 +03:00
Ivan Tashkinov 3e9e7178bc Configurability of slow queries logging ([:pleroma, :telemetry, :slow_queries_logging]). Adjusted log messages truncation to 65 kb (was default: 8 kb). Non-truncated logging of slow query params. 2021-12-26 22:49:00 +03:00
Sean King 8ef1d8b566 Revert "Merge branch 'notice-routes' into 'develop'" 2021-12-26 11:02:51 -07:00
Lain Soykaf ac3b503721 CI: Fix the broken tasks. 2021-12-26 18:54:54 +01:00
Lain Soykaf c52390a7d9 CI: Use own package as base
So we can skip updating and installing the same packages a million
times. It will still grab the hex.pm stuff -- maybe we can find a way to
avoid this, too.
2021-12-26 18:05:42 +01:00
lain 3b8eaadb0d Merge branch 'erratic' into 'develop'
CI: Start testing erratic test again

See merge request pleroma/pleroma!3575
2021-12-26 16:35:09 +00:00
Lain Soykaf 7ed2258979 Update changelog 2021-12-26 17:00:09 +01:00
Lain Soykaf 4cf03046f5 Merge branch 'finch' of git.pleroma.social:pleroma/pleroma into finch 2021-12-26 16:57:17 +01:00
Lain Soykaf 6efbd08854 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into finch 2021-12-26 16:41:17 +01:00
Lain Soykaf e8e8d2262e CI: Start testing erratic test again
Erratic tests are now ran in their own task, so we don't block
normal testing. The runtime is under a minute, so even if this one
has to be retried, it shouldn't take forever.
2021-12-26 16:17:48 +01:00
Alex Gleason 2e2fb5f802 Merge branch 'ci-dont-retry' into 'develop'
GitLab CI: don't retry failed jobs

See merge request pleroma/pleroma!3574
2021-12-26 02:40:26 +00:00
Alex Gleason 913141379c Merge branch 'profile-directory' into 'develop'
MastoAPI: Profile directory

See merge request pleroma/pleroma!3573
2021-12-26 02:35:17 +00:00
marcin mikołajczak de006443f0 MastoAPI: Profile directory 2021-12-26 02:35:17 +00:00
Alex Gleason 0eb6e858f7 Merge branch 'notice-routes' into 'develop'
Add notice compatibility routes for other frontends

Closes #1785

See merge request pleroma/pleroma!3402
2021-12-26 02:33:28 +00:00
Alex Gleason cac4ed5eb0
GitLab CI: don't retry failed jobs 2021-12-25 20:15:21 -06:00
Alex Gleason 2c06eff519
Pleroma.Web.base_url() --> Endpoint.url() 2021-12-25 20:11:14 -06:00
Alex Gleason db2bf55e9b
Merge remote-tracking branch 'origin/develop' into notice-routes 2021-12-25 19:57:53 -06:00
Alex Gleason 73609211a4 Merge branch 'account-notes' into 'develop'
MastoAPI: Add user notes on accounts

See merge request pleroma/pleroma!3540
2021-12-25 01:41:12 +00:00
Alex Gleason b96a58ff28 Merge branch 'account-subscriptions' into 'develop'
MastoAPI: accept notify param in follow request

See merge request pleroma/pleroma!3555
2021-12-25 01:34:27 +00:00
Alex Gleason b4291bce8a Merge branch 'remote-follow-api' into 'develop'
remote_interaction API endpoint

See merge request pleroma/pleroma!3545
2021-12-25 01:32:47 +00:00
marcin mikołajczak 9775955974 Merge remote-tracking branch 'origin/develop' into remote-follow-api
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-12-25 00:52:02 +01:00
Alex Gleason 1fa616638b Merge branch 'warnings-as-errors' into 'develop'
Enable :warnings_as_errors for CI only

See merge request pleroma/pleroma!3474
2021-12-23 16:19:57 +00:00
Alex Gleason 2caade10df Merge branch 'add-nodeinfo-doc' into 'develop'
Add initial Nodeinfo document

See merge request pleroma/pleroma!3546
2021-12-23 16:01:03 +00:00
Hakaba Hitoyo 87871ac857 Add initial Nodeinfo document 2021-12-23 16:01:02 +00:00
Alex Gleason d9746ae4cb Merge branch 'from/develop/tusooa/2802-propagate-reject' into 'develop'
Handle Reject for already-accepted Follows properly

Closes #2766 and #2802

See merge request pleroma/pleroma!3568
2021-12-23 16:00:16 +00:00
Alex Gleason 05c7a14101 Merge branch 'moderators' into 'develop'
AdminAPI: let moderators actually do things

Closes #2490

See merge request pleroma/pleroma!3480
2021-12-22 16:37:35 +00:00
Alex Gleason 9c1cb87eff Merge branch 'erratic-tests' into 'develop'
Skip erratic tests

See merge request pleroma/pleroma!3572
2021-12-22 04:14:31 +00:00
Alex Gleason 2ce7dae6de
Skip erratic tests 2021-12-21 22:04:15 -06:00
Alex Gleason 3f8fc34593
Merge remote-tracking branch 'origin/develop' into moderators 2021-12-19 12:55:36 -06:00
Alex Gleason 50892a198d Merge branch 'mkljczk-develop-patch-64464' into 'develop'
Add "exposable_reactions" to features, if showing reactions

See merge request pleroma/pleroma!3523
2021-12-19 18:51:41 +00:00
Alex Gleason b0d2b53934 Merge branch 'manifest' into 'develop'
Expose /manifest.json for PWA

Closes #882

See merge request pleroma/pleroma!3544
2021-12-19 18:18:59 +00:00
Ivan Tashkinov e009950845 Slow queries logging improvements: added EXPLAIN results, listed params, improved stacktrace. 2021-12-19 20:45:28 +03:00
Alex Gleason df5359aa72 Merge branch 'replies-count' into 'develop'
Fix replies count for remote replies

See merge request pleroma/pleroma!3541
2021-12-19 17:36:25 +00:00
Alex Gleason d1510c98d7 Merge branch 'link-headers-chats' into 'develop'
Add link headers in ChatController.index2

See merge request pleroma/pleroma!3562
2021-12-19 17:35:50 +00:00
Alex Gleason 1ff9ffed83 Merge branch 'live-dashboard' into 'develop'
Add Phoenix LiveDashboard

See merge request pleroma/pleroma!3566
2021-12-19 17:35:14 +00:00
Alex Gleason e4f9cb1c1b
Merge remote-tracking branch 'origin/develop' into manifest 2021-12-19 11:33:10 -06:00
Alex Gleason bd853199d9 Merge branch 'v2-suggestions' into 'develop'
V2 suggestions

See merge request pleroma/pleroma!3547
2021-12-19 17:31:17 +00:00
Alex Gleason 7c1d804554 Merge branch 'fix-search-dos' into 'develop'
Search: limit number of results (prevent DoS)

See merge request pleroma/pleroma!3563
2021-12-19 17:30:52 +00:00
lain b686d68cdb Merge branch 'from/develop/tusooa/alpine-3.14' into 'develop'
Bump alpine to 3.14

See merge request pleroma/pleroma!3569
2021-12-18 15:04:55 +00:00
Tusooa Zhu ff17884c3b
Bump alpine to 3.14 2021-12-17 18:03:06 -05:00
Tusooa Zhu 8376e83f61
Lint 2021-12-17 16:52:50 -05:00
Tusooa Zhu 538d5ac210
Add changelog for https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3568 2021-12-17 16:47:48 -05:00
Tusooa Zhu 951d1592c7
Add test to ensure removed follower cease to have relationship with ex-followee
https://git.pleroma.social/pleroma/pleroma/-/issues/2802
2021-12-17 16:44:22 -05:00
Tusooa Zhu bfd870380c
Add test to ensure the blocked cease to have follow relationship to the blocker
https://git.pleroma.social/pleroma/pleroma/-/issues/2766
2021-12-17 14:44:28 -05:00
Tusooa Zhu 3d41ccc47b
Allow updating accepted follow activities in Web.ActivityPub.Utils.update_follow_state_for_all/2
Mastodon uses the Reject activity also for the purpose of removing
a follower, in addition to reject a follow request. We should
also update the original Follow activity in this case.
2021-12-17 14:17:51 -05:00
lain 8cfd527589 Merge branch 'verbose-emoji-loader' into 'develop'
emoji/loader.ex: be more verbose about which emoji pack config is loading now

See merge request pleroma/pleroma!3567
2021-12-17 14:35:01 +00:00
a1batross 31b9034a27 emoji/loader.ex: be more verbose about which emoji pack config is loading now
To avoid issue when one of the hundred JSON files is malformed and
administrator don't know which one
2021-12-17 14:15:44 +00:00
Mark Felder 5660bee2dc Dirty hack to make mediaproxy functional by relying on Hackney for that part 2021-12-16 11:36:58 -06:00
Alex Gleason e1b89fe3aa
Merge remote-tracking branch 'origin/develop' into live-dashboard 2021-12-15 19:05:36 -05:00
Alex Gleason 29d80b39f2
Add Phoenix LiveDashboard
Co-authored-by: Egor Kislitsyn <egor@kislitsyn.com>
2021-12-15 19:05:27 -05:00
lain 6eb7d69e60 Merge branch 'delete-account-fix' into 'develop'
TwitterAPI: allow deleting one's own account with request body

Closes #2799 and #2746

See merge request pleroma/pleroma!3564
2021-12-15 21:26:45 +00:00
Lain Soykaf 4e98ba3c3a Application: Actually start finch if it's needed 2021-12-15 15:42:37 -05:00
Lain Soykaf abb62dd886 Application, dependencies: prepare for finch 2021-12-15 13:53:09 -05:00
Alex Gleason 8672ad6b00
TwitterAPI: allow deleting one's own account with request body 2021-12-13 17:07:29 -05:00
Alex Gleason 108dfd1f87
Search: limit number of results 2021-12-12 22:50:07 -06:00
marcin mikołajczak dff435488d Add link headers in ChatController.index2
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-12-12 17:43:18 +01:00
lain fb0aa0661c Merge branch 'fix-attachment-dimensions' into 'develop'
Fix attachment dimensions

Closes #2794

See merge request pleroma/pleroma!3559
2021-12-09 16:05:06 +00:00
lain 60295b58f9 Merge branch 'benchmark-fixes' into 'develop'
Benchmarks: fix user timeline and tags benchmarks

See merge request pleroma/pleroma!3560
2021-12-09 15:38:26 +00:00
Alex Gleason d194b5b7fe
Benchmarks: fix user timeline and tags benchmarks 2021-12-08 11:54:41 -06:00
Alex Gleason 01cc099c8e
VideoHandlingTest: remove nil values 2021-12-07 21:55:54 -05:00
Haelwenn 992d9287d0 Apply alexgleason's suggestion(s) to 1 file(s) 2021-12-07 22:53:36 +00:00
Alex Gleason 2c96668a2c
Merge remote-tracking branch 'origin/develop' into fix-attachment-dimensions 2021-12-07 13:41:54 -05:00
Alex Gleason 335684182a
Fix VideoHandlingTest 2021-12-07 13:35:34 -05:00
lain b57041c59a Merge branch 'fixyfix' into 'develop'
Linting.

See merge request pleroma/pleroma!3558
2021-12-07 18:19:43 +00:00
Alex Gleason 3f03d71ea6
AttachmentValidator: ingest width and height 2021-12-07 12:59:03 -05:00
Lain Soykaf ca8c676867 Linting. 2021-12-07 12:12:23 -05:00
lain 500e126604 Merge branch 'pleroma-result-1_13' into 'develop'
move result into with guard

See merge request pleroma/pleroma!3557
2021-12-07 16:55:01 +00:00
lain e219e504ce Merge branch 'mix-lock' into 'develop'
Run `mix deps.get`

See merge request pleroma/pleroma!3556
2021-12-07 16:45:03 +00:00
Alex Gleason ab5dee84bf
Run `mix deps.get` 2021-12-07 10:03:31 -05:00
Finn Behrens 8af53101fb move result into with guard 2021-12-07 09:18:53 +01:00
Alex Gleason d9349bc52f
Transmogrifier: test fix_attachments/1 2021-12-07 01:10:47 -05:00
lain 613f55b078 Merge branch 'benchmark' into 'develop'
Fix benchmarks

See merge request pleroma/pleroma!3551
2021-12-06 21:16:30 +00:00
marcin mikołajczak c96e52b88c Add 'notifying' to relationship for compatibility with Mastodon
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-12-06 21:24:12 +01:00
marcin mikołajczak 3892bd353b Add test for following with subscription
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-12-06 21:15:03 +01:00
lain ab60c0c6c2 Merge branch 'optimisation/deactivated-subquery' into 'develop'
Make deactivated user check into a subquery

Closes #2792

See merge request pleroma/pleroma!3554
2021-12-06 19:55:52 +00:00
marcin mikołajczak 64a4c147b1 MastoAPI: accept notify param in follow request
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-12-06 19:36:58 +01:00
FloatingGhost db46913dcc make linter happy 2021-12-06 11:50:51 +00:00
FloatingGhost cd8bdbc761 Make deactivated user check into a subquery
Fixes #2792
2021-12-06 11:44:17 +00:00
Alex Gleason 949a53e327
Log Ecto queries > 500ms 2021-12-05 18:29:33 -05:00
Alex Gleason ce4560c2a1
Fix benchmarks 2021-12-03 16:20:54 -05:00
lain 5c573a8a28 Merge branch 'password-reset' into 'develop'
Restore POST /auth/password, fixes #2789

Closes #2789

See merge request pleroma/pleroma!3550
2021-12-03 15:13:10 +00:00
Alex Gleason ba2ed3c255
Fix frontend_status_plug_test.exs 2021-12-03 07:56:26 -06:00
Alex Gleason 8286ceb465
Merge remote-tracking branch 'origin/develop' into password-reset 2021-12-03 00:11:38 -06:00
Alex Gleason 5da4f33bf1
Restore POST /auth/password 2021-12-03 00:10:57 -06:00
lain 235c4139d7 Merge branch 'fix/2782-nodeinfo-active-users' into 'develop'
nodeinfo: report activeMonth and activeHalfyear users fields

Closes #2782

See merge request pleroma/pleroma!3536
2021-12-02 16:54:28 +00:00
marcin mikołajczak cd5fb84b76 remote_interaction API endpoint
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-12-02 16:08:44 +01:00
lain aaed93db27 Merge branch 'update-hackney' into 'develop'
Mix: upgrade Hackney to 1.18.0

Closes #2753

See merge request pleroma/pleroma!3549
2021-12-01 15:49:57 +00:00
lain d486d7d09e Merge branch 'force_pinned_objects_to_be_empty' into 'develop'
Force pinned_objects to be empty, not null

Closes #2788

See merge request pleroma/pleroma!3548
2021-11-29 18:08:10 +00:00
NEETzsche 182c563ed0 Force pinned_objects to be empty, not null 2021-11-29 18:08:09 +00:00
a1batross 809503011f Mix: upgrade Hackney to 1.18.0 2021-11-29 17:28:10 +00:00
marcin mikołajczak a9b0027071 Account endorsements
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-11-29 12:44:57 +01:00
Alex Gleason 6519f59d91
v2 Suggestions: return `is_suggested` through the API 2021-11-26 23:10:01 -06:00
Alex Gleason 8dc1d2201a
Instance: add v2_suggestions feature 2021-11-26 22:45:49 -06:00
Alex Gleason e5a7547fbe
v2 Suggestions: also filter out users you follow 2021-11-26 21:46:08 -06:00
Alex Gleason 437c1a5a52
v2 Suggestions: actually flter out dismissed suggestions 2021-11-26 21:09:37 -06:00
Alex Gleason aee55b9a8b
v2 Suggestions: dismiss a suggestion 2021-11-26 20:19:29 -06:00
Alex Gleason da06e1a17f
v2 Suggestions: add index on is_suggested column 2021-11-26 15:32:01 -06:00
Alex Gleason 6c0484d571
AdminAPI: suggest a user through the API 2021-11-26 15:19:01 -06:00
Alex Gleason e28d990ecb
v2 Suggestions: don't skip visibility check 2021-11-26 14:46:29 -06:00
Alex Gleason b17360cd7c
v2 Suggestions: rudimentary API response 2021-11-26 14:34:10 -06:00
Alex Gleason 7e1caddc58
v2 Suggestions: return empty array 2021-11-25 14:57:36 -06:00
Alex Gleason 720198d569
Merge remote-tracking branch 'pleroma/develop' into manifest 2021-11-24 17:58:58 -06:00
Alex Gleason cb9359335f
Expose /manifest.json for PWA 2021-11-24 17:50:55 -06:00
marcin mikołajczak d64d1b1d45 Fix replies count for remote replies
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-11-23 11:31:09 +01:00
rinpatch 588bcbac55 Apply 2 suggestion(s) to 2 file(s) 2021-11-22 10:54:44 +00:00
marcin mikołajczak 8e040e098b Lint
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-11-21 18:17:06 +01:00
marcin mikołajczak cb76faece9 Update test
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-11-21 17:51:00 +01:00
marcin mikołajczak 106b5c2678 Fix a typo
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-11-21 17:36:37 +01:00
marcin mikołajczak 40414bf177 MastoAPI: Add user notes on accounts
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-11-21 16:56:26 +01:00
Alibek Omarov efc28812b8 Add changelog entry 2021-11-17 00:39:10 +01:00
Haelwenn c97f99ccf2 Merge branch 'bugfix/markdown-newlines' into 'develop'
mix: Update earmark

See merge request pleroma/pleroma!3538
2021-11-16 13:54:34 +00:00
Haelwenn (lanodan) Monnier 5e15ceb49d mix: Update earmark
This should fix the presence of extraneous newlines in markdown output.

Related: https://github.com/pragdave/earmark/issues/406
2021-11-16 14:33:27 +01:00
lain add2b9cd8d Merge branch 'update-elixir' into 'develop'
CI: Upload the image for all platforms

See merge request pleroma/pleroma!3537
2021-11-15 20:17:38 +00:00
Lain Soykaf f78cb6ab9a CI: Upload the image for all platforms
For some reason the other platforms started failing, too. This
fixes it. Why? Don't know.
2021-11-15 21:04:43 +01:00
Alibek Omarov 04aca335aa nodeinfo: report activeMonth and activeHalfyear users fields 2021-11-15 17:01:30 +01:00
lain 4d341f51e1 Merge branch 'fix-tests' into 'develop'
Test fixes

See merge request pleroma/pleroma!3532
2021-11-15 14:31:27 +00:00
lain e2772d6bf1 Merge branch 'block-behavior' into 'develop'
Configurable block visibility, fixes #2123

Closes #2123

See merge request pleroma/pleroma!3242
2021-11-15 14:27:59 +00:00
lain 6e3df11693 Merge branch 'instance-deletion' into 'develop'
AdminAPI: endpoint to delete all content from a remote instance

See merge request pleroma/pleroma!3483
2021-11-15 14:24:13 +00:00
lain 6aff3d3204 Merge branch 'fix-object-deletion-timeout' into 'develop'
Fix Activity.delete_all_by_object_ap_id/1 timeout so users can be deleted

Closes #2704

See merge request pleroma/pleroma!3479
2021-11-15 13:21:42 +00:00
lain 838da53ea7 Merge branch 'bump/http_signatures-0.1.1' into 'develop'
mix: Update http_signatures to 0.1.1

See merge request pleroma/pleroma!3530
2021-11-15 11:58:49 +00:00
lain bd77243981 Merge branch 'userfeed-fe-fallback' into 'develop'
UserController: fall back to frontend when user isn't found

Closes #2730

See merge request pleroma/pleroma!3515
2021-11-15 10:48:56 +00:00
lain d058e1c978 Merge branch 'fix-releases' into 'develop'
CI: Conservatively update release images so they keep building.

See merge request pleroma/pleroma!3534
2021-11-14 20:35:10 +00:00
Lain Soykaf 5c7aa4a1e9 CI: Conservatively update release images so they keep building. 2021-11-14 20:37:32 +01:00
lain 0f8b10ff5a Merge branch 'bugfix/inbox-misleading-warning' into 'develop'
activity_pub_controller: Fix misleading debug warning in post_inbox_fallback

See merge request pleroma/pleroma!3531
2021-11-14 16:14:09 +00:00
lain eb0f7620f2 Merge branch 'update-crypt' into 'develop'
Mix: Update crypt to fix musl builds.

See merge request pleroma/pleroma!3533
2021-11-14 16:00:01 +00:00
Lain Soykaf 7dcc73f294 Mix: Update crypt to fix musl builds. 2021-11-14 16:04:08 +01:00
Lain Soykaf 871936b3ca MediaProxyCacheControllerTest: Fix unstable tests.
Cachex order isn't stable, so we can not depend on the order in
tests. This adds some sorting to make the tests stable.
2021-11-14 11:45:38 +01:00
Lain Soykaf 2dea4a8c04 StealEmojiPolicyTest: Make mocks explicit. 2021-11-14 11:44:24 +01:00
Lain Soykaf 26450a0be3 Mix: Upgrade mogrify library
The old library would modify a file on reading it, the new one
doesn't have this issue.
2021-11-14 11:43:39 +01:00
Haelwenn (lanodan) Monnier 23e91ec8dd activity_pub_controller: Fix misleading debug warning in post_inbox_fallback 2021-11-10 01:11:35 +01:00
Haelwenn (lanodan) Monnier e4ad4f0bd6 mix: Update http_signatures to 0.1.1 2021-11-10 00:53:32 +01:00
Haelwenn 6b5c2d5f86 Merge branch 'refactor/group_validator_fields' into 'develop'
object_validators: Group common fields in CommonValidations

See merge request pleroma/pleroma!3384
2021-10-10 08:57:11 +00:00
Haelwenn (lanodan) Monnier 23161526d4 object_validators: Group common fields in CommonValidations
Notes:
- QuestionValidator didn't have a :name field but that seems like a mistake
- `_fields` functions can't inherit others because of some Validators
- bto/bcc fields were absent in activities, also seems like a mistake
  (Well IIRC we don't or barely support bto/bcc anyway)
2021-10-10 02:50:06 +02:00
feld d8d819ddc7 Merge branch 'typo' into 'develop'
Fix typo

See merge request pleroma/pleroma!3528
2021-10-07 20:02:41 +00:00
Mark Felder 3af7db9fd7 Fix typo 2021-10-06 10:49:25 -05:00
Haelwenn fee2260633 Merge branch 'weblate-pleroma-pleroma' into 'develop'
Translations update from Weblate

See merge request pleroma/pleroma!3513
2021-10-06 06:26:55 +00:00
Ryo Ueno 5f2aefee1b Translated using Weblate (Japanese)
Currently translated at 21.6% (23 of 106 strings)

Translation: Pleroma/Pleroma backend
Translate-URL: https://translate.pleroma.social/projects/pleroma/pleroma/ja/
2021-10-06 06:12:17 +00:00
Ryo Ueno 84a7eb5597 Added translation using Weblate (Japanese) 2021-10-06 06:12:17 +00:00
Hồ Nhất Duy a84aa10f70 Translated using Weblate (Vietnamese)
Currently translated at 100.0% (106 of 106 strings)

Translation: Pleroma/Pleroma backend
Translate-URL: https://translate.pleroma.social/projects/pleroma/pleroma/vi/
2021-10-06 06:12:17 +00:00
Hồ Nhất Duy 3647c8e45b Added translation using Weblate (Vietnamese) 2021-10-06 06:12:17 +00:00
@liimee a3909f30b6 Translated using Weblate (Indonesian)
Currently translated at 64.1% (68 of 106 strings)

Translation: Pleroma/Pleroma backend
Translate-URL: https://translate.pleroma.social/projects/pleroma/pleroma/id/
2021-10-06 06:12:17 +00:00
@liimee f0d0d4f6e4 Translated using Weblate (Indonesian)
Currently translated at 61.3% (65 of 106 strings)

Translation: Pleroma/Pleroma backend
Translate-URL: https://translate.pleroma.social/projects/pleroma/pleroma/id/
2021-10-06 06:12:17 +00:00
@liimee f2806adeed Translated using Weblate (Indonesian)
Currently translated at 59.4% (63 of 106 strings)

Translation: Pleroma/Pleroma backend
Translate-URL: https://translate.pleroma.social/projects/pleroma/pleroma/id/
2021-10-06 06:12:17 +00:00
@liimee 4a15fd8a0a Translated using Weblate (Indonesian)
Currently translated at 55.6% (59 of 106 strings)

Translation: Pleroma/Pleroma backend
Translate-URL: https://translate.pleroma.social/projects/pleroma/pleroma/id/
2021-10-06 06:12:17 +00:00
@liimee bea8a204a9 Translated using Weblate (Indonesian)
Currently translated at 50.9% (54 of 106 strings)

Translation: Pleroma/Pleroma backend
Translate-URL: https://translate.pleroma.social/projects/pleroma/pleroma/id/
2021-10-06 06:12:17 +00:00
@liimee e00fe5b616 Translated using Weblate (Indonesian)
Currently translated at 4.7% (5 of 106 strings)

Translation: Pleroma/Pleroma backend
Translate-URL: https://translate.pleroma.social/projects/pleroma/pleroma/id/
2021-10-06 06:12:17 +00:00
@liimee 477d839444 Added translation using Weblate (Indonesian) 2021-10-06 06:12:17 +00:00
marcin mikołajczak 8467065aba Translated using Weblate (Polish)
Currently translated at 100.0% (104 of 104 strings)

Translation: Pleroma/Pleroma backend
Translate-URL: https://translate.pleroma.social/projects/pleroma/pleroma/pl/
2021-10-06 06:12:17 +00:00
Haelwenn 390ceb9f94 Merge branch 'ci/bump-elixir-lint' into 'develop'
CI: Bump lint stage to elixir-1.12

See merge request pleroma/pleroma!3488
2021-10-06 06:12:08 +00:00
Haelwenn (lanodan) Monnier a17910a6c6
CI: Bump lint stage to elixir-1.12
Elixir 1.12 changed formatting rules, this allows to avoid having to rollback to run `mix format`
2021-10-06 08:11:05 +02:00
Haelwenn bdaa7e5394 Merge branch 'bugfix/crypt-pragma' into 'develop'
mix: Update crypt to fix #pragma warning

Closes #2710

See merge request pleroma/pleroma!3527
2021-10-06 05:58:52 +00:00
Haelwenn 92a8ff59aa Merge branch 'from/develop/tusooa/add-remove-emails' into 'develop'
Allow users to remove their emails if instance does not need email to register

See merge request pleroma/pleroma!3522
2021-10-06 05:44:44 +00:00
Haelwenn d2d462748c Merge branch 'partev-develop-patch-72837' into 'develop'
fix a typo "Optionnal" -> "Optional"

See merge request pleroma/pleroma!3525
2021-10-06 05:41:06 +00:00
Haelwenn (lanodan) Monnier 3b20eddcf8
mix: Update crypt to fix #pragma warning
Closes: https://git.pleroma.social/pleroma/pleroma/-/issues/2710
2021-10-06 07:40:02 +02:00
Haelwenn d86b10a5e3 Merge branch 'dockerfix' into 'develop'
Docker fix

See merge request pleroma/pleroma!3526
2021-09-21 22:04:59 +00:00
Mark Felder 36df37e056 Update to newer buildx as current one can't be downloaded due to some Github error 2021-09-20 16:58:25 -05:00
partev ad5da6ae68 fix a typo "Optionnal" -> "Optional" 2021-09-12 15:31:49 +00:00
marcin mikołajczak 555d7d57c9 Add "exposable_reactions" to features, if showing reactions 2021-09-09 18:35:45 +00:00
Haelwenn 6b3842cf50 Merge branch 'remove/mastofe' into 'develop'
Remove MastoFE from Pleroma, fixes #2625

Closes #2625

See merge request pleroma/pleroma!3392
2021-09-07 16:41:53 +00:00
Tusooa Zhu 198250dcef
Allow users to remove their emails if instance does not need email to register 2021-09-05 21:27:02 -04:00
Haelwenn 6b1282a829 Merge branch 'small-cleanup' into 'develop'
Remove unused Logger

See merge request pleroma/pleroma!3521
2021-09-01 21:52:56 +00:00
Mark Felder 181282fb2e Remove unused Logger 2021-09-01 14:56:48 -05:00
Haelwenn 2e695dbe3b Merge branch 'chores/2.4.1-develop' into 'develop'
Mergeback: 2.4.1

Closes #2758

See merge request pleroma/pleroma!3520
2021-08-29 18:51:50 +00:00
Haelwenn 0b2119d4a7 Merge branch 'release/2.4.1' into 'stable'
Release: 2.4.1

See merge request pleroma/pleroma!3501
2021-08-29 18:48:53 +00:00
Sean King 3117c60997
Make suggested change for create_response 2021-08-29 07:25:54 -06:00
Sean King 2e59cdd80f
Fix aliases sorting 2021-08-29 07:22:03 -06:00
Sean King 33f063204e
Add unit test for Pleroma API app controller 2021-08-28 23:18:12 -06:00
Sean King d02cf7b0cd
Fix lint 2021-08-28 18:17:09 -06:00
Sean King a14e1c0003
Move GET /api/v1/apps to GET /api/v1/pleroma/apps 2021-08-28 18:02:36 -06:00
Sean King eab6291094
Require follow and read OAuth scopes for GET /api/v1/apps 2021-08-28 11:13:25 -06:00
Haelwenn (lanodan) Monnier 28a17c2dc7
Merge branch 'release/2.4.1' into chores/2.4.1-develop 2021-08-28 18:49:04 +02:00
Haelwenn (lanodan) Monnier 7372609c5b
Release 2.4.1 2021-08-28 18:32:21 +02:00
someone cc4f20b130
mix pleroma.database set_text_search_config now runs concurrently and infinitely
Backport of: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3514
2021-08-28 18:29:43 +02:00
Ilja 20084329ea
Selecting MRF policies didn't work as intended any more
* Policies were put under a new module (Pleroma.Web.ActivityPub.MRF.Policy instead of Pleroma.Web.ActivityPub.MRF), but this wasn't changed in the Pleroma.Web.ActivityPub.MRF @mrf_config_descriptions
* I don't have a unit test to prevent similar problems in the future because I don't find a proper way to do it
    * The descriptions in the unit tests are defined in the unit tests, so if someone changes module names in the code, the tests wont see it
    * The list is generated in Pleroma.Docs.Generator.list_behaviour_implementations, but I can't do a check in the when clause of the function to see if the provided module is a behaviour or not.

Backport of: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3509
2021-08-28 18:27:58 +02:00
Tusooa Zhu bd0eb1c675
Make activity search properly use GIN indexes
The original approach to search in GIN indexes is to use
`to_tsvector(text)` in the WHERE clause of the query. According to
postgres docs [pdoc], this method does not make use of the index,
while `to_tsvector(config, text)` does. This commit changed the
query to use the two-argument `to_tsvector()`.

[pdoc]: https://www.postgresql.org/docs/12/textsearch-tables.html

To obtain the search config in use, we make a query to the db first.
The `::regconfig::oid` hack is needed because Postgrex does not support
regconfig type directly [postgrexbug]. I use the conversion from and to
`oid` instead of `text` because I tested in the actual DB and querying
using the conversion via `text` is slow just as the one-argument
`to_tsvector()` variant.

[postgrexbug]: https://github.com/elixir-ecto/postgrex/issues/502

Backport of: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3519

Closes: https://git.pleroma.social/pleroma/pleroma/-/issues/2758
2021-08-28 18:26:04 +02:00
Ilja 53b0dd4ecc
List available frontends also when no static/frontends folder is present yet
* To see what front ends are installed, it ls static/frontends. When this folder doesn't exists yet, it will return an empty array.
* Installing still works since the folder is created during installation already

Backport of: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3510
2021-08-28 18:23:49 +02:00
Sam Therapy 09c42ce13e
Add Admin-FE menu for StealEmojiPolicy
Backport of: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3512
2021-08-28 18:21:59 +02:00
Haelwenn 689a59f41f Merge branch 'set_text_search_config_timeout' into 'develop'
mix pleroma.database set_text_search_config now runs concurrently and infinitely

See merge request pleroma/pleroma!3514
2021-08-28 16:11:52 +00:00
Haelwenn 26abe96abf Merge branch 'docs_add_yunohost_installation' into 'develop'
Add YunoHost to installation guides

See merge request pleroma/pleroma!3497
2021-08-28 16:09:55 +00:00
Haelwenn bc62a35282 Merge branch 'features/ingestion-no-nil' into 'develop'
ObjectValidator.stringify_keys: filter out nil values

See merge request pleroma/pleroma!3506
2021-08-28 16:07:35 +00:00
Haelwenn 6633ec816f Merge branch 'admin_fe_dont_list_mrf_policies_any_more' into 'develop'
Selecting MRF policies didn't work as intended any more

Closes admin-fe#198

See merge request pleroma/pleroma!3509
2021-08-28 16:06:35 +00:00
Haelwenn 018b0948de Merge branch 'from/develop/tusooa/2758-gin-index-search' into 'develop'
Make activity search properly use GIN indexes

Closes #2758

See merge request pleroma/pleroma!3519
2021-08-28 15:54:37 +00:00
Tusooa Zhu a80cb58ac1
Add changelog for !3519 2021-08-27 22:31:22 -04:00
Tusooa Zhu a9984c6da7
Make activity search properly use GIN indexes
The original approach to search in GIN indexes is to use
`to_tsvector(text)` in the WHERE clause of the query. According to
postgres docs [pdoc], this method does not make use of the index,
while `to_tsvector(config, text)` does. This commit changed the
query to use the two-argument `to_tsvector()`.

[pdoc]: https://www.postgresql.org/docs/12/textsearch-tables.html

To obtain the search config in use, we make a query to the db first.
The `::regconfig::oid` hack is needed because Postgrex does not support
regconfig type directly [postgrexbug]. I use the conversion from and to
`oid` instead of `text` because I tested in the actual DB and querying
using the conversion via `text` is slow just as the one-argument
`to_tsvector()` variant.

[postgrexbug]: https://github.com/elixir-ecto/postgrex/issues/502

BUG: https://git.pleroma.social/pleroma/pleroma/-/issues/2758
2021-08-27 22:27:17 -04:00
Sean King baa8196fc9
Fix API spec, add app schema 2021-08-26 11:55:43 -06:00
Sean King ba6914f90a
Fix formatting in app_operation.ex 2021-08-26 11:11:37 -06:00
Sean King 6519732045
GET /api/v1/apps endpoint 2021-08-25 21:01:04 -06:00
Alex Gleason b11dbbf403
UserController: fall back to frontend when user isn't found 2021-08-17 18:32:32 -05:00
someone 4b940e441a mix pleroma.database set_text_search_config now runs concurrently and infinitely 2021-08-15 13:49:12 -04:00
Haelwenn 84ec0fbeaa Merge branch 'show_frontends_also_when_no_static_frontends_folder_is_created_yet' into 'develop'
List available frontends also when no static/frontends folder is present yet

Closes admin-fe#201

See merge request pleroma/pleroma!3510
2021-08-14 18:42:12 +00:00
Ilja f9bafc17fb List available frontends also when no static/frontends folder is present yet
* To see what front ends are installed, it ls static/frontends. When this folder doesn't exists yet, it will return an empty array.
* Installing still works since the folder is created during installation already
2021-08-14 18:42:12 +00:00
Haelwenn 2d9f803dc6 Merge branch 'StealEmojiMRF_add_adminFE' into 'develop'
Add Admin-FE menu for StealEmojiPolicy

See merge request pleroma/pleroma!3512
2021-08-14 18:40:24 +00:00
Haelwenn 773708cfe8 Merge branch 'builder-note' into 'develop'
CommonAPI.Utils.make_note_data/1 --> ActivityPub.Builder.note/1

See merge request pleroma/pleroma!3511
2021-08-14 18:32:40 +00:00
Alex Gleason ba6049aa81
Builder.note/1: return {:ok, map(), keyword()} like other Builder functions 2021-08-14 11:24:55 -05:00
Sam Therapy b901b73057
Add Admin-FE menu for StealEmojiPolicy 2021-08-14 11:08:39 -05:00
Alex Gleason a2eacfc525
CommonAPI.Utils.make_note_data/1 --> ActivityPub.Builder.note/1 2021-08-14 11:01:06 -05:00
Ilja 5049b4272e Selecting MRF policies didn't work as intended any more
* Policies were put under a new module (Pleroma.Web.ActivityPub.MRF.Policy instead of Pleroma.Web.ActivityPub.MRF), but this wasn't changed in the Pleroma.Web.ActivityPub.MRF @mrf_config_descriptions
* I don't have a unit test to prevent similar problems in the future because I don't find a proper way to do it
    * The descriptions in the unit tests are defined in the unit tests, so if someone changes module names in the code, the tests wont see it
    * The list is generated in Pleroma.Docs.Generator.list_behaviour_implementations, but I can't do a check in the when clause of the function to see if the provided module is a behaviour or not.
2021-08-14 13:42:32 +02:00
Alex Gleason 01175ef498
Streamer: fix crash in MastodonAPI.StatusView
Backport of: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3508
2021-08-13 17:58:03 +02:00
Haelwenn (lanodan) Monnier 27e1e4c742
Activity.Search: fallback on status resolution on DB Timeout
Backport of: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3507
2021-08-13 17:57:50 +02:00
Alex Gleason e117551169
AdminAPI: hotfix for nil report objects
Backport of: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3504
2021-08-13 17:57:39 +02:00
Haelwenn (lanodan) Monnier bb2d5879cc
maybe_notify_subscribers: Don't create notifications from ingested replies
Backport of: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3505
2021-08-13 17:57:19 +02:00
Haelwenn (lanodan) Monnier 0e2aebd036
TwitterAPI: Make change_email require body params instead of query
Backport of: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3503
2021-08-13 17:57:11 +02:00
Haelwenn (lanodan) Monnier 3961422f85
TwitterAPI: Make change_password require body params instead of query
Backport of: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3503
2021-08-13 17:56:59 +02:00
Haelwenn (lanodan) Monnier 8baaa36a16
ObjectAgePolicy: Fix pattern matching on published
Backport of: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3500
2021-08-13 17:56:46 +02:00
Ilja 1cf89de89a
Make the OPT recomendation clearer
AFAIK OTP releases are the recomended way of installing, but

  * People seem unaware of that and use from source installations because they use the guide with the name of their distro
  * People don't know what OTP releases are or what it means

I added a warning on all installation-from-source guides and added the same explanation on the two OTP pages (the miigration to OTP and installing OTP)

Backport of: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3485
2021-08-13 17:56:20 +02:00
Haelwenn 97eb160c3e Merge branch 'weblate-pleroma-pleroma' into 'develop'
Translations update from Weblate

See merge request pleroma/pleroma!3491
2021-08-13 15:55:33 +00:00
kPherox 34606d609d
fix: stream out Create Activity
Backport of: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3499
2021-08-13 17:54:51 +02:00
marcin mikołajczak edd2a38e53 Translated using Weblate (Polish)
Currently translated at 98.0% (102 of 104 strings)

Translation: Pleroma/Pleroma backend
Translate-URL: https://translate.pleroma.social/projects/pleroma/pleroma/pl/
2021-08-13 15:42:21 +00:00
marcin mikołajczak 7a9113deb1 Translated using Weblate (Polish)
Currently translated at 75.0% (78 of 104 strings)

Translation: Pleroma/Pleroma backend
Translate-URL: https://translate.pleroma.social/projects/pleroma/pleroma/pl/
2021-08-13 15:42:21 +00:00
Haelwenn 61ba54897e Merge branch 'streamer-crash-fix' into 'develop'
Streamer crash fix

See merge request pleroma/pleroma!3508
2021-08-13 15:42:12 +00:00
Alex Gleason b7bbf42acd
Streamer: fix crash in MastodonAPI.StatusView 2021-08-13 10:25:42 -05:00
rinpatch 21720db859 Merge branch 'dkuku-develop-patch-66061' into 'develop'
Update dev.exs error message to write to stderr.

See merge request pleroma/pleroma!3492
2021-08-13 12:10:52 +00:00
rinpatch 7afabe1cc6 Merge branch 'bugfix/status-search-fallback' into 'develop'
Activity.Search: resolve status on DB Timeout

Closes #2566

See merge request pleroma/pleroma!3507
2021-08-13 12:09:39 +00:00
Haelwenn (lanodan) Monnier 6455b967ec
Activity.Search: fallback on status resolution on DB Timeout 2021-08-12 10:35:32 +02:00
Haelwenn 3a7b54be4a Merge branch 'nil-report-object-hotfix' into 'develop'
AdminAPI: hotfix for nil report objects

See merge request pleroma/pleroma!3504
2021-08-11 20:30:43 +00:00
Haelwenn (lanodan) Monnier 61d233921c
ObjectValidator.stringify_keys: filter out nil values 2021-08-11 21:38:10 +02:00
Haelwenn 3ca39ccf69 Merge branch 'bugfix/subscriptions-replies' into 'develop'
maybe_notify_subscribers: Normalize Object to check inReplyTo presence

Closes #2732

See merge request pleroma/pleroma!3505
2021-08-11 18:50:39 +00:00
Haelwenn (lanodan) Monnier 436fac3bac
maybe_notify_subscribers: Don't create notifications from ingested messages 2021-08-11 20:49:38 +02:00
Alex Gleason 7247c29653
AdminAPI: hotfix for nil report objects 2021-08-11 09:42:19 -05:00
Haelwenn 7c1243178b Merge branch 'bugfix/change_password' into 'develop'
TwitterAPI: Make change_password require body params instead of query

Closes #2740

See merge request pleroma/pleroma!3503
2021-08-10 18:40:13 +00:00
Haelwenn (lanodan) Monnier 197cdebca9
TwitterAPI: Make change_email require body params instead of query 2021-08-10 20:33:00 +02:00
Haelwenn 8679a57a71 Merge branch 'bugfix/object-age-create' into 'develop'
ObjectAgePolicy: Fix pattern matching on published

See merge request pleroma/pleroma!3500
2021-08-10 18:16:02 +00:00
Haelwenn (lanodan) Monnier 09dcb2b522
TwitterAPI: Make change_password require body params instead of query
Closes: https://git.pleroma.social/pleroma/pleroma/-/issues/2740
2021-08-10 20:01:11 +02:00
Haelwenn 6c0ebc65fd Merge branch 'docs_make_otp_recommendation_clearer' into 'develop'
Make the OPT recomendation clearer

See merge request pleroma/pleroma!3485
2021-08-10 06:09:31 +00:00
Ilja 438ad0d3f9 Make the OPT recomendation clearer
AFAIK OTP releases are the recomended way of installing, but

  * People seem unaware of that and use from source installations because they use the guide with the name of their distro
  * People don't know what OTP releases are or what it means

I added a warning on all installation-from-source guides and added the same explanation on the two OTP pages (the miigration to OTP and installing OTP)
2021-08-10 06:09:31 +00:00
Haelwenn (lanodan) Monnier c64eae40a2
ObjectAgePolicy: Fix pattern matching on published 2021-08-10 07:41:06 +02:00
Haelwenn f4af74b0fc Merge branch 'fix/streaming-api-for-create-activity' into 'develop'
fix: stream out Create Activity

Closes #2691

See merge request pleroma/pleroma!3499
2021-08-09 19:10:05 +00:00
Haelwenn 901204df22 Merge branch 'poll-notification' into 'develop'
MastodonAPI: Support poll notification

See merge request pleroma/pleroma!3484
2021-08-09 10:02:37 +00:00
Haelwenn 6384d78035 Merge branch 'simple_policy_reasons_for_instance_specific_policies' into 'develop'
Simple policy reasons for instance specific policies

See merge request pleroma/pleroma!3314
2021-08-09 09:37:59 +00:00
kPherox ee5def34da
fix: stream out Create Activity 2021-08-09 18:37:48 +09:00
Haelwenn c45b3bde94 Merge branch 'chores/2.4.0-develop' into 'develop'
Mergeback: 2.4.0

See merge request pleroma/pleroma!3494
2021-08-08 14:40:51 +00:00
Haelwenn dc63aaf84f Merge branch 'release/2.4.0' into 'stable'
Release/2.4.0

See merge request pleroma/pleroma!3493
2021-08-08 14:37:15 +00:00
Haelwenn (lanodan) Monnier 8f730f70cb
mix.exs: 2.4.50 2021-08-08 16:00:10 +02:00
Haelwenn (lanodan) Monnier 0910777d41
Update PleromaFE Bundle (2.4.0)
based on 51d3d8d255de221f7ac99e41f2f8e56c7d6a21a9
2021-08-08 15:21:21 +02:00
Ilja c29fc1aafb Add YunoHost to installation guides 2021-08-07 12:49:28 +02:00
Sean King 1841bd8383 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remove/mastofe 2021-08-06 08:08:20 -06:00
matildepark 469405b7b2
CHANGELOG.md: Fix instances of 2020 being actually 2021 2021-08-06 08:42:27 +02:00
Egor Kislitsyn ad09bdb376
Improve readability 2021-08-06 07:59:54 +02:00
Ilja ee26f2c91b
Quarantine placeholders
* kePlaceholder and valuePlaceholder of quarantined_instances where in wrong case, should be snake_case
* The mrf simple and transparency exclusion were already OK
2021-08-06 07:59:54 +02:00
Ilja cd706c0335
improve changelog entry 2021-08-06 07:59:54 +02:00
Ilja b0926a71b2
Make transparency_exclusions use tuples in admin-fe
* Make it use tuples
* I also changed the keys for key_placeholder and value_placeholder to use snake_case instead of camelCase
2021-08-06 07:59:53 +02:00
Ilja f4028c908c
Add key- and valuePlaceholders for quarantined_instances and mrf_simple
* I also added for keywordpolicy as well now. It was done in the admin-fe, but is better to be done here
* I also added comments to explain why we did the _info keys (backwards compatibility)
2021-08-06 07:59:53 +02:00
Ilja 9418424048
Add transparency_exclusions also to the breaking changes 2021-08-06 07:59:53 +02:00
Ilja 506bf16363
Change docs
* ./configuration/mrf.md
  * Change example
* ./configuration/cheatsheet.md
  * Change descriptions to include that a reason is given
* CHANGELOG.md
  * Add as breaking change
2021-08-06 07:59:53 +02:00
Ilja 03030b47c2
quarantine instances info
Added a new field in the nodeinfo called quarantined_instances_info
This holds an object like `"quarantined_instances_info":{"quarantined_instances":{"quar.inst":{"reason":"whatever reason"}}}}`
2021-08-06 07:59:53 +02:00
Ilja 47fc57bbcc
Change what nodeinfo returns without breaking backwards compatibility
* Only for SimplePolicy for now
* I added an extra mrf_simple_info key that has an object as value. The object contains only relevant extra info
2021-08-06 07:59:53 +02:00
Ilja 7fdc3cde06
Return maps in node_info
It's easiest (and imo most proper) to use tuples {"instance, "reason"} in BE,
but for FE maps like %{"instance": "instance", "reason", "reason"} are better.
I changed it so that node_info returns maps now for simple_policy and quarantined instances.
2021-08-06 07:59:53 +02:00
Ilja 1f52246a02
Add database migrations
* SimplePolicy
* quarentine
* transparency_exclusions
2021-08-06 07:59:53 +02:00
Ilja c0489f9fac
Fixed deprecation warning checks
When a setting was deprecated, the code would stop checking for the rest of the possible deprications. This also meant that the settings weren't rewritten to the new settings for deprecated settings besides the first one.
2021-08-06 07:59:53 +02:00
Ilja 64002e92ad
config/description.exs: Update quarantine settings to tuples 2021-08-06 07:59:53 +02:00
Ilja b674ba658b
make linter happy 2021-08-06 07:59:52 +02:00
Ilja 3c5a497b19
Deprecate transparency_exclusions
* Give deprecation message
* Rewrite configs
2021-08-06 07:59:52 +02:00
Ilja dfeb3862da
config :mrf, :transparency_exclusions works with tumples now 2021-08-06 07:59:52 +02:00
Ilja e0c7d77197
Deprecate and rewrite settings for quarentine settings
* This is for the settings, not yet a DB migration
2021-08-06 07:59:52 +02:00
Ilja 27fe7b0274
Make quarentine work with list of tuples instead of strings 2021-08-06 07:59:52 +02:00
Ilja dd947d9bc8
Add tests for setting `:instance, :quarantined_instances`
No test was done for quarantined instances yet. I added a factory for followers_only notes and checked
* That no followers only post is send when the target server is quarantined
* That a followers only post is send when the target server is not quarantined
2021-08-06 07:59:52 +02:00
Ilja 4ba0beb60c
Make mrfSimple work with tuples
* Changed SimplePolicy
* I also grepped in test/ for ':mrf_simple' to see what other things could be affected
2021-08-06 07:58:58 +02:00
Ilja 647087d7fd
Deprectate strings for SimplePolicy
When strings are detected in the simplepolicy, a warning will be given and the config will be changed to use tuples instead
2021-08-06 05:01:44 +02:00
Alex Gleason e311c60923
CHANGELOG: moderator abilities 2021-08-05 11:11:27 -05:00
Alex Gleason b83758bd96
Merge remote-tracking branch 'pleroma/develop' into moderators 2021-08-05 11:11:24 -05:00
Haelwenn 5f5dc24027 Merge branch 'staff-plug' into 'develop'
Moderators: add UserIsStaffPlug

See merge request pleroma/pleroma!3495
2021-08-05 05:51:22 +00:00
Alex Gleason 44ede0657f
Merge remote-tracking branch 'pleroma/develop' into staff-plug 2021-08-04 11:48:57 -05:00
Haelwenn (lanodan) Monnier 79e993cae5
Release 2.4.0 2021-08-01 08:26:39 +02:00
Haelwenn (lanodan) Monnier 5f8a9b671f
Update AdminFE bundle 2021-08-01 08:26:39 +02:00
Daniel 5c5571c668 use puts instead warn 2021-07-27 21:01:41 +00:00
Daniel 69ebfb29fb Update dev.exs error message to write to stderr. Currently it dumps this message at the beginnig of the file when using vim-autoformat with mix format 2021-07-27 20:41:36 +00:00
feld d8a986c9e8 Merge branch 'object-tombstone-visibility' into 'develop'
Visibility: check Tombstone objects in visible_for_user?/2

See merge request pleroma/pleroma!3490
2021-07-27 16:25:34 +00:00
feld 7495beeb40 Merge branch 'errorview-json-fix' into 'develop'
Fix errors in ErrorView

See merge request pleroma/pleroma!3489
2021-07-27 16:24:53 +00:00
Alex Gleason 7f23dd6cc8
Merge remote-tracking branch 'pleroma/develop' into object-tombstone-visibility 2021-07-27 08:54:26 -05:00
Alex Gleason 9cc8642b80
Visibility: check Tombstone objects in visible_for_user?/2 2021-07-27 08:54:01 -05:00
Alex Gleason 3d8ce61fe5
CHANGELOG: fixed JSON error rendering 2021-07-27 08:30:38 -05:00
Alex Gleason 33a19c002a
Merge remote-tracking branch 'pleroma/develop' into errorview-json-fix 2021-07-27 08:29:53 -05:00
Alex Gleason 94db0b7cd6
Add activity+json to Phoenix :format_encoders
Fixes ErrorView rendering
2021-07-27 08:28:52 -05:00
Haelwenn 7acdab1f30 Merge branch 'mkljczk-develop-patch-60115' into 'develop'
MastodonAPI: Fix list timelines

Closes mastofe#89 and #2693

See merge request pleroma/pleroma!3477
2021-07-22 18:41:11 +00:00
Alex Gleason 85d71d4f1d
CHANGELOG: Support `poll` notification type 2021-07-18 11:49:25 -05:00
Alex Gleason 62bf6d67e3
Merge remote-tracking branch 'pleroma/develop' into poll-notification-fixes 2021-07-18 11:49:22 -05:00
Alex Gleason 70f1496eb8
Poll notification: only notify local users 2021-07-18 11:10:23 -05:00
Alex Gleason 0b1c05ca1e
Poll notification: trigger PollWorker through common_pipeline 2021-07-18 11:10:23 -05:00
Alex Gleason 6a6e42c9bf
PollWorker defensive checks 2021-07-18 11:10:22 -05:00
Alex Gleason cbd1a10c16
Poll notification: notify for polls even when block_from_strangers is set 2021-07-18 11:10:04 -05:00
Alex Gleason 0114754db2
MastodonAPI: Support poll notification 2021-07-17 22:19:38 -05:00
Alex Gleason c4efe0d2d6
CHANGELOG: instance deletion 2021-07-17 15:05:20 -05:00
Alex Gleason 3674179b26
Merge remote-tracking branch 'pleroma/develop' into instance-deletion 2021-07-17 15:03:43 -05:00
Alex Gleason bad79f79e6
AdminAPI.InstanceController: clean up tests, rename actions 2021-07-17 15:00:15 -05:00
Alex Gleason 54dbcfe02a
AdminAPI: add DELETE /instances/:instance to delete all content from a remote instance 2021-07-17 14:55:05 -05:00
Alex Gleason f67d00d12b
Add Instance.delete_users_and_activities/1 to delete all content from a remote instance 2021-07-17 14:06:35 -05:00
Alex Gleason c136dc0987
Upgrade Ecto to v3.6.2, remove deprecated ecto_explain 2021-07-17 13:53:19 -05:00
Alex Gleason 25676c84be
Create AdminAPI.InstanceController 2021-07-17 13:05:25 -05:00
feld 3f58213646 Merge branch 'admin-api-users-sort' into 'develop'
AdminAPI: sort new users at the top

Closes #2709

See merge request pleroma/pleroma!3481
2021-07-14 14:39:14 +00:00
feld 17d79f3484 Merge branch 'admin-api-users-date' into 'develop'
AdminAPI: add created_at date to users

See merge request pleroma/pleroma!3482
2021-07-14 14:35:21 +00:00
Alex Gleason 117b3edf54
CHANGELOG: AdminAPI return date with users 2021-07-14 09:03:44 -05:00
Alex Gleason 1a2fe96d56
Merge remote-tracking branch 'pleroma/develop' into admin-api-users-date 2021-07-14 09:02:55 -05:00
Alex Gleason 167e14416b
AdminAPI: add date to users 2021-07-14 08:54:59 -05:00
Alex Gleason 5681a007d7
CHANGELOG: AdminAPI users sort 2021-07-13 22:48:32 -05:00
Alex Gleason deb3f91136
Merge remote-tracking branch 'pleroma/develop' into admin-api-users-sort 2021-07-13 22:47:47 -05:00
Alex Gleason 5e88796784
AdminAPI: sort user results by ID descending 2021-07-13 22:47:02 -05:00
Alex Gleason 2b3d7794b2
AdminAPI: let moderators actually do things 2021-07-12 22:26:04 -05:00
Alex Gleason 4fe9a758f9
Let moderators manage custom emojis 2021-07-12 22:11:38 -05:00
Alex Gleason 1f093cb216
Moderators: reorganize :admin_api pipeline in Router 2021-07-12 22:11:32 -05:00
Alex Gleason 9bc1e79c56
Moderators: add UserIsStaffPlug 2021-07-12 21:57:52 -05:00
Alex Gleason 65514484cc
CHANGELOG: fixed user deletion database timeout 2021-07-12 16:59:54 -05:00
Alex Gleason e40b58fd56
Merge remote-tracking branch 'pleroma/develop' into fix-object-deletion-timeout 2021-07-12 16:23:06 -05:00
Alex Gleason 9a0cb34c8c
Fix Activity.delete_all_by_object_ap_id/1 timeout so users can be deleted 2021-07-12 16:20:15 -05:00
Haelwenn 173e977e28 Merge branch 'features/ingestion-page' into 'develop'
Pipeline Ingestion: Page

See merge request pleroma/pleroma!3097
2021-07-12 05:05:49 +00:00
Haelwenn ebcc28fef0 Merge branch 'features/validators-apc2s' into 'develop'
AP C2S: Remove restrictions and make it go through pipeline

See merge request pleroma/pleroma!3203
2021-07-12 05:01:36 +00:00
Haelwenn (lanodan) Monnier 6dc78f5f6f
AP C2S: Remove restrictions and make it go through pipeline 2021-07-12 06:49:41 +02:00
Sean King 9758f636b2 Delete MastoFE Controller Test 2021-07-10 11:13:25 -06:00
Sean King 5d279a22b1 Merge develop branch upstream 2021-07-10 11:04:16 -06:00
feld aa9a6c3c05 Merge branch 'update/linkify' into 'develop'
Update Linkify

See merge request pleroma/pleroma!3478
2021-07-08 17:44:52 +00:00
Mark Felder 64d009693e Update Linkify to fix crash on posts with a URL we failed to parse correctly 2021-07-08 12:33:17 -05:00
feld 9e1da4bf58 Merge branch 'remote-deletions' into 'develop'
Fix user deletion problems

See merge request pleroma/pleroma!3476
2021-07-06 20:05:05 +00:00
marcin mikołajczak 6ef8e1776d fix the fucking list timelines on mastofe/soapbox-fe 2021-07-02 13:03:41 +00:00
Alex Gleason 310ef6b70d
Deletions: change User.purge/1 to defp, add CHANGELOG entry 2021-06-30 12:25:20 -05:00
Alex Gleason 99cc26bb02
Merge remote-tracking branch 'pleroma/develop' into remote-deletions 2021-06-30 02:02:30 -05:00
Alex Gleason beb1c98ab5
Deletions: don't purge keys so Delete/Undo activities can be signed 2021-06-30 02:02:24 -05:00
Alex Gleason 43800d83f4
Deletions: allow deactivated users to be deleted 2021-06-30 01:32:28 -05:00
Alex Gleason a7929c4d89
Deletions: preserve account status fields during purge, fix checks 2021-06-29 23:56:19 -05:00
Alex Gleason 01c2d2a296
Also purge the user in User.perform/2 2021-06-29 22:53:33 -05:00
Alex Gleason c6d4133727
Deletions: purge the user immediately 2021-06-29 22:30:48 -05:00
Alex Gleason be2da95c36
Correctly purge a remote user 2021-06-29 21:45:38 -05:00
Haelwenn 5717256eba Merge branch 'fix-2686' into 'develop'
Activity deletion: fix FunctionClauseError, fixes #2686

Closes #2686

See merge request pleroma/pleroma!3475
2021-06-25 04:52:19 +00:00
Alex Gleason 281806de75
Activity deletion: fix FunctionClauseError #2686 2021-06-24 21:03:31 -05:00
feld f97f305d00 Merge branch 'ecto-upgrade' into 'develop'
Upgrade Ecto to v3.6.2, remove deprecated ecto_explain

See merge request pleroma/pleroma!3473
2021-06-23 20:17:01 +00:00
Alex Gleason 079afd32d8
Enable :warnings_as_errors for CI only 2021-06-23 14:33:40 -05:00
Alex Gleason 54af527759
Upgrade Ecto to v3.6.2, remove deprecated ecto_explain 2021-06-23 13:22:32 -05:00
Haelwenn f9ae7e72e9 Merge branch 'bugfix/upload-limit-plug' into 'develop'
Downgrade Plug to 1.10.x, revert upload_limit tuple to function change

See merge request pleroma/pleroma!3472
2021-06-22 23:27:32 +00:00
feld a814671e85 Merge branch 'docs/dependencies-rewrite' into 'develop'
Rewrite docs related to dependencies

See merge request pleroma/pleroma!3466
2021-06-22 16:52:19 +00:00
Haelwenn (lanodan) Monnier fc6ab78a84
Add test on changing [:instance, :upload_limit] 2021-06-22 12:25:25 +02:00
Haelwenn (lanodan) Monnier a851a24036
Downgrade Plug to 1.10.x, revert upload_limit tuple to function change
This should fix setting the upload limit in the database as found in:
https://queer.hacktivis.me/notice/A8XUZp74Cg7eYNEMxU

This reverts commit 7d350b73f5.
2021-06-22 11:19:13 +02:00
Haelwenn a8adc300d4 Merge branch 'cycles-ci-skip' into 'develop'
Cycles CI: skip unless Elixir code is modified

See merge request pleroma/pleroma!3467
2021-06-11 22:25:41 +00:00
Alex Gleason 640e1cf09d
Cycles CI: skip unless Elixir code is modified 2021-06-11 08:45:19 -05:00
Haelwenn (lanodan) Monnier 822196f393
docs/…/opt_en.md: Reuse /main/ repository url for the /community/ repo 2021-06-11 08:48:35 +02:00
Haelwenn (lanodan) Monnier 17f980e9ab
docs: Remove Erlang Solutions repository 2021-06-11 08:48:35 +02:00
Haelwenn (lanodan) Monnier 6b1f7f2f52
docs: Use one file to describe dependencies 2021-06-11 08:48:35 +02:00
feld 406dadb56b Merge branch 'fix/twittercard-video-dimensions' into 'develop'
Generate Twittercard/OGP metadata with correct dimensions

See merge request pleroma/pleroma!3456
2021-06-10 15:03:58 +00:00
Mark Felder 202ee5fd77 Add note about video thumbnails for code spelunkers unfamiliar with Media Preview Proxy 2021-06-10 09:56:43 -05:00
feld b84873d3df Merge branch 'cycles-ci' into 'develop'
Prevent compile-time cycles in CI

See merge request pleroma/pleroma!3420
2021-06-09 19:04:40 +00:00
Alex Gleason 15e2aaa9f6
Fix compile cycle in Pleroma.Tests.AuthTestController 2021-06-09 13:30:19 -05:00
Alex Gleason 87cd04fe0c
Cycles CI: disable cache 2021-06-09 13:12:33 -05:00
Alex Gleason cefb952dff
CI: echo $MIX_ENV 2021-06-09 13:08:24 -05:00
Alex Gleason 4bb578a1d7
Add cycles test to .gitlab-ci.yml
Thank you @jb55@bitcoinhackers.org for the awk syntax
2021-06-09 13:06:01 -05:00
feld 3972d7117e Merge branch 'refactor/ingestion-activity-context' into 'develop'
ObjectValidators.{Announce,EmojiReact,Like}: Fix context, actor & addressing

See merge request pleroma/pleroma!3462
2021-06-09 17:17:41 +00:00
feld 489b8bea9a Merge branch 'eblurhash-hex' into 'develop'
Use eblurhash 1.1.0 from Hex

See merge request pleroma/pleroma!3464
2021-06-09 17:08:37 +00:00
Mark Felder 6aa7fc15df Formatting of the comment 2021-06-09 11:58:51 -05:00
Mark Felder d12e62c0b6 Add new Twittercard/OGP changes 2021-06-09 11:56:54 -05:00
Mark Felder f37db23848 Test that videos only get image thumbnails in OGP metadata when we can produce them with Preview Proxy 2021-06-09 11:46:31 -05:00
Mark Felder 5f7901cc48 Credo 2021-06-09 11:09:14 -05:00
Mark Felder 2a47156b87 Lint 2021-06-09 11:06:53 -05:00
Mark Felder 86bcb87e6c Fix incorrectly ordered arguments to the function and not properly merging lists. 2021-06-09 11:05:24 -05:00
Mark Felder dc8fe91dec Metadata.Utils.attachment_url/1 was used in this test too 2021-06-09 10:06:44 -05:00
Mark Felder 2cf648d419 Add a video thumbnail to the OpenGraph metadata if Media Preview Proxy is enabled. 2021-06-09 10:02:41 -05:00
Mark Felder 19a49dd757 Remove Metadata.Utils.attachment_url/1
This was a wasteful shortcut to MediaProxy.preview_url/1 and we don't
always want the preview_url in the metadata anyway.
2021-06-09 09:58:29 -05:00
Alex Gleason d0147eba78
Use eblurhash 1.1.0 from Hex 2021-06-09 09:28:22 -05:00
Haelwenn (lanodan) Monnier c839078a75
ObjectValidators.{Announce,EmojiReact,Like}: Fix context, actor & addressing 2021-06-09 04:23:02 +02:00
Haelwenn 53cf801c30 Merge branch 'cycles-plug-deps' into 'develop'
Refactor skipped plugs into Pleroma.Web functions

See merge request pleroma/pleroma!3463
2021-06-09 02:20:00 +00:00
Haelwenn eba3c7b42f Merge branch 'cycles-side-effects' into 'develop'
Recompilation speedup: Switch to runtime deps in ActivityPub.SideEffects

See merge request pleroma/pleroma!3460
2021-06-09 01:54:38 +00:00
Haelwenn d8c964fc1f Merge branch 'cycles-instances' into 'develop'
Recompilation speedup: Switch to runtime deps in Pleroma.Instances

See merge request pleroma/pleroma!3459
2021-06-09 01:53:31 +00:00
Alex Gleason 45b7325b9e
Refactor skipped plugs into Pleroma.Web functions
Speeds up recompilation by reducing compile cycles
2021-06-08 19:15:04 -05:00
Alex Gleason 67ec0e6c18
Switch to runtime deps in ActivityPub.SideEffects
Speeds up recompilation by reducing compile cycles
2021-06-08 18:18:25 -05:00
Alex Gleason 45ab24f2d9
Switch to runtime deps in Pleroma.Instances
Speeds up recompilation by limiting compile cycles
2021-06-08 18:03:34 -05:00
Mark Felder 9cb8960284 Switch OGP default type from "website" to "article"
This is what Mastodon uses and might fix some link preview bugs I've encountered
2021-06-08 17:14:30 -05:00
feld d896e45faf Merge branch 'cycles-config-loader-redux' into 'develop'
Recompilation speedup: Ignore runtime deps in Pleroma.Config.Loader with Module.concat/1

See merge request pleroma/pleroma!3458
2021-06-08 22:08:37 +00:00
feld 4de2bd3b79 Merge branch 'cycles-user-view' into 'develop'
Recompilation speedup: Create AdminAPI.UserView to avoid compile-time dep

See merge request pleroma/pleroma!3457
2021-06-08 22:07:25 +00:00
Mark Felder d70db63084 Set the correct height/width if the data is available when generating opengraph metadata 2021-06-08 16:58:33 -05:00
Alex Gleason 4faeec2c44
Create AdminAPI.UserView to avoid compile-time dep
Speeds up recompilation
2021-06-08 16:34:06 -05:00
Mark Felder aa8cc4e86e Only use fallback for videos and only add this metadata for images if we really have it. 2021-06-08 16:31:12 -05:00
Mark Felder d4ac9445cd Twittercard metadata for images should also include dimensions if available 2021-06-08 16:19:12 -05:00
Alex Gleason 1be14cc45f
Ignore runtime deps in Pleroma.Config.Loader with Module.concat/1
Speeds up recompilation
2021-06-08 16:07:51 -05:00
Mark Felder 5de65ce3e8 Set the correct height/width if the data is available when generating twittercard metadata 2021-06-08 15:59:55 -05:00
feld 1175023687 Merge branch 'metadata-for-all' into 'develop'
Support metadata for video files too

See merge request pleroma/pleroma!3441
2021-06-08 20:30:55 +00:00
Mark Felder 3121ed1325 Blurhash varies slightly by computer generating it, so just validate it wasn't nil 2021-06-08 14:53:03 -05:00
feld 939b3bfe43 Merge branch 'improve-og-embed' into 'develop'
Improve opengraph embeds

See merge request pleroma/pleroma!3442
2021-06-08 19:26:17 +00:00
Mark Felder f1abe39f6f Update test names and verify blurhash is correctly generated for images 2021-06-08 14:05:13 -05:00
Mark Felder 1c4c73c6a0 Add test for AnalyzeMetadata upload filter fetching dimensions from a video 2021-06-08 14:02:56 -05:00
feld 5667c02fce Merge branch 'cycles-params' into 'develop'
Recompilation speedup: break out Pleroma.Web.Params.truthy_param?/1 from ControllerHelper

See merge request pleroma/pleroma!3449
2021-06-08 18:06:44 +00:00
Mark Felder 8443f82247 Update scope of AnalyzeMetadata features 2021-06-08 12:56:03 -05:00
Mark Felder 5c27578bce Support metadata for video files too 2021-06-08 12:54:09 -05:00
Alex Gleason b99f60615c Fix order of Pleroma.Web.Utils.Params aliases 2021-06-08 12:50:47 -05:00
Alex Gleason ec65b7ae29 Pleroma.Web.Params --> Pleroma.Web.Utils.Params 2021-06-08 12:50:47 -05:00
Alex Gleason 0877b120c3 Pleroma.Web.ControllerHelper.truthy_param?/1 --> Pleroma.Web.Params.truthy_param?/1
Breaks cycle in lib/pleroma/web/api_spec/operations/status_operation.ex
2021-06-08 12:50:47 -05:00
feld 99f8605582 Merge branch 'cycles-uploads' into 'develop'
Recompilation speedup: use generic types in @spec in Upload.Filter

See merge request pleroma/pleroma!3453
2021-06-08 17:49:24 +00:00
feld ac2ed19e4f Merge branch 'cycles-authenticator' into 'develop'
Recompilation speedup: create WrapperAuthenticator and simplify Authenticator behaviour

See merge request pleroma/pleroma!3454
2021-06-08 17:45:10 +00:00
Alex Gleason 1399b82f7b
Create WrapperAuthenticator and simplify Authenticator behaviour
Speeds up recompilation by reducing compile-time cycles
2021-06-07 18:18:39 -05:00
Alex Gleason bdaa1d4512
Upload.Filter: use generic types in @spec
Speeds up recompilation by reducing compile-time deps
2021-06-07 17:11:17 -05:00
feld 4a6b49d0b4 Merge branch 'fix/config-test-warning' into 'develop'
Fix test warnings

See merge request pleroma/pleroma!3452
2021-06-07 21:22:23 +00:00
feld 30943b739d Merge branch 'pleromapi' into 'develop'
Add Raspberry Pi install instructions

See merge request pleroma/pleroma!3430
2021-06-07 21:21:35 +00:00
feld 371463ef0e Merge branch 'cycles-guard' into 'develop'
Recompilation speedup: Put custom guards in Web.Utils.Guards

See merge request pleroma/pleroma!3451
2021-06-07 21:21:10 +00:00
Mark Felder 017f947fc1 Channel name was incorrect. We left it as chat:public for backwards compatibility. 2021-06-07 16:10:24 -05:00
Mark Felder a5ae0432ed Test was named incorrectly and did not execute 2021-06-07 16:09:47 -05:00
Mark Felder f5ef7fe43b Fix test warnings 2021-06-07 16:06:53 -05:00
Alex Gleason d87dfcb5f0
Put custom guards in Web.Utils.Guards
Speeds up recompilation by removing a compile-time cycle on AdminAPI.Search
2021-06-07 15:51:52 -05:00
Mark Felder 264458531a Formatting 2021-06-07 15:47:50 -05:00
feld b553bfd745 Merge branch 'fix/prune-hashtags' into 'develop'
get prune_objects to work again

See merge request pleroma/pleroma!3397
2021-06-07 20:11:45 +00:00
feld 676c3c96dc Merge branch 'cycles-mrf-policy' into 'develop'
Recompilation speedup: create MRF.Policy behaviour separate from MRF module

See merge request pleroma/pleroma!3450
2021-06-07 20:10:20 +00:00
feld 9a357d63f0 Update CHANGELOG.md 2021-06-07 20:07:59 +00:00
feld 10abbf13ba Update CHANGELOG.md 2021-06-07 20:07:27 +00:00
feld 84f42b92f0 Merge branch 'develop' into 'fix/prune-hashtags'
# Conflicts:
#   CHANGELOG.md
2021-06-07 20:06:36 +00:00
feld 4ca380490f Update CHANGELOG.md 2021-06-07 20:05:18 +00:00
feld c31338abe6 Update CHANGELOG.md 2021-06-07 20:04:27 +00:00
feld bc51dea425 Update lib/mix/tasks/pleroma/database.ex 2021-06-07 20:02:28 +00:00
feld 64bc0c69ed Merge branch 'fix/plug_parser_multipart' into 'develop'
web endpoint: Use Config.get directly instead of a tuple

See merge request pleroma/pleroma!3445
2021-06-07 19:58:37 +00:00
Alex Gleason 6fcfa33e4e
Fix MRF.config_descriptions/0 2021-06-07 14:52:57 -05:00
Alex Gleason fe4c4a7178
MRF: create MRF.Policy behaviour separate from MRF module
Speeds up recompilation by reducing compile-time deps
2021-06-07 14:22:08 -05:00
feld ca1eac01dd Merge branch 'notification-settings-docs-fix' into 'develop'
Docs: /api/v1/pleroma/notification_settings --> /api/pleroma/notification_settings

See merge request pleroma/pleroma!3448
2021-06-07 17:03:51 +00:00
feld 96e85ea687 Merge branch 'cycles-reverse-proxy' into 'develop'
Recompilation speedup: create Dynamic client for ReverseProxy

See merge request pleroma/pleroma!3440
2021-06-07 17:03:19 +00:00
Alex Gleason 879c2db0bd
Docs: /api/v1/pleroma/notification_settings --> /api/pleroma/notification_settings 2021-06-07 11:18:14 -05:00
Alex Gleason 3be08e7c2e
Merge remote-tracking branch 'pleroma/develop' into cycles-reverse-proxy 2021-06-04 21:12:37 -05:00
Alex Gleason 1c3fe43d23
ReverseProxy: create Client.Wrapper to call client from config
Speeds up recompilation by reducing compile-time cycles
2021-06-04 21:12:24 -05:00
Sean King 26d2c677b7
Removing trailing space on empty line in OAuth controller 2021-06-04 15:50:57 -06:00
Sean King 2e310b3ec8
Fix more build errors 2021-06-04 15:06:55 -06:00
feld 94687e2393 Merge branch 'chore/otp24-changelog' into 'develop'
Document OTP 24 support

See merge request pleroma/pleroma!3447
2021-06-04 20:57:28 +00:00
feld 5b9e13fc0d Merge branch 'fix/clear_config_warning' into 'develop'
Fix warning for misuse of clear_config/2

See merge request pleroma/pleroma!3446
2021-06-04 20:55:21 +00:00
Sean King 839c2c6a12
Fix code mistake in OAuth controller 2021-06-04 14:50:16 -06:00
Mark Felder eb150e7d88 Document OTP 24 support so we remember to add it to the official release notes / announcement 2021-06-04 15:50:10 -05:00
Mark Felder d5daf59f88 Fix warning for misuse of clear_config/2
The old warning message was producing an improperly formatted suggestion.
2021-06-04 15:48:26 -05:00
Sean King dc4814f0cd
Fix merge conflicts with upstream 2021-06-04 14:42:44 -06:00
Haelwenn 0c56f9de0d Merge branch 'tests/openapi-everywhere' into 'develop'
Put OpenAPI ~everywhere in tests

See merge request pleroma/pleroma!3324
2021-06-04 18:53:09 +00:00
Haelwenn (lanodan) Monnier eb7313b0d3
Pipeline Ingestion: Page 2021-06-04 20:06:33 +02:00
Haelwenn (lanodan) Monnier 7d350b73f5
web endpoint: Use Config.get directly instead of a tuple
Fixes a lot of warnings like the following while running the testsuite:

  warning: passing a {module, function, args} tuple to Plug.Parsers.MULTIPART is deprecated. Please see Plug.Parsers.MULTIPART module docs for better approaches to configuration

This might mean no more dynamic configuration but there seems to be the same limitation two lines underneath anyway.
2021-06-04 20:04:30 +02:00
feld a07310888f Merge branch 'fix/missing-deprecation' into 'develop'
Add missing deprecation warning left out of !2842

See merge request pleroma/pleroma!3444
2021-06-04 17:37:30 +00:00
feld 922f4e3fb7 Merge branch 'bugfix/erlang-24' into 'develop'
Erlang 24 compatibility

Closes #2647

See merge request pleroma/pleroma!3405
2021-06-04 17:36:36 +00:00
Mark Felder f58928cf1c Add missing deprecation warning left out of !2842 2021-06-04 12:30:10 -05:00
io 2c401dafa1 Improve opengraph embeds
This brings them more in line with Mastodon.
- Deduplicates display name from the title and content
- Removes arbitrary limits on the size of the embedded image
- Removes angled double quotes from embed descriptions. These would normally just indicate that the content is a quote, but that is already implied by the content being in an embed.
2021-06-04 05:33:35 +00:00
Haelwenn (lanodan) Monnier 11844084d0
MIME.valid?(type) → is_bitstring(type) && MIME.extensions(type) != []
Since mime 1.6.0:

  warning: MIME.valid?/1 is deprecated. Use MIME.extensions(type) != [] instead

As for the bitstring(type) part it's because MIME.extensions only expects a string.
https://github.com/elixir-plug/mime/issues/43
2021-06-03 19:11:17 +02:00
Haelwenn (lanodan) Monnier 24d66b60a0
request_builder_test: mode :read got removed 2021-06-03 19:11:17 +02:00
Haelwenn (lanodan) Monnier 5c3a0dd26e
factory: Fix article_factory 2021-06-03 19:11:16 +02:00
Haelwenn (lanodan) Monnier 7c5e007b9c
mix: Update pot to ~> 1.0 2021-06-03 19:11:16 +02:00
Haelwenn (lanodan) Monnier ab32ea44f0
mix.exs: Apply OTP24 fixes to web_push_encryption 2021-06-03 19:11:16 +02:00
Haelwenn (lanodan) Monnier 2768063387
mix: Update dependencies 2021-06-03 19:11:16 +02:00
Haelwenn (lanodan) Monnier 168687eef2
media_proxy: switch from :crypto.hmac to :crypto.mac 2021-06-03 19:11:15 +02:00
Haelwenn (lanodan) Monnier 166455c884
mix: Switch hackney & gun to releases 2021-06-03 19:10:47 +02:00
Haelwenn (lanodan) Monnier 59af07f149
Update all dependencies 2021-06-03 19:10:47 +02:00
Haelwenn a5dce42c85 Merge branch 'chore/rename-chat' into 'develop'
Rename the non-federating Chat feature to Shout

See merge request pleroma/pleroma!2842
2021-06-03 15:52:16 +00:00
rinpatch 194a41611b Merge branch 'chore/cicd_skip_nonsense' into 'develop'
Skip CI/CD automatically under certain conditions

See merge request pleroma/pleroma!3439
2021-06-02 17:18:10 +00:00
Mark Felder 9f391da73d Don't generate new specs unless they've changed. 2021-06-02 12:09:41 -05:00
Mark Felder e06466a532 Skip build, test, analysis/lint when we don't make code changes 2021-06-02 12:03:34 -05:00
feld 275af29302 Merge branch 'Snow-develop-patch-01683' into 'develop'
Update docs/description for allow_relay

See merge request pleroma/pleroma!3438
2021-06-02 16:53:37 +00:00
Mark Felder 679d4c23e9 Update wording for relays in docs and config description 2021-06-02 11:30:09 -05:00
Mark Felder 297feb73f4 Formatting 2021-06-02 11:21:04 -05:00
feld e8de1005f2 Merge branch 'cycles-email' into 'develop'
Recompilation speedup: Avoid `use Phoenix.Swoosh` to prevent recompiling the Endpoint

See merge request pleroma/pleroma!3436
2021-06-02 16:11:49 +00:00
Mark Felder dcf84ac12e disableChat / disableShout didn't actually do anything for PleromaFE 2021-06-01 16:53:32 -05:00
Alex Gleason 028017711c
Merge remote-tracking branch 'pleroma/develop' into cycles-email 2021-06-01 16:17:43 -05:00
Alex Gleason 9879c18548
Avoid `use Phoenix.Swoosh` to prevent recompiling the Endpoint
Speeds up recompilation by fixing cycles in UserEmail
2021-06-01 16:17:03 -05:00
feld 3fe6ada6fc Merge branch 'cycles-streaming' into 'develop'
Recompilation speedup: Remove deps from Streaming/Persisting behaviors

See merge request pleroma/pleroma!3434
2021-06-01 19:41:37 +00:00
feld dea035dc49 Merge branch 'cycles-uploader' into 'develop'
Recompilation speedup: Remove deps from Uploader behaviour

See merge request pleroma/pleroma!3435
2021-06-01 19:39:36 +00:00
Mark Felder 0be7eada92 Keep original Shoutbox channel name as chat:public
There is no sane / high level workaround for merging users who join shout:public and chat:public.
2021-06-01 14:34:13 -05:00
Alex Gleason f6d2bd738d
Merge remote-tracking branch 'pleroma/develop' into cycles-uploader 2021-06-01 14:20:31 -05:00
Alex Gleason 8a5ceb7e53
Remove deps from Uploader behaviour
Speeds up recompilation by limiting compile-time deps
2021-06-01 14:19:45 -05:00
Alex Gleason 708210b994
Merge remote-tracking branch 'pleroma/develop' into cycles-streaming 2021-06-01 13:56:40 -05:00
Alex Gleason a744c47e9a
Remove deps from Streaming/Persisting behaviors
Speeds up recompilation by limiting compile-time deps
2021-06-01 13:55:07 -05:00
Mark Felder 2743c66693 Add "chat" back as a feature for backwards compat.
Legacy PleromaFE uses this to identify if ShoutBox is available.
2021-06-01 13:17:50 -05:00
Mark Felder 48a0ea2fc3 Wire up join requests to the old "chat:public" channel into the new "shout:public" channel 2021-06-01 11:56:51 -05:00
Mark Felder d9513b11d3 Forgot to move migration test when rebasing 2021-06-01 11:49:47 -05:00
Mark Felder 9ce2c017c0 We want clear_config/2 in all tests now 2021-06-01 11:49:47 -05:00
Roman Chvanikov d7dfa6d27c Update test for RenameInstanceChat migration 2021-06-01 11:49:47 -05:00
Roman Chvanikov e0bb655773 Add RenameInstanceChat migration 2021-06-01 11:49:47 -05:00
Mark Felder 01f796f8bb Add a test for the migration 2021-06-01 11:49:47 -05:00
Mark Felder 8ff2d8d17d Update description file for new shout config setting location 2021-06-01 11:49:47 -05:00
Mark Felder d6432a65da Move shout configuration from :instance, update docs and changelog 2021-06-01 11:49:46 -05:00
Mark Felder 4a181982c3 More confusingly named legacy chat code renamed to shout 2021-06-01 11:49:16 -05:00
Mark Felder a3cff59659 Ensure we actually start ShoutChannel 2021-06-01 11:49:16 -05:00
Mark Felder 36fe8950f7 Update PleromaFE settings for the old chat box 2021-06-01 11:49:16 -05:00
Mark Felder 68aa56b9e4 Just call it shout 2021-06-01 11:49:16 -05:00
Mark Felder ff00b354fa Rename the non-federating Chat feature to Shout 2021-06-01 11:49:14 -05:00
feld ee52fc840d Merge branch 'cycles-constants' into 'develop'
Recompilation speedup: move as_local_public/0 into ActivityPub.Utils

See merge request pleroma/pleroma!3431
2021-06-01 16:43:51 +00:00
Alex Gleason c435de426d
Merge remote-tracking branch 'pleroma/develop' into cycles-constants 2021-06-01 11:33:11 -05:00
feld 75b94a2f35 Merge branch 'cycles-frontend-static' into 'develop'
Recompilation speedup: make Router a runtime dep of FrontendStatic

See merge request pleroma/pleroma!3429
2021-06-01 16:19:41 +00:00
feld 0ddf492c5d Merge branch 'cycles-base-url' into 'develop'
Deprecate Pleroma.Web.base_url/0

See merge request pleroma/pleroma!3432
2021-06-01 16:15:27 +00:00
Haelwenn c4b4258374 Merge branch 'features/validators-note' into 'develop'
Pipeline Ingestion: Note

Closes #290

See merge request pleroma/pleroma!2984
2021-06-01 01:51:38 +00:00
Alex Gleason f2134e605b
Merge remote-tracking branch 'pleroma/develop' into cycles-base-url 2021-05-31 16:49:46 -05:00
Alex Gleason 51a9f97e87
Deprecate Pleroma.Web.base_url/0
Use Pleroma.Web.Endpoint.url/0 directly instead. Reduces compiler cycles.
2021-05-31 16:48:03 -05:00
Alex Gleason 10dfe81479
Pleroma.Constants.as_local_public/0 --> Pleroma.Web.ActivityPub.Utils.as_local_public/0
Move as_local_public/0 to stop making modules depend on Web at compile-time
2021-05-31 13:39:15 -05:00
Haelwenn a0ba44904a Merge branch 'docs/goto-libera' into 'develop'
Changing references of freenode to libera.chat

See merge request pleroma/pleroma!3415
2021-05-31 17:42:36 +00:00
Guy Sheffer da1ee5c46a Add Raspberry Pi install instructions 2021-05-31 19:17:49 +03:00
Haelwenn (lanodan) Monnier 03232a8223
Changing references of freenode to libera.chat 2021-05-31 17:08:20 +02:00
Haelwenn e53984e446 Merge branch 'weblate-pleroma-pleroma' into 'develop'
Translations update from Weblate

See merge request pleroma/pleroma!3373
2021-05-31 14:40:46 +00:00
Alex Gleason 2e682788a3
Merge commit '07fed0fda2473fc4e1e3b01e863217391fd2902f'; commit 'e3173a279dad89dfce6eae89368ad3ba180c0490'; commit '21787546c01069d1d1d8261f0bc37d13a73122a9'; commit 'fda34591cefad94277385311c6391d1ca2adb36c'; commit '0ada3fe823a3c2e6c5835431bdacfbdb8b3d02a7'; commit '32d263cb905dd7fffd43a4955295af0b2b378537'; commit 'c9e4200ed2167772294fceb4f282979b5ea04981'; commit '3ff9c5e2a67ab83c2abdb14cd246dea059079e75'; commit 'fa543a936124abee524f9a103c17d2601176dcd4'; commit 'c23b81e399d5be6fc30f4acb1d757d5eb291d8e1' into cycles-phase-1 2021-05-30 12:58:24 -05:00
Snow 2fde1f2549 Translated using Weblate (Chinese (Traditional))
Currently translated at 5.6% (6 of 106 strings)

Translation: Pleroma/Pleroma backend
Translate-URL: https://translate.pleroma.social/projects/pleroma/pleroma/zh_Hant/
2021-05-30 17:43:00 +00:00
Snow b3209c31bc Translated using Weblate (Chinese (Traditional))
Currently translated at 0.9% (1 of 106 strings)

Translation: Pleroma/Pleroma backend
Translate-URL: https://translate.pleroma.social/projects/pleroma/pleroma/zh_Hant/
2021-05-30 17:43:00 +00:00
Snow 0107ec63a2 Added translation using Weblate (Chinese (Traditional)) 2021-05-30 17:43:00 +00:00
Haelwenn 4a58cb469b Merge branch 'ffmpeg' into 'develop'
Add ffmpeg to docker image

See merge request pleroma/pleroma!3428
2021-05-30 17:42:48 +00:00
Alex Gleason 595bca24ad
Merge remote-tracking branch 'pleroma/develop' into cycles-frontend-static 2021-05-30 12:12:58 -05:00
Alex Gleason 721c966842
FrontendStatic: make Router a runtime dep
Speeds up recompilation by removing compile-time cycles
2021-05-30 12:12:16 -05:00
shibao 0204ceff7f Add ffmpeg 2021-05-30 10:27:58 -04:00
feld 5d40ffe429 Merge branch 'cycles-views' into 'develop'
Recompilation speedup: Create real Views for all Controllers

See merge request pleroma/pleroma!3425
2021-05-29 21:50:07 +00:00
feld b5f3a5c979 Merge branch 'cycles-html' into 'develop'
Recompilation speedup: Break out activity-specific HTML functions into Pleroma.Activity.HTML

See merge request pleroma/pleroma!3426
2021-05-29 21:19:25 +00:00
feld 317fe240a8 Merge branch 'cycles-gun' into 'develop'
Recompilation speedup: use runtime deps in Pleroma.Gun

See merge request pleroma/pleroma!3422
2021-05-29 21:16:57 +00:00
feld b2f5f48750 Merge branch 'cycles-config' into 'develop'
Recompilation speedup: use runtime deps in Pleroma.Config

See merge request pleroma/pleroma!3424
2021-05-29 19:20:47 +00:00
feld 018dc12b4c Merge branch 'cycles-pipeline' into 'develop'
Recompilation speedup: switch to runtime deps in ActivityPub.Pipeline

See merge request pleroma/pleroma!3427
2021-05-29 19:16:06 +00:00
Alex Gleason 0de6716f06
Merge remote-tracking branch 'pleroma/develop' into cycles-pipeline 2021-05-29 13:32:57 -05:00
Alex Gleason fa543a9361
ActivityPub.Pipeline: switch to runtime deps
Speed up recompilation by breaking compile-time cycles
2021-05-29 13:25:11 -05:00
Alex Gleason 1a69f59221
Merge remote-tracking branch 'pleroma/develop' into cycles-html 2021-05-29 12:29:58 -05:00
Alex Gleason 3ff9c5e2a6
Break out activity-specific HTML functions into Pleroma.Activity.HTML
Fixes cycles in lib/pleroma/ecto_type/activity_pub/object_validators/safe_text.ex
2021-05-29 12:29:11 -05:00
Alex Gleason 7c96c82b5b
Merge remote-tracking branch 'pleroma/develop' into cycles-views 2021-05-29 12:17:24 -05:00
Alex Gleason c9e4200ed2
Create real Views for all Controllers
This makes views depend on each other at runtime instead of compile-time
2021-05-29 12:15:57 -05:00
Alex Gleason cc9e456c0a
Merge remote-tracking branch 'pleroma/develop' into cycles-plugs 2021-05-29 12:01:37 -05:00
Alex Gleason 32d263cb90
Config: use runtime deps instead of module attributes
Speeds up recompilation time by breaking compile-time cycles
2021-05-29 12:00:59 -05:00
Alex Gleason e2ba852bfe
Merge remote-tracking branch 'pleroma/develop' into cycles-gun 2021-05-29 11:35:57 -05:00
Alex Gleason 0ada3fe823
Gun: use runtime deps in ConnectionPool
Speed up recompilation time by breaking compile-time cycles
2021-05-29 11:35:53 -05:00
Alex Gleason 3ebede4b51
Gun: make Gun.API a runtime dep
Speed up recompilation by breaking a compile-time cycle
2021-05-29 10:53:30 -05:00
Snow 69aed310de Adding description 2021-05-29 02:22:33 +00:00
feld 8871ca5aa3 Merge branch 'cycles-router-api-routes' into 'develop'
Recompilation speedup: Pleroma.Web.get_api_routes/0 --> Pleroma.Web.Router.get_api_routes/0

See merge request pleroma/pleroma!3419
2021-05-28 19:06:49 +00:00
feld 359ded086c Merge branch 'simplepolicy-announce-leak' into 'develop'
SimplePolicy: filter nested objects, fixes #2582

Closes #2582

See merge request pleroma/pleroma!3376
2021-05-28 19:05:13 +00:00
feld c44dd05f64 Merge branch 'gitignore-runtime-exs' into 'develop'
gitignore runtime.exs

See merge request pleroma/pleroma!3407
2021-05-28 19:02:15 +00:00
feld edcdd15e01 Merge branch 'alias-router-helpers' into 'develop'
Switch to aliasing `Router.Helpers` instead of importing

See merge request pleroma/pleroma!3409
2021-05-28 19:01:47 +00:00
feld a833a2d76b Merge branch 'plug-runtime-dev' into 'develop'
Put Plugs in runtime mode in :dev, :test to speed up recompilation

See merge request pleroma/pleroma!3411
2021-05-28 18:57:45 +00:00
Alex Gleason 39127f15eb
Merge remote-tracking branch 'pleroma/develop' into cycles-router-api-routes 2021-05-28 13:51:21 -05:00
Alex Gleason c23b81e399
Pleroma.Web.get_api_routes/0 --> Pleroma.Web.Router.get_api_routes/0
Reduce recompilation time by breaking compile-time cycles
2021-05-28 13:51:01 -05:00
feld 7ad87571bd Merge branch 'cycles-router' into 'develop'
Recompilation speedup: move StaticFEPlug to a pipeline

See merge request pleroma/pleroma!3417
2021-05-28 18:24:33 +00:00
feld 9f386df83c Merge branch 'cycles-router-mediaproxy' into 'develop'
Recompilation speedup: don't make MediaProxy be a compile-dep of Router

See merge request pleroma/pleroma!3418
2021-05-28 18:22:27 +00:00
Alex Gleason bf2ee12fdb
Merge remote-tracking branch 'pleroma/develop' into cycles-router-mediaproxy 2021-05-28 13:08:23 -05:00
Alex Gleason fda34591ce
Don't make MediaProxy be a compile-dep of Router
Speeds up recompilation by removing MediaProxy as a compile-time dep of Router
2021-05-28 13:07:34 -05:00
Alex Gleason e885b49e35
Merge remote-tracking branch 'pleroma/develop' into cycles-router 2021-05-28 12:44:16 -05:00
Alex Gleason 21787546c0
Router: move StaticFEPlug to a pipeline
Speed up recompilation by breaking a cycle. Removes StaticFEPlug as a compile-time dep of Router.
2021-05-28 12:43:02 -05:00
Haelwenn a01093c505 Merge branch 'featured-totalItems' into 'develop'
Add missing totalItems field for featured collections

See merge request pleroma/pleroma!3416
2021-05-27 21:01:54 +00:00
Mark Felder cd4352a86f Missing entry for pinned posts federation from MR !3312 2021-05-27 12:20:21 -05:00
Mark Felder 4694853766 Provide totalItems field for featured collections 2021-05-27 12:17:31 -05:00
Haelwenn f34e22bba2 Merge branch 'feat/expose_email_to_self' into 'develop'
Expose user email address to user/owner; not publicly.

See merge request pleroma/pleroma!3412
2021-05-26 18:04:23 +00:00
Haelwenn 5d0ac015dc Merge branch 'mix_config_deprecation' into 'develop'
Switch from the deprecated "use Mix.config" to "import Config"

See merge request pleroma/pleroma!3413
2021-05-22 15:46:02 +00:00
Mark Felder fe40f6f291 Switch from the deprecated "use Mix.config" to "import Config" 2021-05-20 14:02:58 -05:00
Mark Felder 05d678c070 Expose user email address to user/owner; not publicly. 2021-05-20 12:50:43 -05:00
Alex Gleason 0461794375
Merge remote-tracking branch 'pleroma/develop' into plug-runtime-dev 2021-05-19 14:27:59 -05:00
Alex Gleason e3173a279d
Put Plugs in runtime mode in :dev, :test to speed up recompilation 2021-05-19 14:27:46 -05:00
Alex Gleason ad7d4ff8bc
Merge remote-tracking branch 'pleroma/develop' into alias-router-helpers 2021-05-19 12:49:00 -05:00
Alex Gleason 07fed0fda2
Switch to aliasing `Router.Helpers` instead of importing 2021-05-18 17:45:30 -05:00
feld 8e9f032f25 Merge branch 'chore/changelog' into 'develop'
Clarify AttachmentMetadata changes

See merge request pleroma/pleroma!3408
2021-05-18 21:54:54 +00:00
Mark Felder 2d7f6ce6fb Clarify AttachmentMetadata changes 2021-05-18 16:46:51 -05:00
feld 0db436789d Merge branch 'blurhash' into 'develop'
Upload filter for media metadata (Support blurhash, get WxH)

See merge request pleroma/pleroma!3404
2021-05-18 21:41:34 +00:00
Mark Felder c64cbee26c Fixed checking for Upload Filter required commands 2021-05-18 16:28:21 -05:00
Mark Felder 4ab3ef07d0 Check AnalyzeMetadata filter's required commands
eblurhash:magick uses "convert"
Fetching image metadata uses "mogrify"
2021-05-18 16:08:31 -05:00
Mark Felder 9b6b5ac196 Rename upload filter to AnalyzeMetadata 2021-05-18 15:33:33 -05:00
lain 44be498fe1 Merge branch 'optional-config' into 'develop'
Save ~10 minutes on source installation

See merge request pleroma/pleroma!3406
2021-05-17 18:41:12 +00:00
Alex Gleason 7ac4da8dd4
Merge remote-tracking branch 'pleroma/develop' into gitignore-runtime-exs 2021-05-16 13:22:26 -05:00
Alex Gleason 230ad82dad
gitignore `config/runtime.exs` 2021-05-16 13:22:07 -05:00
Alex Gleason 32ae8f4906
Merge remote-tracking branch 'pleroma/develop' into optional-config 2021-05-16 12:27:29 -05:00
Alex Gleason b540fff908
Docs: use `MIX_ENV=prod mix pleroma.instance gen` 2021-05-16 12:26:51 -05:00
Alex Gleason b22f54eb29
Make prod.secret.exs optional (with warning) 2021-05-16 12:26:32 -05:00
Alex Gleason bcf6efce15
Merge remote-tracking branch 'upstream/attachment-meta' into blurhash 2021-05-14 09:09:32 -05:00
Alex Gleason 543e9402d6
Support blurhash 2021-05-14 09:07:16 -05:00
Alex Gleason 5a57b025c7
Changelog: attachment meta 2021-05-12 20:15:33 -05:00
Alex Gleason ff02511057
Merge remote-tracking branch 'upstream/develop' into attachment-meta 2021-05-12 20:10:52 -05:00
Alex Gleason 6f0b42656d
Federate attachments as Links instead of Documents 2021-05-12 19:25:37 -05:00
Alex Gleason 02b9436494
Don't render media `meta` if nil 2021-05-12 16:16:10 -05:00
Alex Gleason 4c060ae733
Ingest remote attachment width/height 2021-05-12 15:38:49 -05:00
Alex Gleason ab9eabdf20
Add SetMeta filter to store uploaded image sizes 2021-05-12 15:07:31 -05:00
faried nawaz 5be9d13981
a better query to delete from hashtags
old query:

Delete on hashtags  (cost=5089.81..5521.63 rows=6160 width=18)
   ->  Hash Semi Join  (cost=5089.81..5521.63 rows=6160 width=18)
         Hash Cond: (hashtags.id = ht.id)
         ->  Seq Scan on hashtags  (cost=0.00..317.28 rows=17528 width=14)
         ->  Hash  (cost=5012.81..5012.81 rows=6160 width=20)
               ->  Merge Anti Join  (cost=0.70..5012.81 rows=6160 width=20)
                     Merge Cond: (ht.id = hto.hashtag_id)
                     ->  Index Scan using hashtags_pkey on hashtags ht  (cost=0.29..610.53 rows=17528 width=14)
                     ->  Index Scan using hashtags_objects_pkey on hashtags_objects hto  (cost=0.42..3506.48 rows=68158 width=14)

new query:

Delete on hashtags ht  (cost=0.70..5012.81 rows=6160 width=12)
   ->  Merge Anti Join  (cost=0.70..5012.81 rows=6160 width=12)
         Merge Cond: (ht.id = hto.hashtag_id)
         ->  Index Scan using hashtags_pkey on hashtags ht  (cost=0.29..610.53 rows=17528 width=14)
         ->  Index Scan using hashtags_objects_pkey on hashtags_objects hto  (cost=0.42..3506.48 rows=68158 width=14)
2021-05-08 02:00:43 +05:00
faried nawaz a0c9a2b4cc
mix prune_objects: remove unused hashtags after pruning remote objects 2021-05-08 02:00:42 +05:00
faried nawaz 22b2451edd
migration: add on_delete: :delete_all to hashtags object_id fk 2021-05-08 02:00:34 +05:00
Alex Gleason cea44b6b3e
Merge remote-tracking branch 'upstream/develop' into simplepolicy-announce-leak 2021-05-07 12:40:45 -05:00
Alex Gleason b15c4629ff
CHANGELOG: notice routes 2021-05-05 14:51:29 -05:00
Alex Gleason 1a45aa1278
Merge remote-tracking branch 'pleroma/develop' into notice-routes 2021-05-05 14:50:54 -05:00
Alex Gleason 50e3750758
Add notice compatibility routes for other frontends
Fixes: https://git.pleroma.social/pleroma/pleroma/-/issues/1785
2021-05-05 14:50:10 -05:00
feld 745375bdcf Merge branch 'dont-crash-email-settings' into 'develop'
Don't crash so hard when email settings are invalid

Closes #2606

See merge request pleroma/pleroma!3400
2021-05-04 13:30:00 +00:00
feld d5263bfcf3 Merge branch 'earmark' into 'develop'
Upgrade Earmark to v1.4.15

Closes #1942 and #2026

See merge request pleroma/pleroma!3076
2021-05-04 13:29:14 +00:00
Alex Gleason 90770e0841
CHANGELOG: don't crash so hard when email settings are invalid 2021-05-03 14:43:34 -05:00
Alex Gleason c186b059a7
Merge remote-tracking branch 'pleroma/develop' into dont-crash-email-settings 2021-05-03 14:43:28 -05:00
Alex Gleason c80b1aaf51
Don't crash when email settings are invalid
Fixes: https://git.pleroma.social/pleroma/pleroma/-/issues/2606
Fixes: https://gitlab.com/soapbox-pub/soapbox/-/issues/4
2021-05-03 14:43:14 -05:00
Alex Gleason dca87c5e7b
CHANGELOG: markdown 2021-05-01 11:28:06 -05:00
Alex Gleason 20878c7f99
CHANGELOG: SimplePolicy embedded objects are now checked 2021-04-30 14:22:02 -05:00
Alex Gleason 926a233cc4
Merge remote-tracking branch 'upstream/develop' into simplepolicy-announce-leak 2021-04-30 14:21:17 -05:00
Alex Gleason c16c7fdb87
SimplePolicy: filter string Objects 2021-04-30 14:20:54 -05:00
Alex Gleason 3d742c3c1a
SimplePolicy: filter nested objects 2021-04-30 14:20:37 -05:00
Alex Gleason 52fc59f125
Merge remote-tracking branch 'upstream/develop' into earmark 2021-04-30 13:17:03 -05:00
Alex Gleason a8fa00ef66
Fix failing remote mentions test, valid TLDs 2021-04-30 12:55:43 -05:00
Alex Gleason 53760d2cda
Delete obsolete EarmarkRendereTests (moved to UtilsTest) 2021-04-30 12:51:18 -05:00
Alex Gleason 6727a3659f
Remove Pleroma.Formatter.minify/2 2021-04-30 12:27:06 -05:00
Alex Gleason 004bcedb07
Upgrade Earmark 1.4.15 2021-04-30 12:23:11 -05:00
feld 377f84f367 Merge branch 'oauth-token-id' into 'develop'
Return token's primary key with POST /oauth/token

See merge request pleroma/pleroma!3380
2021-04-29 19:13:50 +00:00
Alex Gleason 6bc8ab225d
Merge remote-tracking branch 'upstream/develop' into oauth-token-id 2021-04-29 14:06:12 -05:00
feld 2fe3bd8178 Merge branch 'maybe-fix-ci' into 'develop'
CI: Purge pleroma build directory between runs

See merge request pleroma/pleroma!3399
2021-04-29 18:56:28 +00:00
Alex Gleason b5ae826898
CI: Purge pleroma build directory between runs 2021-04-29 13:15:48 -05:00
Alex Gleason 8c1d6e8839
CHANGELOG: Return OAuth token `id` 2021-04-29 12:20:46 -05:00
Alex Gleason e7ac15905e
Merge remote-tracking branch 'upstream/develop' into oauth-token-id 2021-04-29 12:19:10 -05:00
Alex Gleason 762be6ce10
Merge remote-tracking branch 'upstream/develop' into block-behavior 2021-04-29 11:14:32 -05:00
Haelwenn 115673bce7 Merge branch 'gitlab-ci-mix-lock' into 'develop'
Cache GitLab CI based on mix.lock

See merge request pleroma/pleroma!3398
2021-04-28 04:53:25 +00:00
Alex Gleason b9a99ac0d4
Cache gitlab-ci based on mix.lock 2021-04-27 11:54:28 -05:00
Haelwenn d9e782c180 Merge branch 'fix/delete_activities_timeout' into 'develop'
Fix pleroma.user delete_activities mix task

See merge request pleroma/pleroma!3394
2021-04-23 02:14:11 +00:00
Mark Felder d7a71a275a Fixed pleroma.user delete_activities mix task. 2021-04-22 10:15:50 -05:00
Mark Felder 959dc6e6fc Cleanup and ensure we obey custom Repo timeout 2021-04-22 10:15:50 -05:00
Mark Felder 99fd9c5e38 OTP releases executing commands via pleroma_ctl show the parent of the process is :erl_eval 2021-04-22 10:15:50 -05:00
Mark Felder 9f711ddcf8 Try to set query timeout intelligently 2021-04-22 10:15:50 -05:00
Mark Felder 9bc69196d5 Add utility function to return infinite timeout for SQL transactions if we detect it was called from a Mix Task 2021-04-22 10:15:50 -05:00
Mark Felder 0effcd2cfe Set Repo.transaction/2 timeout to infinity. Fixes pleroma.user delete_activities mix task. 2021-04-22 10:15:50 -05:00
Haelwenn f9bedf5597 Apply lanodan's suggestion(s) to 1 file(s) 2021-04-20 21:08:31 +00:00
Haelwenn 42185d8750 Apply lanodan's suggestion(s) to 1 file(s) 2021-04-20 21:06:45 +00:00
Haelwenn e104829c2f Apply lanodan's suggestion(s) to 1 file(s) 2021-04-20 21:06:39 +00:00
Haelwenn 30b1d50938 Apply lanodan's suggestion(s) to 1 file(s) 2021-04-20 21:06:32 +00:00
feld b050adb5e2 Merge branch 'fix/docs' into 'develop'
Docs: Fix incorrect shell command

See merge request pleroma/pleroma!3396
2021-04-20 18:02:48 +00:00
Mark Felder 7eded72189 Fix incorrect shell command
Can't be in /opt/pleroma/bin and then call ./bin/pleroma_ctl :)
2021-04-20 12:31:14 -05:00
feld 8defbe431e Merge branch 'feature/opt-out-of-google-floc' into 'develop'
Add opting out of Google FLoC to HTTPSecurityPlug headers

Closes #2630

See merge request pleroma/pleroma!3393
2021-04-19 22:39:52 +00:00
Sean King 2780cdd4e7
Add CHANGELOG entry 2021-04-19 16:06:19 -06:00
Sean King d1eb1913e8 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into feature/opt-out-of-google-floc 2021-04-19 15:42:38 -06:00
feld 7183655a07 Merge branch 'fix/tests' into 'develop'
Fix tests broken since !3312

See merge request pleroma/pleroma!3395
2021-04-19 21:34:38 +00:00
Mark Felder efed94a23e Fix error response which was breaking tests related to pinned posts 2021-04-19 16:23:57 -05:00
Sean King 2b4f958b2a
Add opting out of Google FLoC to HTTPSecurityPlug headers 2021-04-18 14:00:18 -06:00
Sean King 2de41770d0
Remove Twemoji stuff from MastoFE 2021-04-16 18:02:08 -06:00
Sean King 0f8da39b72
Remove priv/static/sounds folder 2021-04-16 15:56:00 -06:00
Sean King a787fed8f7
Move changelog around 2021-04-16 15:50:17 -06:00
rinpatch c6dcd863e2 Apply rinpatch's suggestion(s) to 1 file(s) 2021-04-16 09:59:50 +00:00
rinpatch 15f87cf658 Merge branch 'features/ingestion-ecto-tag' into 'develop'
TagValidator: New

See merge request pleroma/pleroma!3244
2021-04-16 09:55:55 +00:00
rinpatch 79376b4afb Merge branch 'feature/521-pinned-post-federation' into 'develop'
Pinned posts federation

Closes #521

See merge request pleroma/pleroma!3312
2021-04-16 09:53:47 +00:00
rinpatch 0ababdc068 Merge branch 'fix/2593-reading-exported-config-file' into 'develop'
Reading the file, instead of config keyword in ReleaseRuntimeProvider

Closes #2593

See merge request pleroma/pleroma!3381
2021-04-16 09:50:26 +00:00
Sean King fa2e62078c
Remove MastoFE configuration stuff 2021-04-15 23:51:04 -06:00
Sean King 08694599ae
Remove bash script for downloading new MastoFE build 2021-04-15 23:41:34 -06:00
Sean King bf9c4f5289
Add note about Mastodon FE being removed from Pleroma in changelog 2021-04-15 23:39:33 -06:00
Sean King f3b403fa98
Remove MastoFE stuff from docs and default panel 2021-04-15 23:37:18 -06:00
Sean King ca79aab0bf
Remove MastoFE settings from users table 2021-04-15 23:33:24 -06:00
Sean King 8afa3f2d1b
Remove no longer necessary unit tests for MastoFE 2021-04-15 23:12:42 -06:00
Sean King 4f55d5123b
Remove MastoFE-related backend code and frontend pieces 2021-04-15 22:56:21 -06:00
Haelwenn 152cb3074e Merge branch 'fix/notifsettings-breaking-login' into 'develop'
Enforce user.notification_settings is NOT NULL

Closes #2571

See merge request pleroma/pleroma!3386
2021-04-15 21:34:55 +00:00
feld 0a7c2a32ba Merge branch 'develop' into 'fix/notifsettings-breaking-login'
# Conflicts:
#   CHANGELOG.md
2021-04-15 14:59:26 +00:00
Haelwenn 0ba8efc950 Merge branch 'fix/mastodon-interface-docs-link' into 'develop'
Fix Mastodon interface link in documentation, fixes #2622

Closes #2622

See merge request pleroma/pleroma!3391
2021-04-15 05:44:01 +00:00
Sean King d9fce0133e
Fix Mastodon interface link 2021-04-14 14:01:33 -06:00
feld 1bf2b645c5 Merge branch 'fix/adminapi-concurrent-limiter' into 'develop'
Fix ConcurrentLimiter settings via AdminAPI

See merge request pleroma/pleroma!3390
2021-04-14 16:52:02 +00:00
Mark Felder f95b52255b Revert guards on string_to_elixir_types/1, remove unnecessary assignment in test 2021-04-14 09:39:57 -05:00
Mark Felder c3b8c77967 Improve string_to_elixir_types/1 with guards 2021-04-13 14:39:57 -05:00
Mark Felder 861f192852 Document fixed ability to save ConcurrentLimiter settings in ConfigDB 2021-04-13 14:39:44 -05:00
Mark Felder ee53ad4d77 Add ConcurrentLimiter to module_name?/1 and apply string_to_elixir_types/1 to search_opts keys during update_or_create/1 2021-04-13 14:39:31 -05:00
Mark Felder 905efc57e9 Initial test validating the AdminAPI issue 2021-04-13 14:39:28 -05:00
Haelwenn d2a03d3c86 Merge branch 'fix/instance-thumbnail-url' into 'develop'
Fix URL to custom instance thumbnail

Closes #2611

See merge request pleroma/pleroma!3388
2021-04-13 19:05:07 +00:00
Mark Felder cdd271b065 Fix assignment / assertion 2021-04-13 10:55:54 -05:00
Mark Felder 9fbcdc15b1 Validate custom instance thumbnail set via AdminAPI produces correct URL 2021-04-13 10:52:53 -05:00
Mark Felder 0feafcc20c Use URI.merge to prevent concatenating two canonical URLs when a custom instance thumbnail was uploaded via AdminFE 2021-04-09 10:30:27 -05:00
Alexander Strizhakov 681a42c359
release runtime provider fix for paths 2021-04-08 15:45:31 +03:00
Haelwenn (lanodan) Monnier 5ef4659b37
test/pleroma/web/common_api_test.exs: Strip : around emoji key-name 2021-04-05 19:25:55 +02:00
Haelwenn (lanodan) Monnier 6d6bef64bf
fetcher_test: Remove assert on fake Create having an ap_id 2021-04-05 19:19:12 +02:00
Haelwenn (lanodan) Monnier 53193b84b1
utils: Fix maybe_splice_recipient when "object" isn’t a map 2021-04-05 19:19:12 +02:00
Haelwenn (lanodan) Monnier 0b88accae6
fetcher_test: Fix missing mock function 2021-04-05 19:19:12 +02:00
Haelwenn (lanodan) Monnier 6c9f6e62c8
transmogrifier: Fixing votes from Note to Answer 2021-04-05 19:19:12 +02:00
Haelwenn (lanodan) Monnier 461123110b
Object.Fetcher: Fix getting transmogrifier reject reason 2021-04-05 19:19:12 +02:00
Haelwenn (lanodan) Monnier b0c778fde7
NoteHandlingTest: remove fix_explicit_addressing-related test 2021-04-05 19:19:12 +02:00
Haelwenn (lanodan) Monnier d1205406d9
ActivityPubControllerTest: Apply same addr changes to object 2021-04-05 19:19:12 +02:00
Haelwenn (lanodan) Monnier 96212b2e32
Fix addressing 2021-04-05 19:19:12 +02:00
Haelwenn (lanodan) Monnier 641184fc7a
recipients fixes/hardening for CreateGenericValidator 2021-04-05 19:19:11 +02:00
Haelwenn (lanodan) Monnier c944932674
Pipeline Ingestion: Note 2021-04-05 19:19:11 +02:00
Haelwenn (lanodan) Monnier e2a3365b5c
ObjectValidator.CommonFixes: Introduce fix_objects_defaults and fix_activity_defaults 2021-04-05 19:19:11 +02:00
Haelwenn (lanodan) Monnier e56779dd8d
Transmogrifier: Simplify fix_explicit_addressing and fix_implicit_addressing 2021-04-05 19:19:11 +02:00
Haelwenn (lanodan) Monnier ef36f7fa5c
Move tag fixup to object_validator 2021-04-05 19:07:45 +02:00
feld f8cef70416 Merge branch 'chore/CHANGELOG' into 'develop'
Fix CHANGELOG entry meant for next release

See merge request pleroma/pleroma!3387
2021-04-01 15:26:46 +00:00
Mark Felder 31ce8a3730 Fix CHANGELOG entry meant for next release 2021-04-01 10:15:01 -05:00
Mark Felder 765f0907df Document user login failure fix for NULL notification_settings 2021-04-01 10:07:57 -05:00
Mark Felder 4ecf6ceea6 Enforce user.notification_settings is NOT NULL 2021-04-01 10:06:24 -05:00
Haelwenn (lanodan) Monnier 7ebfe89900
object_validators: Mark validate_data as private 2021-04-01 14:18:41 +02:00
Haelwenn (lanodan) Monnier 37a7f521fd
Insert string-hashtags in Pipeline
Cannot be done in Ecto schemas because only one type is allowed in arrays, and
needs to be done before the MRFs.
2021-04-01 14:18:41 +02:00
Haelwenn (lanodan) Monnier 5ae27c8451
pipeline_test: Fix usage of %Activity{} 2021-04-01 14:18:40 +02:00
Haelwenn (lanodan) Monnier 9015df2229
TagValidator: New 2021-04-01 14:18:40 +02:00
Haelwenn 96fe4dd4e2 Merge branch 'revert-c368bf6d' into 'develop'
Revert "Merge branch 'patch-fix-open-api-spec' into 'develop'"

See merge request pleroma/pleroma!3385
2021-04-01 12:11:21 +00:00
Haelwenn 1e3db07586 Revert "Merge branch 'patch-fix-open-api-spec' into 'develop'"
This reverts merge request !3382
2021-04-01 12:00:58 +00:00
rinpatch ce9ed6c730 Merge branch 'refactor/object_validator_validate' into 'develop'
object_validator: Refactor most of validate/2 to a generic block

See merge request pleroma/pleroma!3383
2021-04-01 11:10:12 +00:00
Haelwenn (lanodan) Monnier af1cd28f9b
object_validator: Refactor most of validate/2 to a generic block 2021-04-01 12:18:52 +02:00
rinpatch c368bf6dce Merge branch 'patch-fix-open-api-spec' into 'develop'
OpenAPI: Fix `date-time` being specified as an `integer` in OpenAPI spec (when it should be a `string`) in AccountCreateResponse

See merge request pleroma/pleroma!3382
2021-03-31 08:19:31 +00:00
Miss Pasture 863010ea63 date-times are always strings 2021-03-31 06:51:22 +00:00
feld 4c16f5d2ca Merge branch 'upstream/mrf-followbot' into 'develop'
Upstream/mrf followbot

See merge request pleroma/pleroma!3060
2021-03-30 16:59:34 +00:00
Mark Felder 16a7ffb1ea Fix function calls due to module name change 2021-03-30 11:10:44 -05:00
Mark Felder bfcdcd4f69 Temp file leaked, oops 2021-03-30 11:10:44 -05:00
Mark Felder d29f6d6b6e Add more details to the cheatsheat for FollowBot MRF 2021-03-30 11:10:44 -05:00
Mark Felder 03f38ac4eb Prefer FollowBot naming convention vs Followbot 2021-03-30 11:10:44 -05:00
Mark Felder 7eab98d5c8 Document new FollowBot MRF 2021-03-30 11:10:44 -05:00
Mark Felder fef4f3772c More tests to validate Followbot is behaving 2021-03-30 11:10:44 -05:00
Mark Felder 4796df0bc3 Remove Task.async as it is broken here and probably a premature optimization anyway 2021-03-30 11:10:44 -05:00
Mark Felder f73d166785 Only need to validate a follow request is generated for now 2021-03-30 11:10:44 -05:00
Mark Felder c252ac71d4 Revert 2021-03-30 11:10:44 -05:00
Mark Felder 778010ef8e Do not try to follow local users. Their posts are already available locally on the instance. 2021-03-30 11:10:44 -05:00
Mark Felder 86182ef8e4 Change module name to FollowbotPolicy 2021-03-30 11:10:44 -05:00
Mark Felder 1926d0804b Add follow_requests_outstanding_since?/3 to Pleroma.Activity 2021-03-30 11:10:44 -05:00
Mark Felder f0dcc1ca69 Lint 2021-03-30 11:10:44 -05:00
Mark Felder a176914c73 Better checking of previous follow request attempts 2021-03-30 11:10:44 -05:00
Mark Felder 3989ec508c Prevent duplicates from being processed 2021-03-30 11:10:44 -05:00
Mark Felder 3949cfdc24 Make the followbot only dispatch follow requests once per 30 day period 2021-03-30 11:10:43 -05:00
feld 2689463c7e Apply 1 suggestion(s) to 1 file(s) 2021-03-30 11:10:43 -05:00
Mark Felder 2557e805a3 Support for configuration via AdminFE 2021-03-30 11:10:43 -05:00
Mark Felder e78738173a Enforce that the followbot must be marked as a bot. 2021-03-30 11:10:43 -05:00
Mark Felder 840dc4b44b Document :mrf_follow_bot 2021-03-30 11:10:34 -05:00
Mark Felder fba770b3ea Try to handle misconfiguration scenarios gracefully 2021-03-30 11:10:03 -05:00
Mark Felder 8b81d62227 Upstream original followbot implementation 2021-03-30 11:10:03 -05:00
Alexander Strizhakov 4d046afd27
tests for release config provider 2021-03-27 09:05:33 +03:00
Alexander Strizhakov 6e108b8603
reading the file, instead of config keyword 2021-03-26 19:19:19 +03:00
Alexander Strizhakov 1885268c9c
expanding validator 2021-03-25 13:26:54 +03:00
Alexander Strizhakov 2a520ba008
expanding AddRemoveValidator 2021-03-25 13:03:42 +03:00
Alexander Strizhakov 8857242c95
removeing corresponding add activity 2021-03-25 13:03:41 +03:00
Alexander Strizhakov 5ae9b05600
separate test file for featured collection 2021-03-25 13:03:41 +03:00
Alexander Strizhakov 8f0778166c
moving fixture into mastodon folder 2021-03-25 13:03:41 +03:00
Alexander Strizhakov 16c96966e9
not needed 2021-03-25 13:03:41 +03:00
Alexander Strizhakov 3adb43cc20
refetch user on incoming add/remove activity
if featured_address is nil
2021-03-25 13:03:41 +03:00
Alexander Strizhakov d1d2744ee3
featured_address valition in AddRemoveValidator 2021-03-25 13:03:40 +03:00
Alexander Strizhakov ff612750b1
validator renaming & add validation for target 2021-03-25 13:03:40 +03:00
Alexander Strizhakov 17f28c0507
mastodon pins 2021-03-25 13:03:40 +03:00
Alexander Strizhakov 3ec1dbd922
Let pins federate
- save object ids on pin, instead of activity ids
- pins federation
- removed pinned_activities field from the users table
- activityPub endpoint for user pins
- pulling remote users pins
2021-03-25 13:03:40 +03:00
Alex Gleason b6a69b5efd
Return token's primary key with POST /oauth/token 2021-03-24 12:50:05 -05:00
feld caadde3b04 Merge branch 'fix/2585-config-migration-dir' into 'develop'
migrating config to tmp folder

Closes #2585

See merge request pleroma/pleroma!3379
2021-03-23 17:46:52 +00:00
Alexander Strizhakov ad907254fb changelog entry 2021-03-23 12:40:49 -05:00
Alexander Strizhakov 4cd34d0197
suggestion 2021-03-23 17:27:02 +03:00
Alexander Strizhakov 03843a5386
migrating config to tmp folder 2021-03-23 14:29:02 +03:00
Haelwenn c09844d3d2 Merge branch 'fix/copy-emoji-summary' into 'develop'
Copy emoji in the subject from parent post

See merge request pleroma/pleroma!3378
2021-03-23 09:27:03 +00:00
rinpatch d3660b24d3 Copy emoji in the subject from parent post
Sometimes people put emoji in the subject, which results in the subject
looking broken if someone replies to it from a server that does not
have the said emoji under the same shortcode. This patch solves the problem
by extending the emoji set available in the summary to that of the parent
post.
2021-03-22 21:20:47 +03:00
rinpatch 572363793f Merge branch 'fix/2579-finger-content-type' into 'develop'
respect content-type header in finger request

Closes #2579

See merge request pleroma/pleroma!3375
2021-03-21 08:25:02 +00:00
rinpatch 72143dd732 Merge branch 'richmedia-workaround' into 'develop'
Workaround for RichMedia preview image breakage edge case

See merge request pleroma/pleroma!3363
2021-03-21 08:19:42 +00:00
feld 8f78361525 Merge branch 'fix/timex-retired-version' into 'develop'
updating Timex

See merge request pleroma/pleroma!3377
2021-03-20 15:52:01 +00:00
Alexander Strizhakov ef5b0510eb
updating timex 2021-03-20 08:29:02 +03:00
Alexander Strizhakov d7e51206a2
respect content-type header in finger request 2021-03-19 18:53:55 +03:00
rinpatch a9bc652ab9 Merge branch 'mediaproxy-decode' into 'develop'
Simple way to decode mediaproxy URLs

See merge request pleroma/pleroma!3364
2021-03-19 08:52:12 +00:00
rinpatch f930e83fa2 Merge branch 'fix/remove_auto_nsfw' into 'develop'
Remove sensitive setting #nsfw

See merge request pleroma/pleroma!3223
2021-03-19 08:48:22 +00:00
rinpatch 67bde35e71 Merge branch 'bugfix/bridgy-user-icon' into 'develop'
Add support for actor icon being a list (Bridgy)

See merge request pleroma/pleroma!3372
2021-03-19 08:36:26 +00:00
Haelwenn a2aa309496 Merge branch 'update_open_api_spex' into 'develop'
Update OpenApiSpex dependency

See merge request pleroma/pleroma!3362
2021-03-16 01:54:43 +00:00
rinpatch 8194622a72 Merge branch 'feature/object-hashtags-rework' into 'develop'
Hashtags extraction from objects. Background migration infrastructure.

Closes #1840 and #2455

See merge request pleroma/pleroma!3213
2021-03-15 09:35:46 +00:00
Haelwenn (lanodan) Monnier 55bdfb075c
OpenAPI: TwitterAPI Util Controller 2021-03-15 06:47:07 +01:00
Haelwenn (lanodan) Monnier 65cd9cb638
TwitterAPI: Remove unused read notification function 2021-03-15 06:47:07 +01:00
Haelwenn (lanodan) Monnier a22c53810b
Remove deprecated /api/qvitter/statuses/notifications/read 2021-03-15 06:47:07 +01:00
Haelwenn (lanodan) Monnier e4743847a1
OpenAPI: PleromaAPI UserImport Controller 2021-03-15 06:47:07 +01:00
Haelwenn (lanodan) Monnier ef5de5eb39
OpenAPI: MastodonAPI Status Controller 2021-03-15 06:47:07 +01:00
Haelwenn (lanodan) Monnier 0c7c6463d1
OpenAPI: MastodonAPI Account Controller, excluding OAuth 2021-03-15 06:47:06 +01:00
Haelwenn (lanodan) Monnier 3a8404820d
Verify MastoFE Controller put_settings response 2021-03-15 06:47:06 +01:00
Haelwenn (lanodan) Monnier e47f83cfc8
OpenAPI: MastodonAPI Conversation Controller 2021-03-15 06:47:06 +01:00
Haelwenn (lanodan) Monnier 3123ecdd6e
OpenAPI: MastodonAPI Media Controller 2021-03-15 06:47:06 +01:00
Haelwenn (lanodan) Monnier 7eecc3b61d
OpenAPI: MastodonAPI Timeline Controller 2021-03-15 06:47:06 +01:00
Haelwenn (lanodan) Monnier b1d4b2b81e
Add support for actor icon being a list (Bridgy) 2021-03-15 06:44:05 +01:00
Haelwenn 19fbe5b860 Merge branch 'weblate-pleroma-pleroma' into 'develop'
Translations update from Weblate

See merge request pleroma/pleroma!3370
2021-03-14 08:09:22 +00:00
Mark Felder b80f868c6b Prefer naming this function build_image_url/2 2021-03-13 12:27:15 -06:00
Ben Is 2408363e2a Translated using Weblate (Italian)
Currently translated at 100.0% (106 of 106 strings)

Translation: Pleroma/Pleroma backend
Translate-URL: https://translate.pleroma.social/projects/pleroma/pleroma/it/
2021-03-13 09:40:56 +00:00
Ivan Tashkinov cb73456609 [#3213] Code formatting fix. 2021-03-12 12:25:18 +03:00
Ivan Tashkinov 3edf45021e [#3213] Background migration infrastructure refactoring.
Extracted BaseMigrator and BaseMigratorState.
2021-03-12 12:18:11 +03:00
Ivan Tashkinov fbcddd8126 Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework 2021-03-12 08:49:25 +03:00
rinpatch 9de2a5024e Merge branch 'improve-gitlab-ci' into 'develop'
Execute mix deps.get earlier and avoid duplicate invocations if possible

See merge request pleroma/pleroma!3369
2021-03-11 19:14:59 +00:00
Mark Felder 884584772b Execute mix deps.get earlier and avoid duplicate invocations if possible 2021-03-11 09:42:04 -06:00
Mark Felder 029ff65389 Leverage function pattern matching instead 2021-03-11 09:20:29 -06:00
Mark Felder 8246db2a96 Workaround for URI.merge/2 bug https://github.com/elixir-lang/elixir/issues/10771
If we avoid URI.merge unless we know we need it we reduce the edge cases we could encounter.
The site would need to both have "//" in the %URI{:path} and the image needs to be a relative URL.
2021-03-10 17:15:31 -06:00
feld 8e09a3cfa0 Merge branch 'fix/spec-build' into 'develop'
Ensure we fetch deps during spec-build stage

See merge request pleroma/pleroma!3368
2021-03-10 23:14:46 +00:00
Mark Felder fa75f11ca1 Revert "See if switching to same image as releases fixes the build"
This reverts commit 502d166b7e.
2021-03-10 16:37:24 -06:00
Mark Felder 502d166b7e See if switching to same image as releases fixes the build 2021-03-10 16:19:18 -06:00
Mark Felder 8feeb672c8 Ensure we fetch deps during spec-build stage 2021-03-10 13:03:14 -06:00
Ivan Tashkinov 946e0aab49 Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework 2021-03-10 07:48:50 +03:00
Haelwenn 7f413139fb Merge branch 'openapi/admin/user' into 'develop'
Add OpenAPI spec for AdminAPI.UserController

See merge request pleroma/pleroma!3355
2021-03-10 03:24:40 +00:00
Ivan Tashkinov 92526e0230 Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework 2021-03-07 11:34:39 +03:00
Ivan Tashkinov 7f8785fd9b [#3213] Performance optimization of filtering by hashtags ("any" condition). 2021-03-07 11:33:21 +03:00
Mark Felder eaaa20e0f1 Make tests use it 2021-03-05 13:21:22 -06:00
Mark Felder e97b34f65d Add simple way to decode fully qualified mediaproxy URLs 2021-03-05 13:18:37 -06:00
Egor Kislitsyn 92ab72dbbb
Update OpenApiSpex dependency 2021-03-05 15:51:29 +04:00
Egor Kislitsyn 9876fa8e90
Add UserOperation to Redoc 2021-03-04 21:13:53 +04:00
Ivan Tashkinov 5856f51717 [#3213] ActivityPub hashtags filtering refactoring. Test fix. 2021-03-03 23:09:30 +03:00
lain 13aa98d689 Merge branch 'mergeback/2.3.0' into 'develop'
Mergeback/2.3.0

See merge request pleroma/pleroma!3360
2021-03-03 15:07:50 +00:00
lain 10f402af6d Changelog: Re-add application support 2021-03-03 15:35:25 +01:00
lain 2e296c079f Revert "StatusController: Deactivate application support for now."
This reverts commit 024c11c18d.
2021-03-03 15:33:06 +01:00
lain c5352e90be Changelog, mix: merge in stable 2021-03-03 13:56:40 +01:00
Haelwenn 49afbcda5f Merge branch 'fix-migration' into 'develop'
Fix migration in cases where database name has a hyphen

See merge request pleroma/pleroma!3359
2021-03-03 00:57:39 +00:00
Mark Felder 5b8cceba09 Fix migration in cases where database name has a hyphen 2021-03-02 18:17:32 -06:00
Haelwenn 37c37090fa Merge branch 'fix/inconsistent-reference' into 'develop'
MastoAPI Status View: make consistently named object references

See merge request pleroma/pleroma!3358
2021-03-02 20:48:40 +00:00
Haelwenn 81e9c5196f Merge branch 'fix/useless-header' into 'develop'
Test: remove useless header on the get request

See merge request pleroma/pleroma!3357
2021-03-02 20:47:21 +00:00
Mark Felder 8d601d3b23 Make the object reference in both render("show.json", _) functions consistently named 2021-03-02 14:14:38 -06:00
Mark Felder 913d53b7d7 Remove useless header on the get request 2021-03-02 14:04:50 -06:00
lain b221d77a6d Merge branch 'release/2.3.0' into 'stable'
Release/2.3.0

See merge request pleroma/pleroma!3354
2021-03-02 19:54:30 +00:00
feld 210aa42f74 Merge branch 'application-to-generator' into 'develop'
Status application field: test improvements

See merge request pleroma/pleroma!3356
2021-03-02 18:40:35 +00:00
Mark Felder ccbf162088 Actually test viewing status after ingestion 2021-03-02 12:33:32 -06:00
Mark Felder f0208980e4 Test both ingestion of post in the status controller and the correct response during the view 2021-03-02 12:29:16 -06:00
Mark Felder 85b2387f66 Fix build_application/1 match 2021-03-02 11:37:37 -06:00
Egor Kislitsyn 3aae5231b2
Add OpenAPI spec for AdminAPI.UserController 2021-03-02 20:49:17 +04:00
Ivan Tashkinov 882dd46843 Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework 2021-03-02 08:26:30 +03:00
Haelwenn (lanodan) Monnier 3bc7d12271
Remove sensitive-property setting #nsfw, create HashtagPolicy 2021-02-27 21:26:17 +01:00
Ivan Tashkinov 40d4362261 [#3213] `mix pleroma.database rollback` tweaks. 2021-02-23 18:11:25 +03:00
Ivan Tashkinov 8f88a90ca3 Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework
# Conflicts:
#	lib/pleroma/application.ex
#	lib/pleroma/config.ex
2021-02-23 13:58:35 +03:00
Ivan Tashkinov 77f3da0358 [#3213] Misc. tweaks: proper upsert in Hashtag, better feature toggle management. 2021-02-23 13:52:28 +03:00
Ivan Tashkinov a98c4423f3 Apply i1t's suggestion(s) to 1 file(s) 2021-02-22 20:41:57 +00:00
Ivan Tashkinov 6531eddf36 [#3213] `hashtags`: altered `name` type to `text`. `hashtags_objects`: removed unused index. HashtagsTableMigrator: records_per_second calculation fix. ActivityPub: hashtags-related options normalization. 2021-02-22 23:26:07 +03:00
Ivan Tashkinov 998437d4a4 [#3213] Experimental / debug feature: `database: [improved_hashtag_timeline: :preselect_hashtag_ids]`. 2021-02-18 21:03:06 +03:00
Ivan Tashkinov b981edad8a [#3213] HashtagsTableMigrator: fault rate allowance to enable the feature (defaults to 1%), counting of affected objects, misc. tweaks. 2021-02-18 20:40:10 +03:00
Ivan Tashkinov 854ea1aefb [#3213] Fixed `HashtagsTableMigrator.count/1`. 2021-02-17 09:23:35 +03:00
Ivan Tashkinov 111bfdd3a0 Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework 2021-02-16 23:23:49 +03:00
Ivan Tashkinov 938823c730 [#3213] HashtagsTableMigrator state management refactoring & improvements (proper stats serialization etc.). 2021-02-16 23:14:15 +03:00
Ivan Tashkinov 1dac7d1462 [#3213] Fixed `hashtags.name` lookup (must use `citext` type to do index scan). Fixed embedded hashtags lookup (lowercasing), adjusted tests. 2021-02-15 21:13:14 +03:00
Ivan Tashkinov 349b8b0f4f [#3213] `rescue` around potentially-raising `Repo.insert_all/_` calls. Misc. improvements (docs etc.). 2021-02-13 22:01:11 +03:00
Ivan Tashkinov 5992382cf8 Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework
# Conflicts:
#	CHANGELOG.md
#	lib/mix/tasks/pleroma/database.ex
#	lib/pleroma/web/templates/feed/feed/_activity.rss.eex
2021-02-11 19:31:57 +03:00
Ivan Tashkinov a996ab46a5 [#3213] Reorganized hashtags cleanup. Transaction-wrapped Hashtag.get_or_create_by_names/1. Misc. improvements. 2021-02-11 19:30:21 +03:00
Ivan Tashkinov d1c6dd97aa [#3213] Partially addressed code review points.
migration rollback task changes, hashtags-related config handling tweaks, `hashtags.data` deletion (unused).
2021-02-07 22:24:12 +03:00
Ivan Tashkinov 4e14945670 Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework
# Conflicts:
#	CHANGELOG.md
#	lib/pleroma/web/activity_pub/activity_pub.ex
2021-02-03 09:31:38 +03:00
Ivan Tashkinov cf4765af40 [#3213] ActivityPub: fixed subquery-based hashtags filtering implementation (addressed empty list options issue). Added regression test. 2021-01-31 23:06:38 +03:00
Ivan Tashkinov 10207f840c [#3213] ActivityPub: temporarily reverted to previous hashtags filtering implementation due to blank results issue. 2021-01-31 22:36:46 +03:00
Ivan Tashkinov 108e90b18e [#3213] Explicitly defined PKs in hashtags_objects and data_migration_failed_ids. Added "pleroma.database rollback" task to revert a single migration. 2021-01-31 22:03:59 +03:00
Ivan Tashkinov 1b49b8efe5 Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework
# Conflicts:
#	CHANGELOG.md
2021-01-31 20:38:58 +03:00
Ivan Tashkinov 6fd4163ab6 [#3213] ActivityPub: implemented subqueries-based hashtags filtering, removed aggregation-based hashtags filtering. 2021-01-31 20:37:33 +03:00
Ivan Tashkinov 9948ff3356 [#3213] Added HashtagsCleanupWorker periodic job. 2021-01-31 18:24:19 +03:00
Ivan Tashkinov 380d0cce6b [#3213] Reinstated DISTINCT clause for hashtag "any" filtering with 2+ terms. Added test. 2021-01-29 00:17:33 +03:00
Ivan Tashkinov e7864a32d7 [#3213] Removed DISTINCT clause from ActivityPub.fetch_activities_query/2. 2021-01-25 22:31:23 +03:00
Ivan Tashkinov 694d98be55 Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework 2021-01-25 21:24:07 +03:00
Ivan Tashkinov ea4785213a [#3213] Switched to using embedded hashtags in Object.hashtags/1
(to avoid extra joins / preload in timeline queries).
2021-01-25 20:12:09 +03:00
Ivan Tashkinov f264d930cc [#3213] Speedup of HashtagsTableMigrator (query optimization). State handling fix. 2021-01-24 23:27:02 +03:00
Ivan Tashkinov 218c519606 Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework
# Conflicts:
#	test/pleroma/web/mastodon_api/views/status_view_test.exs
2021-01-22 10:05:28 +03:00
Ivan Tashkinov ca7f240643 [#3213] Ignoring of blank elements from objects.data->tag. 2021-01-21 20:50:06 +03:00
Ivan Tashkinov c041e9c630 [#3213] HashtagsTableMigrator: failures handling fix, retry function.
Changed default hashtags filtering strategy to non-aggregate approach.
2021-01-21 20:23:08 +03:00
Ivan Tashkinov 2634a16b4c Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework
# Conflicts:
#	CHANGELOG.md
2021-01-21 20:20:35 +03:00
Ivan Tashkinov b830605577 [#3213] Performance-related stat in HashtagsTableMigrator. Reworked `count/_` to indicate approximate total count for current iteration. 2021-01-19 22:03:25 +03:00
Ivan Tashkinov f0f0f2af00 [#3213] `timeout` option for `HashtagsTableMigrator.count/_`. 2021-01-19 21:17:06 +03:00
Ivan Tashkinov 7f07909a7b [#3213] Added `HashtagsTableMigrator.count/1`. 2021-01-19 21:13:32 +03:00
Ivan Tashkinov 9d28a7ebfb [#3213] Missing copyright header for HashtagsTableMigrator.State. 2021-01-17 21:58:15 +03:00
Ivan Tashkinov 85f7ef4d13 [#3213] Feature lock adjustment for HashtagsTableMigrator. 2021-01-17 10:57:06 +03:00
Ivan Tashkinov 48b399cedb [#3213] Refactoring of HashtagsTableMigrator. Hashtag timeline performance optimization (auto switch to non-aggregate join strategy when efficient). 2021-01-16 20:22:14 +03:00
Ivan Tashkinov f5f267fa76 [#3213] Refactoring of HashtagsTableMigrator. 2021-01-14 22:41:27 +03:00
Ivan Tashkinov e350898828 Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework 2021-01-13 22:11:16 +03:00
Ivan Tashkinov 3e4d84729a [#3213] Prototype of data migrations functionality / HashtagsTableMigrator. 2021-01-13 22:07:38 +03:00
Ivan Tashkinov 8c972de045 [#3213] transfer_hashtags mix task refactoring. 2021-01-10 11:44:39 +03:00
Ivan Tashkinov 0d521022fe [#3213] Removed PK from hashtags_objects table. Improved hashtags_transfer mix task (logging of failed ids). 2021-01-07 12:20:29 +03:00
Alex Gleason b7b05a0748
Oopsie whoopsie fix changelog 2021-01-06 15:42:36 -06:00
Alex Gleason cc09079aea
Exclude blockers from notifications when `blockers_visible: false` 2021-01-06 15:39:14 -06:00
Alex Gleason 1438fd9583
Merge remote-tracking branch 'upstream/develop' into block-behavior 2021-01-06 15:22:35 -06:00
lain 07bf36142b Resilience Test: Add notification check for killing likes. 2021-01-06 12:49:18 +01:00
lain a24b2bc38a Resilience Test: Add tests for killing likes. 2021-01-06 12:33:09 +01:00
Ivan Tashkinov 48e0f22ab1 Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework 2020-12-31 12:46:01 +03:00
Ivan Tashkinov 303055456f Alternative implementation of hashtag-filtering queries in ActivityPub. Fixed GROUP BY clause for aggregation on hashtags. 2020-12-31 12:45:23 +03:00
Ivan Tashkinov 367f0c31c3 [#3213] Added query options support for Repo.chunk_stream/4.
Used infinite timeout in transfer_hashtags select query.
2020-12-31 09:36:26 +03:00
Ivan Tashkinov 8d1a0c1afd [#3213] Made Object.object_data_hashtags/1 handle both AS2 and plain text hashtags. 2020-12-30 15:22:49 +03:00
Ivan Tashkinov e0b5edb6d5 [#3213] Fixed Object.object_data_hashtags/1 to process only AS2 elements of `data.tag` (basing on #2984). 2020-12-30 14:42:35 +03:00
Ivan Tashkinov a25c1e8ec0 [#3213] Improved `database.transfer_hashtags` mix task: proper rollback, speedup. 2020-12-30 14:35:19 +03:00
Ivan Tashkinov 14fae94c0e [#3213] Made Object.hashtags/1 work with :hashtags assoc. Adjusted tests. 2020-12-28 00:08:09 +03:00
Ivan Tashkinov 4134abef63 Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework 2020-12-26 22:23:05 +03:00
Ivan Tashkinov cbb19d0e18 [#3213] Hashtag-filtering functions in ActivityPub. Mix task for migrating hashtags to `hashtags` table. 2020-12-26 22:20:55 +03:00
Mary Kate 590a10af33 Adds tests for breaking tag and mention links after text is converted from markdown to html 2020-12-24 16:40:08 -06:00
Ivan Tashkinov e369b1306b Added Hashtag entity and objects-hashtags association with auto-sync with `data.tag` on Object update. 2020-12-22 22:04:33 +03:00
Ivan Tashkinov ee221277b0 Encapsulation of tags / hashtags fetching from objects. 2020-12-21 22:54:26 +03:00
Mark Felder f318d8e56d Use Pleroma.Formatter.markdown_to_html/1 in the tests 2020-12-11 17:28:00 -06:00
Mark Felder 6520599b7d Update Earmark to 1.4.13, use the new compact_output mode 2020-12-11 17:23:03 -06:00
Alex Gleason 642729b49f Fix AudioVideoValidator markdown 2020-12-11 17:22:54 -06:00
Alex Gleason f1c67115d8 Upgrade linkify, test URL issues, fixes #2026 #1942 2020-12-11 17:22:48 -06:00
Alex Gleason f8c93246d6 Refactor Earmark code, fix tests 2020-12-11 17:22:42 -06:00
Alex Gleason b2548cfcda Sanitizer: allow <hr> tags 2020-12-11 17:22:37 -06:00
Alex Gleason c4f4e48e57 Remove some N/A tests 2020-12-11 17:22:30 -06:00
Alex Gleason ba71bbf610 Improve Formatter.minify/2 2020-12-11 17:22:24 -06:00
Alex Gleason e9e17e5df3 Upgrade Earmark to v1.4.10 2020-12-11 17:22:17 -06:00
lain 2aeb229de3 Cheatsheet: Add info about :blockers_visible 2020-11-04 16:23:24 +01:00
lain bae48c98e3 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into alexgleason/pleroma-block-behavior 2020-11-04 16:18:11 +01:00
lain 04b7505c75 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into alexgleason/pleroma-block-behavior 2020-10-26 17:50:34 +01:00
Alex Gleason b3d6cf9022
Merge remote-tracking branch 'upstream/develop' into block-behavior 2020-10-13 19:22:32 -05:00
Alex Gleason 5c8d2c468c
Blocks: update CHANGELOG 2020-10-10 03:44:20 -05:00
Alex Gleason 7c2d0e378c
Blocks: make blockers_visible config work 2020-10-10 03:41:35 -05:00
Alex Gleason 2fc7ce3e1e
Blocks: add blockers_visible config 2020-10-10 01:58:57 -05:00
Alex Gleason d2364276a1
Blocks: always see your own posts 2020-10-10 01:58:48 -05:00
5644 changed files with 64095 additions and 19413 deletions

View File

@ -83,6 +83,7 @@
# lanodan: I think PreferImplicitTry should be consistency, and the behaviour seems
# inconsistent, see: https://github.com/rrrene/credo/issues/224
{Credo.Check.Readability.PreferImplicitTry, false},
{Credo.Check.Readability.PipeIntoAnonymousFunctions, exit_status: 0},
{Credo.Check.Readability.RedundantBlankLines},
{Credo.Check.Readability.StringSigils},
{Credo.Check.Readability.TrailingBlankLine},
@ -90,6 +91,7 @@
{Credo.Check.Readability.VariableNames},
{Credo.Check.Readability.Semicolons},
{Credo.Check.Readability.SpaceAfterCommas},
{Credo.Check.Readability.WithSingleClause, exit_status: 0},
{Credo.Check.Refactor.DoubleBooleanNegation},
{Credo.Check.Refactor.CondStatements},
{Credo.Check.Refactor.CyclomaticComplexity},

4
.gitignore vendored
View File

@ -28,6 +28,7 @@ erl_crash.dump
# variables.
/config/*.secret.exs
/config/generated_config.exs
/config/runtime.exs
/config/*.env
@ -47,6 +48,7 @@ docs/generated_config.md
# Code test coverage
/cover
/Elixir.*.coverdata
/coverage.xml
.idea
pleroma.iml
@ -56,4 +58,4 @@ pleroma.iml
# Editor temp files
/*~
/*#
/*#

View File

@ -1,14 +1,17 @@
image: elixir:1.9.4
image: git.pleroma.social:5050/pleroma/pleroma/ci-base
variables: &global_variables
POSTGRES_DB: pleroma_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
DB_HOST: postgres
DB_PORT: 5432
MIX_ENV: test
cache: &global_cache_policy
key: ${CI_COMMIT_REF_SLUG}
key:
files:
- mix.lock
paths:
- deps
- _build
@ -22,20 +25,31 @@ stages:
- docker
before_script:
- apt-get update && apt-get install -y cmake
- mix local.hex --force
- mix local.rebar --force
- apt-get -qq update
- apt-get install -y libmagic-dev
- echo $MIX_ENV
- rm -rf _build/*/lib/pleroma
- mix deps.get
after_script:
- rm -rf _build/*/lib/pleroma
build:
stage: build
only:
changes: &build_changes_policy
- ".gitlab-ci.yml"
- "**/*.ex"
- "**/*.exs"
- "mix.lock"
script:
- mix deps.get
- mix compile --force
spec-build:
stage: test
only:
changes:
- ".gitlab-ci.yml"
- "lib/pleroma/web/api_spec/**/*.ex"
- "lib/pleroma/web/api_spec.ex"
artifacts:
paths:
- spec.json
@ -48,32 +62,55 @@ benchmark:
variables:
MIX_ENV: benchmark
services:
- name: postgres:9.6
- name: postgres:9.6-alpine
alias: postgres
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
script:
- mix deps.get
- mix ecto.create
- mix ecto.migrate
- mix pleroma.load_testing
unit-testing:
stage: test
retry: 2
only:
changes: *build_changes_policy
cache: &testing_cache_policy
<<: *global_cache_policy
policy: pull
services:
- name: postgres:13
- name: postgres:13-alpine
alias: postgres
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
script:
- apt-get update && apt-get install -y libimage-exiftool-perl ffmpeg
- mix deps.get
- mix ecto.create
- mix ecto.migrate
- mix coveralls --preload-modules
- mix test --cover --preload-modules
coverage: '/^Line total: ([^ ]*%)$/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
unit-testing-erratic:
stage: test
retry: 2
allow_failure: true
only:
changes: *build_changes_policy
cache: &testing_cache_policy
<<: *global_cache_policy
policy: pull
services:
- name: postgres:13-alpine
alias: postgres
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
script:
- mix ecto.create
- mix ecto.migrate
- mix test --only=erratic
# Removed to fix CI issue. In this early state it wasn't adding much value anyway.
# TODO Fix and reinstate federated testing
@ -93,7 +130,8 @@ unit-testing:
unit-testing-rum:
stage: test
retry: 2
only:
changes: *build_changes_policy
cache: *testing_cache_policy
services:
- name: minibikini/postgres-with-rum:12
@ -103,26 +141,45 @@ unit-testing-rum:
<<: *global_variables
RUM_ENABLED: "true"
script:
- apt-get update && apt-get install -y libimage-exiftool-perl ffmpeg
- mix deps.get
- mix ecto.create
- mix ecto.migrate
- "mix ecto.migrate --migrations-path priv/repo/optional_migrations/rum_indexing/"
- mix test --preload-modules
lint:
image: &current_elixir elixir:1.12-alpine
stage: test
only:
changes: *build_changes_policy
cache: *testing_cache_policy
before_script: &current_bfr_script
- apk update
- apk add build-base cmake file-dev git openssl
- mix local.hex --force
- mix local.rebar --force
- mix deps.get
script:
- mix format --check-formatted
analysis:
stage: test
only:
changes: *build_changes_policy
cache: *testing_cache_policy
script:
- mix deps.get
- mix credo --strict --only=warnings,todo,fixme,consistency,readability
cycles:
image: *current_elixir
stage: test
only:
changes: *build_changes_policy
cache: {}
before_script: *current_bfr_script
script:
- mix compile
- mix xref graph --format cycles --label compile | awk '{print $0} END{exit ($0 != "No cycles found")}'
docs-deploy:
stage: deploy
cache: *testing_cache_policy
@ -175,8 +232,8 @@ spec-deploy:
- apk add curl
script:
- curl -X POST -F"token=$API_DOCS_PIPELINE_TRIGGER" -F'ref=master' -F"variables[BRANCH]=$CI_COMMIT_REF_NAME" -F"variables[JOB_REF]=$CI_JOB_ID" https://git.pleroma.social/api/v4/projects/1130/trigger/pipeline
stop_review_app:
image: alpine:3.9
stage: deploy
@ -197,12 +254,14 @@ stop_review_app:
amd64:
stage: release
image: elixir:1.10.3
image: elixir:1.11.4
only: &release-only
- stable@pleroma/pleroma
- develop@pleroma/pleroma
- /^maint/.*$/@pleroma/pleroma
- /^release/.*$/@pleroma/pleroma
tags:
- amd64
artifacts: &release-artifacts
name: "pleroma-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA-$CI_JOB_NAME"
paths:
@ -221,7 +280,7 @@ amd64:
MIX_ENV: prod
before_script: &before-release
- apt-get update && apt-get install -y cmake libmagic-dev
- echo "import Mix.Config" > config/prod.secret.exs
- echo "import Config" > config/prod.secret.exs
- mix local.hex --force
- mix local.rebar --force
script: &release
@ -235,12 +294,14 @@ amd64-musl:
stage: release
artifacts: *release-artifacts
only: *release-only
image: elixir:1.10.3-alpine
image: elixir:1.11.4-alpine
tags:
- amd64
cache: *release-cache
variables: *release-variables
before_script: &before-release-musl
- apk add git gcc g++ musl-dev make cmake file-dev
- echo "import Mix.Config" > config/prod.secret.exs
- apk add git build-base cmake file-dev openssl
- echo "import Config" > config/prod.secret.exs
- mix local.hex --force
- mix local.rebar --force
script: *release
@ -251,7 +312,7 @@ arm:
only: *release-only
tags:
- arm32-specified
image: arm32v7/elixir:1.10.3
image: arm32v7/elixir:1.11.4
cache: *release-cache
variables: *release-variables
before_script: *before-release
@ -263,7 +324,7 @@ arm-musl:
only: *release-only
tags:
- arm32-specified
image: arm32v7/elixir:1.10.3-alpine
image: arm32v7/elixir:1.11.4-alpine
cache: *release-cache
variables: *release-variables
before_script: *before-release-musl
@ -275,7 +336,7 @@ arm64:
only: *release-only
tags:
- arm
image: arm64v8/elixir:1.10.3
image: arm64v8/elixir:1.11.4
cache: *release-cache
variables: *release-variables
before_script: *before-release
@ -287,7 +348,7 @@ arm64-musl:
only: *release-only
tags:
- arm
image: arm64v8/elixir:1.10.3-alpine
image: arm64v8/elixir:1.11.4-alpine
cache: *release-cache
variables: *release-variables
before_script: *before-release-musl
@ -305,8 +366,8 @@ docker:
IMAGE_TAG_SLUG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
IMAGE_TAG_LATEST: $CI_REGISTRY_IMAGE:latest
IMAGE_TAG_LATEST_STABLE: $CI_REGISTRY_IMAGE:latest-stable
DOCKER_BUILDX_URL: https://github.com/docker/buildx/releases/download/v0.4.1/buildx-v0.4.1.linux-amd64
DOCKER_BUILDX_HASH: 71a7d01439aa8c165a25b59c44d3f016fddbd98b
DOCKER_BUILDX_URL: https://github.com/docker/buildx/releases/download/v0.6.3/buildx-v0.6.3.linux-amd64
DOCKER_BUILDX_HASH: 980e6b9655f971991fbbb5fd6cd19f1672386195
before_script: &before-docker
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker pull $IMAGE_TAG_SLUG || true
@ -393,4 +454,4 @@ docker-adhoc:
tags:
- dind
only:
- /^build-docker/.*$/@pleroma/pleroma
- /^build-docker/.*$/@pleroma/pleroma

View File

@ -1,6 +1,8 @@
### Release checklist
* [ ] Bump version in `mix.exs`
* [ ] Compile a changelog
* [ ] Create an MR with an announcement to pleroma.social
* [ ] Tag the release
* [ ] Bump version in `mix.exs`
* [ ] Compile a changelog
* [ ] Create an MR with an announcement to pleroma.social
#### post-merge
* [ ] Tag the release on the merge commit
* [ ] Make the tag into a Gitlab Release™
* [ ] Merge `stable` into `develop` (in case the fixes are already in develop, use `git merge -s ours --no-commit` and manually merge the changelogs)

View File

@ -4,7 +4,176 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [2.3.0] - 2020-03-01
## Unreleased
### Changed
### Added
### Fixed
### Removed
## 2.5.0 - 2022-12-23
### Removed
- MastoFE
- Quack, the logging backend that pushes to Slack channels
### Changed
- **Breaking:** Elixir >=1.11 is now required (was >= 1.9)
- Allow users to remove their emails if instance does not need email to register
- Uploadfilter `Pleroma.Upload.Filter.Exiftool` has been renamed to `Pleroma.Upload.Filter.Exiftool.StripLocation`
- **Breaking**: `/api/v1/pleroma/backups` endpoints now requires `read:backups` scope instead of `read:accounts`
- Updated the recommended pleroma.vcl configuration for Varnish to target Varnish 7.0+
- Set timeout values for Oban queues. The default is infinity and some operations may not time out on their own.
- Delete activities are federated at lowest priority
- CSP now includes wasm-unsafe-eval
### Added
- `activeMonth` and `activeHalfyear` fields in NodeInfo usage.users object
- Experimental support for Finch. Put `config :tesla, :adapter, {Tesla.Adapter.Finch, name: MyFinch}` in your secrets file to use it. Reverse Proxy will still use Hackney.
- `ForceMentionsInPostContent` MRF policy
- PleromaAPI: Add remote follow API endpoint at `POST /api/v1/pleroma/remote_interaction`
- MastoAPI: Add `GET /api/v1/accounts/lookup`
- MastoAPI: Profile Directory support
- MastoAPI: Support v2 Suggestions (handpicked accounts only)
- Ability to log slow Ecto queries by configuring `:pleroma, :telemetry, :slow_queries_logging`
- Added Phoenix LiveDashboard at `/phoenix/live_dashboard`
- Added `/manifest.json` for progressive web apps.
- MastoAPI: Support for `birthday` and `show_birthday` field in `/api/v1/accounts/update_credentials`.
- Configuration: Add `birthday_required` and `birthday_min_age` settings to provide a way to require users to enter their birth date.
- PleromaAPI: Add `GET /api/v1/pleroma/birthdays` API endpoint
- Make backend-rendered pages translatable. This includes emails. Pages returned as a HTTP response are translated using the language specified in the `userLanguage` cookie, or the `Accept-Language` header. Emails are translated using the `language` field when registering. This language can be changed by `PATCH /api/v1/accounts/update_credentials` with the `language` field.
- Add fine grained options to provide privileges to moderators and admins (e.g. delete messages, manage reports...)
- Uploadfilter `Pleroma.Upload.Filter.Exiftool.ReadDescription` returns description values to the FE so they can pre fill the image description field
- Added move account API
- Enable remote users to interact with posts
- Possibility to discover users like `user@example.org`, while Pleroma is working on `pleroma.example.org`. Additional configuration required.
### Fixed
- Subscription(Bell) Notifications: Don't create from Pipeline Ingested replies
- Handle Reject for already-accepted Follows properly
- Display OpenGraph data on alternative notice routes.
- Fix replies count for remote replies
- Fixed hashtags disappearing from the end of lines when Markdown is enabled
- ChatAPI: Add link headers
- Limited number of search results to 40 to prevent DoS attacks
- ActivityPub: fixed federation of attachment dimensions
- Fixed benchmarks
- Elixir 1.13 support
- Fixed crash when pinned_objects is nil
- Fixed slow timelines when there are a lot of deactivated users
- Fixed account deletion API
- Fixed lowercase HTTP HEAD method in the Media Proxy Preview code
- Removed useless notification call on Delete activities
- Improved performance for filtering out deactivated and invisible users
- RSS and Atom feeds for users work again
- TwitterCard meta tags conformance
## 2.4.5 - 2022-11-27
## Fixed
- Image `class` attributes not being scrubbed, allowing to exploit frontend special classes [!3792](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3792)
- Delete report notifs when demoting from superuser [!3642](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3642)
- Validate `mediaType` only by it's format rather than using a list [!3597](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3597)
- Pagination: Make mutes and blocks lists behave the same as other lists [!3693](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3693)
- Compatibility with Elixir 1.14 [!3740](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3740)
- Frontend installer: FediFE build URL [!3736](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3736)
- Streaming: Don't stream ChatMessage into the home timeline [!3738](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3738)
- Streaming: Stream local-only posts in the local timeline [!3738](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3738)
- Signatures: Fix `keyId` lookup for GoToSocial [!3725](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3725)
- Validator: Fix `replies` handling for GoToSocial [!3725](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3725)
## 2.4.4 - 2022-08-19
### Security
- Streaming API sessions will now properly disconnect if the corresponding token is revoked
## 2.4.3 - 2022-05-06
### Security
- Private `/objects/` and `/activities/` leaking if cached by authenticated user
- SweetXML library DTD bomb
## 2.4.2 - 2022-01-10
### Fixed
- Federation issues caused by HTTP pool checkout timeouts
- Compatibility with Elixir 1.13
### Upgrade notes
1. Restart Pleroma
## 2.4.1 - 2021-08-29
### Changed
- Make `mix pleroma.database set_text_search_config` run concurrently and indefinitely
### Added
- AdminAPI: Missing configuration description for StealEmojiPolicy
### Fixed
- MastodonAPI: Stream out Create activities
- MRF ObjectAgePolicy: Fix pattern matching on "published"
- TwitterAPI: Make `change_password` and `change_email` require params on body instead of query
- Subscription(Bell) Notifications: Don't create from Pipeline Ingested replies
- AdminAPI: Fix rendering reports containing a `nil` object
- Mastodon API: Activity Search fallbacks on status fetching after a DB Timeout/Error
- Mastodon API: Fix crash in Streamer related to reblogging
- AdminAPI: List available frontends when `static/frontends` folder is missing
- Make activity search properly use language-aware GIN indexes
- AdminAPI: Fix suggestions for MRF Policies
## 2.4.0 - 2021-08-08
### Changed
- **Breaking:** Configuration: `:chat, enabled` moved to `:shout, enabled` and `:instance, chat_limit` moved to `:shout, limit`
- **Breaking** Entries for simple_policy, transparency_exclusions and quarantined_instances now list both the instance and a reason.
- Support for Erlang/OTP 24
- The `application` metadata returned with statuses is no longer hardcoded. Apps that want to display these details will now have valid data for new posts after this change.
- HTTPSecurityPlug now sends a response header to opt out of Google's FLoC (Federated Learning of Cohorts) targeted advertising.
- Email address is now returned if requesting user is the owner of the user account so it can be exposed in client and FE user settings UIs.
- Improved Twittercard and OpenGraph meta tag generation including thumbnails and image dimension metadata when available.
- AdminAPI: sort users so the newest are at the top.
- ActivityPub Client-to-Server(C2S): Limitation on the type of Activity/Object are lifted as they are now passed through ObjectValidators
- MRF (`AntiFollowbotPolicy`): Bot accounts are now also considered followbots. Users can still allow bots to follow them by first following the bot.
### Added
- MRF (`FollowBotPolicy`): New MRF Policy which makes a designated local Bot account attempt to follow all users in public Notes received by your instance. Users who require approving follower requests or have #nobot in their profile are excluded.
- Return OAuth token `id` (primary key) in POST `/oauth/token`.
- AdminAPI: return `created_at` date with users.
- AdminAPI: add DELETE `/api/v1/pleroma/admin/instances/:instance` to delete all content from a remote instance.
- `AnalyzeMetadata` upload filter for extracting image/video attachment dimensions and generating blurhashes for images. Blurhashes for videos are not generated at this time.
- Attachment dimensions and blurhashes are federated when available.
- Mastodon API: support `poll` notification.
- Pinned posts federation
### Fixed
- Don't crash so hard when email settings are invalid.
- Checking activated Upload Filters for required commands.
- Remote users can no longer reappear after being deleted.
- Deactivated users may now be deleted.
- Deleting an activity with a lot of likes/boosts no longer causes a database timeout.
- Mix task `pleroma.database prune_objects`
- Fixed rendering of JSON errors on ActivityPub endpoints.
- Linkify: Parsing crash with URLs ending in unbalanced closed paren, no path separator, and no query parameters
- Try to save exported ConfigDB settings (migrate_from_db) in the system temp directory if default location is not writable.
- Uploading custom instance thumbnail via AdminAPI/AdminFE generated invalid URL to the image
- Applying ConcurrentLimiter settings via AdminAPI
- User login failures if their `notification_settings` were in a NULL state.
- Mix task `pleroma.user delete_activities` query transaction timeout is now :infinity
- MRF (`SimplePolicy`): Embedded objects are now checked. If any embedded object would be rejected, its parent is rejected. This fixes Announces leaking posts from blocked domains.
- Fixed some Markdown issues, including trailing slash in links.
### Removed
- **Breaking**: Remove deprecated `/api/qvitter/statuses/notifications/read` (replaced by `/api/v1/pleroma/notifications/read`)
## [2.3.0] - 2021-03-01
### Security
@ -18,6 +187,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- **Breaking**: Changed `mix pleroma.user toggle_confirmed` to `mix pleroma.user confirm`
- **Breaking**: Changed `mix pleroma.user toggle_activated` to `mix pleroma.user activate/deactivate`
- **Breaking:** NSFW hashtag is no longer added on sensitive posts
- Polls now always return a `voters_count`, even if they are single-choice.
- Admin Emails: The ap id is used as the user link in emails now.
- Improved registration workflow for email confirmation and account approval modes.
@ -44,6 +214,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Pleroma API: Reroute `/api/pleroma/*` to `/api/v1/pleroma/*`
</details>
- Improved hashtag timeline performance (requires a background migration).
### Added
@ -52,6 +223,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Support pagination of blocks and mutes.
- Account backup.
- Configuration: Add `:instance, autofollowing_nicknames` setting to provide a way to make accounts automatically follow new users that register on the local Pleroma instance.
- `[:activitypub, :blockers_visible]` config to control visibility of blockers.
- Ability to view remote timelines, with ex. `/api/v1/timelines/public?instance=lain.com` and streams `public:remote` and `public:remote:media`.
- The site title is now injected as a `title` tag like preloads or metadata.
- Password reset tokens now are not accepted after a certain age.
@ -67,6 +239,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
<details>
<summary>API Changes</summary>
- Admin API: (`GET /api/pleroma/admin/users`) filter users by `unconfirmed` status and `actor_type`.
- Admin API: OpenAPI spec for the user-related operations
- Pleroma API: `GET /api/v2/pleroma/chats` added. It is exactly like `GET /api/v1/pleroma/chats` except supports pagination.
- Pleroma API: Add `idempotency_key` to the chat message entity that can be used for optimistic message sending.
- Pleroma API: (`GET /api/v1/pleroma/federation_status`) Add a way to get a list of unreachable instances.
@ -102,7 +275,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Mastodon API: Support for expires_in/expires_at in the Filters.
</details>
## [2.2.2] - 2020-01-18
## [2.2.2] - 2021-01-18
### Fixed
@ -498,7 +671,6 @@ switched to a new configuration mechanism, however it was not officially removed
- Static-FE: Fix remote posts not being sanitized
### Fixed
=======
- Rate limiter crashes when there is no explicitly specified ip in the config
- 500 errors when no `Accept` header is present if Static-FE is enabled
- Instance panel not being updated immediately due to wrong `Cache-Control` headers

View File

@ -1,11 +1,11 @@
Unless otherwise stated this repository is copyright © 2017-2021
Unless otherwise stated this repository is copyright © 2017-2022
Pleroma Authors <https://pleroma.social/>, and is distributed under
The GNU Affero General Public License Version 3, you should have received a
copy of the license file as AGPL-3.
---
Files inside docs directory are copyright © 2021 Pleroma Authors
Files inside docs directory are copyright © 2022 Pleroma Authors
<https://pleroma.social/>, and are distributed under the Creative Commons
Attribution 4.0 International license, you should have received
a copy of the license file as CC-BY-4.0.
@ -30,7 +30,7 @@ priv/static/images/pleroma-fox-tan-shy.png
---
The following files are copyright © 2017-2020 Pleroma Authors
The following files are copyright © 2017-2022 Pleroma Authors
<https://pleroma.social/>, and are distributed under the Creative Commons
Attribution-ShareAlike 4.0 International license, you should have received
a copy of the license file as CC-BY-SA-4.0.

View File

@ -1,18 +1,18 @@
FROM elixir:1.9-alpine as build
FROM elixir:1.11.4-alpine as build
COPY . .
ENV MIX_ENV=prod
RUN apk add git gcc g++ musl-dev make cmake file-dev &&\
echo "import Mix.Config" > config/prod.secret.exs &&\
echo "import Config" > config/prod.secret.exs &&\
mix local.hex --force &&\
mix local.rebar --force &&\
mix deps.get --only prod &&\
mkdir release &&\
mix release --path release
FROM alpine:3.11
FROM alpine
ARG BUILD_DATE
ARG VCS_REF
@ -31,9 +31,8 @@ LABEL maintainer="ops@pleroma.social" \
ARG HOME=/opt/pleroma
ARG DATA=/var/lib/pleroma
RUN echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories &&\
apk update &&\
apk add exiftool imagemagick libmagic ncurses postgresql-client &&\
RUN apk update &&\
apk add exiftool ffmpeg imagemagick libmagic ncurses postgresql-client &&\
adduser --system --shell /bin/false --home ${HOME} pleroma &&\
mkdir -p ${DATA}/uploads &&\
mkdir -p ${DATA}/static &&\

View File

@ -30,11 +30,14 @@ If your platform is not supported, or you just want to be able to edit the sourc
- [OpenBSD (fi)](https://docs-develop.pleroma.social/backend/installation/openbsd_fi/)
### OS/Distro packages
Currently Pleroma is not packaged by any OS/Distros, but if you want to package it for one, we can guide you through the process on our [community channels](#community-channels). If you want to change default options in your Pleroma package, please **discuss it with us first**.
Currently Pleroma is packaged for [YunoHost](https://yunohost.org) and [NixOS](https://nixos.org). If you want to package Pleroma for any OS/Distros, we can guide you through the process on our [community channels](#community-channels). If you want to change default options in your Pleroma package, please **discuss it with us first**.
### Docker
While we dont provide docker files, other people have written very good ones. Take a look at <https://github.com/angristan/docker-pleroma> or <https://glitch.sh/sn0w/pleroma-docker>.
### Raspberry Pi
Community maintained Raspberry Pi image that you can flash and run Pleroma on your Raspberry Pi. Available here <https://github.com/guysoft/PleromaPi>.
### Compilation Troubleshooting
If you ever encounter compilation issues during the updating of Pleroma, you can try these commands and see if they fix things:
@ -50,5 +53,5 @@ If you are not developing Pleroma, it is better to use the OTP release, which co
- Latest Git revision: <https://docs-develop.pleroma.social>
## Community Channels
* IRC: **#pleroma** and **#pleroma-dev** on freenode, webchat is available at <https://irc.pleroma.social>
* Matrix: <https://matrix.to/#/#freenode_#pleroma:matrix.org> and <https://matrix.to/#/#freenode_#pleroma-dev:matrix.org>
* IRC: **#pleroma** and **#pleroma-dev** on libera.chat, webchat is available at <https://irc.pleroma.social>
* Matrix: [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) and [#pleroma-dev:libera.chat](https://matrix.to/#/#pleroma-dev:libera.chat)

View File

@ -299,7 +299,7 @@ defp insert_activity(:attachment, visibility, group, users, _opts) do
"url" => [
%{
"href" =>
"#{Pleroma.Web.base_url()}/media/b1b873552422a07bf53af01f3c231c841db4dfc42c35efde681abaf0f2a4eab7.jpg",
"#{Pleroma.Web.Endpoint.url()}/media/b1b873552422a07bf53af01f3c231c841db4dfc42c35efde681abaf0f2a4eab7.jpg",
"mediaType" => "image/jpeg",
"type" => "Link"
}
@ -394,7 +394,7 @@ defp get_actor(group, users), do: Enum.random(users[group])
defp other_data(actor, content) do
%{host: host} = URI.parse(actor.ap_id)
datetime = DateTime.utc_now()
datetime = DateTime.utc_now() |> to_string()
context_id = "https://#{host}/contexts/#{UUID.generate()}"
activity_id = "https://#{host}/activities/#{UUID.generate()}"
object_id = "https://#{host}/objects/#{UUID.generate()}"

View File

@ -99,15 +99,16 @@ defp hashtag_fetching(params, user, local_only) do
|> Enum.map(&String.downcase(&1))
_activities =
params
|> Map.put(:type, "Create")
|> Map.put(:local_only, local_only)
|> Map.put(:blocking_user, user)
|> Map.put(:muting_user, user)
|> Map.put(:user, user)
|> Map.put(:tag, tags)
|> Map.put(:tag_all, tag_all)
|> Map.put(:tag_reject, tag_reject)
%{
type: "Create",
local_only: local_only,
blocking_user: user,
muting_user: user,
user: user,
tag: tags,
tag_all: tag_all,
tag_reject: tag_reject,
}
|> Pleroma.Web.ActivityPub.ActivityPub.fetch_public_activities()
end
end

View File

@ -17,14 +17,14 @@ def run(_args) do
# Let the user make 100 posts
1..100
|> Enum.each(fn i -> CommonAPI.post(user, %{"status" => to_string(i)}) end)
|> Enum.each(fn i -> CommonAPI.post(user, %{status: to_string(i)}) end)
# Let 10 random users post
posts =
users
|> Enum.take_random(10)
|> Enum.map(fn {:ok, random_user} ->
{:ok, activity} = CommonAPI.post(random_user, %{"status" => "."})
{:ok, activity} = CommonAPI.post(random_user, %{status: "."})
activity
end)
@ -42,7 +42,7 @@ def run(_args) do
|> Conn.assign(:user, reading_user)
|> Conn.assign(:skip_link_headers, true)
Pleroma.Web.MastodonAPI.AccountController.statuses(conn, %{"id" => user.id})
Pleroma.Web.MastodonAPI.AccountController.statuses(conn, %{id: user.id})
end
},
inputs: %{"user" => user, "no user" => nil},
@ -50,7 +50,7 @@ def run(_args) do
)
users
|> Enum.each(fn {:ok, follower, user} -> Pleroma.User.follow(follower, user) end)
|> Enum.each(fn {:ok, follower} -> Pleroma.User.follow(follower, user) end)
Benchee.run(
%{
@ -60,7 +60,7 @@ def run(_args) do
|> Conn.assign(:user, reading_user)
|> Conn.assign(:skip_link_headers, true)
Pleroma.Web.MastodonAPI.AccountController.statuses(conn, %{"id" => user.id})
Pleroma.Web.MastodonAPI.AccountController.statuses(conn, %{id: user.id})
end
},
inputs: %{"user" => user, "no user" => nil},

8
ci/Dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM elixir:1.11.4
# Single RUN statement, otherwise intermediate images are created
# https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run
RUN apt-get update &&\
apt-get install -y libmagic-dev cmake libimage-exiftool-perl ffmpeg &&\
mix local.hex --force &&\
mix local.rebar --force

12
ci/README Normal file
View File

@ -0,0 +1,12 @@
## Dependencies
Assuming an AMD64 Alpine system, you're going to need the following packages
- `qemu qemu-openrc qemu-arm qemu-aarch64` for binfmt
- `docker-cli-buildx` for building the images
## Setting up
```
docker login git.pleroma.social:5050
doas rc-service qemu-binfmt start
```

1
ci/build_and_push.sh Executable file
View File

@ -0,0 +1 @@
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t git.pleroma.social:5050/pleroma/pleroma/ci-base:latest --push .

View File

@ -1,11 +1,10 @@
use Mix.Config
import Config
# We don't run a server during test. If one is required,
# you can enable the server option below.
config :pleroma, Pleroma.Web.Endpoint,
http: [port: 4001],
url: [port: 4001],
server: true
url: [port: 4001]
# Disable captha for tests
config :pleroma, Pleroma.Captcha,
@ -41,10 +40,11 @@
password: "postgres",
database: "pleroma_benchmark",
hostname: System.get_env("DB_HOST") || "localhost",
port: System.get_env("DB_PORT") || "5432",
pool_size: 10
# Reduce hash rounds for testing
config :pbkdf2_elixir, rounds: 1
config :pleroma, :password, iterations: 1
config :tesla, adapter: Tesla.Mock

View File

@ -37,11 +37,11 @@
# FIGURATION! EDIT YOUR SECRET FILE (either prod.secret.exs, dev.secret.exs).
#
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
# and its dependencies with the aid of the Config module.
#
# This configuration file is loaded before any dependency and
# is restricted to this project.
use Mix.Config
import Config
# General application configuration
config :pleroma, ecto_repos: [Pleroma.Repo]
@ -139,6 +139,7 @@
],
protocol: "https",
secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
live_view: [signing_salt: "U5ELgdEwTD3n1+D5s0rY0AMg8/y1STxZ3Zvsl3bWh+oBcGrYdil0rXqPMRd3Glcq"],
signing_salt: "CqaoopA2",
render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
pubsub_server: Pleroma.PubSub,
@ -159,11 +160,6 @@
format: "$metadata[$level] $message",
metadata: [:request_id]
config :quack,
level: :warn,
meta: [:all],
webhook_url: "https://hooks.slack.com/services/YOUR-KEY-HERE"
config :mime, :types, %{
"application/xml" => ["xml"],
"application/xrd+xml" => ["xrd+xml"],
@ -186,11 +182,11 @@
email: "example@example.com",
notify_email: "noreply@example.com",
description: "Pleroma: An efficient and flexible fediverse server",
short_description: "",
background_image: "/images/city.jpg",
instance_thumbnail: "/instance/thumbnail.jpeg",
limit: 5_000,
description_limit: 5_000,
chat_limit: 5_000,
remote_limit: 100_000,
upload_limit: 16_000_000,
avatar_upload_limit: 2_000_000,
@ -227,6 +223,7 @@
max_pinned_statuses: 1,
attachment_links: false,
max_report_comment_size: 1000,
report_strip_status: true,
safe_dm_mentions: false,
healthcheck: false,
remote_post_retention_days: 90,
@ -254,7 +251,29 @@
]
],
show_reactions: true,
password_reset_token_validity: 60 * 60 * 24
password_reset_token_validity: 60 * 60 * 24,
profile_directory: true,
admin_privileges: [
:users_read,
:users_manage_invites,
:users_manage_activation_state,
:users_manage_tags,
:users_manage_credentials,
:users_delete,
:messages_read,
:messages_delete,
:instances_delete,
:reports_manage_reports,
:moderation_log_read,
:announcements_manage_announcements,
:emoji_manage_emoji,
:statistics_read
],
moderator_privileges: [:messages_delete, :reports_manage_reports],
max_endorsed_users: 20,
birthday_required: false,
birthday_min_age: 0,
max_media_attachments: 1_000
config :pleroma, :welcome,
direct_message: [
@ -322,9 +341,6 @@
subjectLineBehavior: "email",
theme: "pleroma-dark",
webPushNotifications: false
},
masto_fe: %{
showInstanceSpecificPanel: true
}
config :pleroma, :assets,
@ -353,6 +369,7 @@
config :pleroma, :activitypub,
unfollow_blocked: true,
outgoing_blocks: true,
blockers_visible: true,
follow_handshake_timeout: 500,
note_replies_output_limit: 5,
sign_object_fetches: true,
@ -391,6 +408,11 @@
federated_timeline_removal: [],
replace: []
config :pleroma, :mrf_hashtag,
sensitive: ["nsfw"],
reject: [],
federated_timeline_removal: []
config :pleroma, :mrf_subchain, match_actor: %{}
config :pleroma, :mrf_activity_expiration, days: 365
@ -404,6 +426,8 @@
threshold: 604_800,
actions: [:delist, :strip_followers]
config :pleroma, :mrf_follow_bot, follower_nickname: nil
config :pleroma, :rich_media,
enabled: true,
ignore_hosts: [],
@ -450,9 +474,11 @@
image_quality: 85,
min_content_length: 100 * 1024
config :pleroma, :chat, enabled: true
config :pleroma, :shout,
enabled: true,
limit: 5_000
config :phoenix, :format_encoders, json: Jason
config :phoenix, :format_encoders, json: Jason, "activity+json": Jason
config :phoenix, :json_library, Jason
@ -545,13 +571,14 @@
token_expiration: 5,
filter_expiration: 1,
backup: 1,
federator_incoming: 50,
federator_outgoing: 50,
federator_incoming: 5,
federator_outgoing: 5,
ingestion_queue: 50,
web_push: 50,
mailer: 10,
transmogrifier: 20,
scheduled_activities: 10,
poll_notifications: 10,
background: 5,
remote_fetcher: 2,
attachments_cleanup: 1,
@ -654,6 +681,12 @@
config :pleroma, :database, rum_enabled: false
config :pleroma, :features, improved_hashtag_timeline: :auto
config :pleroma, :populate_hashtags_table, fault_rate_allowance: 0.01
config :pleroma, :delete_context_objects, fault_rate_allowance: 0.01
config :pleroma, :env, Mix.env()
config :http_signatures,
@ -722,7 +755,7 @@
"name" => "fedi-fe",
"git" => "https://git.pleroma.social/pleroma/fedi-fe",
"build_url" =>
"https://git.pleroma.social/pleroma/fedi-fe/-/jobs/artifacts/${ref}/download?job=build",
"https://git.pleroma.social/pleroma/fedi-fe/-/jobs/artifacts/${ref}/download?job=build_release",
"ref" => "master",
"custom-http-headers" => [
{"service-worker-allowed", "/"}
@ -735,13 +768,21 @@
"https://git.pleroma.social/pleroma/admin-fe/-/jobs/artifacts/${ref}/download?job=build",
"ref" => "develop"
},
"soapbox-fe" => %{
"name" => "soapbox-fe",
"git" => "https://gitlab.com/soapbox-pub/soapbox-fe",
"soapbox" => %{
"name" => "soapbox",
"git" => "https://gitlab.com/soapbox-pub/soapbox",
"build_url" =>
"https://gitlab.com/soapbox-pub/soapbox-fe/-/jobs/artifacts/${ref}/download?job=build-production",
"ref" => "v1.0.0",
"https://gitlab.com/soapbox-pub/soapbox/-/jobs/artifacts/${ref}/download?job=build-production",
"ref" => "v3.0.0-beta.1",
"build_dir" => "static"
},
"glitch-lily" => %{
"name" => "glitch-lily",
"git" => "https://lily-is.land/infra/glitch-lily",
"build_url" =>
"https://lily-is.land/infra/glitch-lily/-/jobs/artifacts/${ref}/download?job=build",
"ref" => "servant",
"build_dir" => "public"
}
}
@ -840,6 +881,8 @@
{Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy, [max_running: 5, max_waiting: 5]}
]
config :pleroma, Pleroma.Web.WebFinger, domain: nil, update_nickname_on_user_fetch: true
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs"

View File

@ -1,4 +1,4 @@
use Mix.Config
import Config
websocket_config = [
path: "/websocket",
@ -459,6 +459,63 @@
}
]
},
%{
group: :pleroma,
key: :features,
type: :group,
description: "Customizable features",
children: [
%{
key: :improved_hashtag_timeline,
type: {:dropdown, :atom},
description:
"Setting to force toggle / force disable improved hashtags timeline. `:enabled` forces hashtags to be fetched from `hashtags` table for hashtags timeline. `:disabled` forces object-embedded hashtags to be used (slower). Keep it `:auto` for automatic behaviour (it is auto-set to `:enabled` [unless overridden] when HashtagsTableMigrator completes).",
suggestions: [:auto, :enabled, :disabled]
}
]
},
%{
group: :pleroma,
key: :populate_hashtags_table,
type: :group,
description: "`populate_hashtags_table` background migration settings",
children: [
%{
key: :fault_rate_allowance,
type: :float,
description:
"Max accepted rate of objects that failed in the migration. Any value from 0.0 which tolerates no errors to 1.0 which will enable the feature even if hashtags transfer failed for all records.",
suggestions: [0.01]
},
%{
key: :sleep_interval_ms,
type: :integer,
description:
"Sleep interval between each chunk of processed records in order to decrease the load on the system (defaults to 0 and should be keep default on most instances)."
}
]
},
%{
group: :pleroma,
key: :delete_context_objects,
type: :group,
description: "`delete_context_objects` background migration settings",
children: [
%{
key: :fault_rate_allowance,
type: :float,
description:
"Max accepted rate of objects that failed in the migration. Any value from 0.0 which tolerates no errors to 1.0 which will enable the feature even if context object deletion failed for all records.",
suggestions: [0.01]
},
%{
key: :sleep_interval_ms,
type: :integer,
description:
"Sleep interval between each chunk of processed records in order to decrease the load on the system (defaults to 0 and should be keep default on most instances)."
}
]
},
%{
group: :pleroma,
key: :instance,
@ -501,17 +558,18 @@
]
},
%{
key: :limit,
type: :integer,
description: "Posts character limit (CW/Subject included in the counter)",
key: :short_description,
type: :string,
description:
"Shorter version of instance description. It can be seen on `/api/v1/instance`",
suggestions: [
5_000
"Cool instance"
]
},
%{
key: :chat_limit,
key: :limit,
type: :integer,
description: "Character limit of the instance chat messages",
description: "Posts character limit (CW/Subject included in the counter)",
suggestions: [
5_000
]
@ -524,6 +582,14 @@
100_000
]
},
%{
key: :max_media_attachments,
type: :integer,
description: "Maximum number of post media attachments",
suggestions: [
1_000_000
]
},
%{
key: :upload_limit,
type: :integer,
@ -646,7 +712,8 @@
%{
key: :allow_relay,
type: :boolean,
description: "Enable Pleroma's Relay, which makes it possible to follow a whole instance"
description:
"Permits remote instances to subscribe to all public posts of your instance. (Important!) This may increase the visibility of your instance."
},
%{
key: :public,
@ -658,12 +725,14 @@
},
%{
key: :quarantined_instances,
type: {:list, :string},
type: {:list, :tuple},
key_placeholder: "instance",
value_placeholder: "reason",
description:
"List of ActivityPub instances where private (DMs, followers-only) activities will not be sent",
"List of ActivityPub instances where private (DMs, followers-only) activities will not be sent and the reason for doing so",
suggestions: [
"quarantined.com",
"*.quarantined.com"
{"quarantined.com", "Reason"},
{"*.quarantined.com", "Reason"}
]
},
%{
@ -711,6 +780,16 @@
3
]
},
%{
key: :max_endorsed_users,
type: :integer,
description: "The maximum number of recommended accounts. 0 will disable the feature.",
suggestions: [
0,
1,
3
]
},
%{
key: :autofollowed_nicknames,
type: {:list, :string},
@ -736,6 +815,13 @@
1_000
]
},
%{
key: :report_strip_status,
label: "Report strip status",
type: :boolean,
description:
"Strip associated statuses in reports to ids when closed/resolved, otherwise keep a copy"
},
%{
key: :safe_dm_mentions,
label: "Safe DM mentions",
@ -905,6 +991,67 @@
key: :show_reactions,
type: :boolean,
description: "Let favourites and emoji reactions be viewed through the API."
},
%{
key: :profile_directory,
type: :boolean,
description: "Enable profile directory."
},
%{
key: :admin_privileges,
type: {:list, :atom},
suggestions: [
:users_read,
:users_manage_invites,
:users_manage_activation_state,
:users_manage_tags,
:users_manage_credentials,
:users_delete,
:messages_read,
:messages_delete,
:instances_delete,
:reports_manage_reports,
:moderation_log_read,
:announcements_manage_announcements,
:emoji_manage_emoji,
:statistics_read
],
description:
"What extra privileges to allow admins (e.g. updating user credentials, get password reset token, delete users, index and read private statuses and chats)"
},
%{
key: :moderator_privileges,
type: {:list, :atom},
suggestions: [
:users_read,
:users_manage_invites,
:users_manage_activation_state,
:users_manage_tags,
:users_manage_credentials,
:users_delete,
:messages_read,
:messages_delete,
:instances_delete,
:reports_manage_reports,
:moderation_log_read,
:announcements_manage_announcements,
:emoji_manage_emoji,
:statistics_read
],
description:
"What extra privileges to allow moderators (e.g. updating user credentials, get password reset token, delete users, index and read private statuses and chats)"
},
%{
key: :birthday_required,
type: :boolean,
description: "Require users to enter their birthday."
},
%{
key: :birthday_min_age,
type: :integer,
description:
"Minimum required age (in days) for users to create account. Only used if birthday is required.",
suggestions: [6570]
}
]
},
@ -1088,52 +1235,13 @@
}
]
},
%{
group: :quack,
type: :group,
label: "Quack Logger",
description: "Quack-related settings",
children: [
%{
key: :level,
type: {:dropdown, :atom},
description: "Log level",
suggestions: [:debug, :info, :warn, :error]
},
%{
key: :meta,
type: {:list, :atom},
description: "Configure which metadata you want to report on",
suggestions: [
:application,
:module,
:file,
:function,
:line,
:pid,
:crash_reason,
:initial_call,
:registered_name,
:all,
:none
]
},
%{
key: :webhook_url,
label: "Webhook URL",
type: :string,
description: "Configure the Slack incoming webhook",
suggestions: ["https://hooks.slack.com/services/YOUR-KEY-HERE"]
}
]
},
%{
group: :pleroma,
key: :frontend_configurations,
type: :group,
description:
"This form can be used to configure a keyword list that keeps the configuration data for any " <>
"kind of frontend. By default, settings for pleroma_fe and masto_fe are configured. If you want to " <>
"kind of frontend. By default, settings for pleroma_fe are configured. If you want to " <>
"add your own configuration your settings all fields must be complete.",
children: [
%{
@ -1146,7 +1254,6 @@
alwaysShowSubjectInput: true,
background: "/static/aurora_borealis.jpg",
collapseMessageWithSubject: false,
disableChat: false,
greentext: false,
hideFilteredStatuses: false,
hideMutedPosts: false,
@ -1193,12 +1300,6 @@
description:
"When a message has a subject (aka Content Warning), collapse it by default"
},
%{
key: :disableChat,
label: "PleromaFE Chat",
type: :boolean,
description: "Disables PleromaFE Chat component"
},
%{
key: :greentext,
label: "Greentext",
@ -1340,25 +1441,6 @@
suggestions: ["pleroma-dark"]
}
]
},
%{
key: :masto_fe,
label: "Masto FE",
type: :map,
description: "Settings for Masto FE",
suggestions: [
%{
showInstanceSpecificPanel: true
}
],
children: [
%{
key: :showInstanceSpecificPanel,
label: "Show instance specific panel",
type: :boolean,
description: "Whenether to show the instance's specific panel"
}
]
}
]
},
@ -1665,11 +1747,21 @@
type: :boolean,
description: "Whether to federate blocks to other instances"
},
%{
key: :blockers_visible,
type: :boolean,
description: "Whether a user can see someone who has blocked them"
},
%{
key: :sign_object_fetches,
type: :boolean,
description: "Sign object fetches with HTTP signatures"
},
%{
key: :authorized_fetch_mode,
type: :boolean,
description: "Require HTTP signatures for AP fetches"
},
%{
key: :note_replies_output_limit,
type: :integer,
@ -2616,13 +2708,22 @@
},
%{
group: :pleroma,
key: :chat,
key: :shout,
type: :group,
description: "Pleroma chat settings",
description: "Pleroma shout settings",
children: [
%{
key: :enabled,
type: :boolean
type: :boolean,
description: "Enables the backend Shoutbox chat feature."
},
%{
key: :limit,
type: :integer,
description: "Shout message character limit.",
suggestions: [
5_000
]
}
]
},
@ -2667,7 +2768,7 @@
key: :versions,
type: {:list, :atom},
description: "List of TLS version to use",
suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2"]
suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2", ":tlsv1.3"]
}
]
}
@ -2906,6 +3007,23 @@
}
]
},
%{
group: :pleroma,
key: :mrf_follow_bot,
tab: :mrf,
related_policy: "Pleroma.Web.ActivityPub.MRF.FollowBotPolicy",
label: "MRF FollowBot Policy",
type: :group,
description: "Automatically follows newly discovered accounts.",
children: [
%{
key: :follower_nickname,
type: :string,
description: "The name of the bot account to use for following newly discovered users.",
suggestions: ["followbot"]
}
]
},
%{
group: :pleroma,
key: :modules,

View File

@ -1,4 +1,4 @@
use Mix.Config
import Config
# For development, we disable any cache and enable
# debugging and code reloading.
@ -54,10 +54,15 @@
config :pleroma, Pleroma.Web.ApiSpec.CastAndValidate, strict: true
# Reduce recompilation time
# https://dashbit.co/blog/speeding-up-re-compilation-of-elixir-projects
config :phoenix, :plug_init_mode, :runtime
if File.exists?("./config/dev.secret.exs") do
import_config "dev.secret.exs"
else
IO.puts(
:stderr,
"!!! RUNNING IN LOCALHOST DEV MODE! !!!\nFEDERATION WON'T WORK UNTIL YOU CONFIGURE A dev.secret.exs"
)
end

View File

@ -18,6 +18,7 @@
password: System.fetch_env!("DB_PASS"),
database: System.get_env("DB_NAME", "pleroma"),
hostname: System.get_env("DB_HOST", "db"),
port: System.get_env("DB_PORT", "5432"),
pool_size: 10
# Configure web push notifications

View File

@ -1,4 +1,4 @@
use Mix.Config
import Config
config :pleroma, Pleroma.Web.Endpoint,
http: [

View File

@ -1,4 +1,4 @@
use Mix.Config
import Config
# For production, we often load configuration from external
# sources, such as your system environment. For this reason,
@ -63,7 +63,12 @@
# Finally import the config/prod.secret.exs
# which should be versioned separately.
import_config "prod.secret.exs"
if File.exists?("./config/prod.secret.exs") do
import_config "prod.secret.exs"
else
"`config/prod.secret.exs` not found. You may want to create one by running `mix pleroma.instance gen`"
|> IO.warn([])
end
if File.exists?("./config/prod.exported_from_db.secret.exs"),
do: import_config("prod.exported_from_db.secret.exs")

View File

@ -1,4 +1,4 @@
use Mix.Config
import Config
# We don't run a server during test. If one is required,
# you can enable the server option below.
@ -47,6 +47,7 @@
password: "postgres",
database: "pleroma_test",
hostname: System.get_env("DB_HOST") || "localhost",
port: System.get_env("DB_PORT") || "5432",
pool: Ecto.Adapters.SQL.Sandbox,
pool_size: 50
@ -81,10 +82,7 @@
"BLH1qVhJItRGCfxgTtONfsOKDc9VRAraXw-3NsmjMngWSh7NxOizN6bkuRA7iLTMPS82PjwJAr3UoK9EC1IFrz4",
private_key: "_-XZ0iebPrRfZ_o0-IatTdszYa8VCH1yLN-JauK7HHA"
config :pleroma, Oban,
queues: false,
crontab: false,
plugins: false
config :pleroma, Oban, testing: :manual
config :pleroma, Pleroma.ScheduledActivity,
daily_user_limit: 2,
@ -129,10 +127,16 @@
config :pleroma, :cachex, provider: Pleroma.CachexMock
config :pleroma, Pleroma.Web.WebFinger, update_nickname_on_user_fetch: false
config :pleroma, :side_effects,
ap_streamer: Pleroma.Web.ActivityPub.ActivityPubMock,
logger: Pleroma.LoggerMock
# Reduce recompilation time
# https://dashbit.co/blog/speeding-up-re-compilation-of-elixir-projects
config :phoenix, :plug_init_mode, :runtime
if File.exists?("./config/test.secret.exs") do
import_config "test.secret.exs"
else

View File

@ -3,7 +3,7 @@
set -e
echo "-- Waiting for database..."
while ! pg_isready -U ${DB_USER:-pleroma} -d postgres://${DB_HOST:-db}:5432/${DB_NAME:-pleroma} -t 1; do
while ! pg_isready -U ${DB_USER:-pleroma} -d postgres://${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-pleroma} -t 1; do
sleep 1s
done

View File

@ -32,16 +32,20 @@
config :pleroma, configurable_from_database: false
```
To delete transferred settings from database optional flag `-d` can be used. `<env>` is `prod` by default.
Options:
- `<path>` - where to save migrated config. E.g. `--path=/tmp`. If file saved into non standart folder, you must manually copy file into directory where Pleroma can read it. For OTP install path will be `PLEROMA_CONFIG_PATH` or `/etc/pleroma`. For installation from source - `config` directory in the pleroma folder.
- `<env>` - environment, for which is migrated config. By default is `prod`.
- To delete transferred settings from database optional flag `-d` can be used
=== "OTP"
```sh
./bin/pleroma_ctl config migrate_from_db [--env=<env>] [-d]
./bin/pleroma_ctl config migrate_from_db [--env=<env>] [-d] [--path=<path>]
```
=== "From Source"
```sh
mix pleroma.config migrate_from_db [--env=<env>] [-d]
mix pleroma.config migrate_from_db [--env=<env>] [-d] [--path=<path>]
```
## Dump all of the config settings defined in the database

View File

@ -22,7 +22,7 @@ Currently, known `<frontend>` values are:
- [kenoma](http://git.pleroma.social/lambadalambda/kenoma)
- [pleroma-fe](http://git.pleroma.social/pleroma/pleroma-fe)
- [fedi-fe](https://git.pleroma.social/pleroma/fedi-fe)
- [soapbox-fe](https://gitlab.com/soapbox-pub/soapbox-fe)
- [soapbox](https://gitlab.com/soapbox-pub/soapbox)
You can still install frontends that are not configured, see below.

View File

@ -37,7 +37,8 @@ If any of the options are left unspecified, you will be prompted interactively.
- `--static-dir <path>` - the directory custom public files should be read from (custom emojis, frontend bundle overrides, robots.txt, etc.)
- `--listen-ip <ip>` - the ip the app should listen to, defaults to 127.0.0.1
- `--listen-port <port>` - the port the app should listen to, defaults to 4000
- `--strip-uploads <Y|N>` - use ExifTool to strip uploads of sensitive location data
- `--strip-uploads-location <Y|N>` - use ExifTool to strip uploads of sensitive location data
- `--read-uploads-description <Y|N>` - use ExifTool to read image descriptions from uploads
- `--anonymize-uploads <Y|N>` - randomize uploaded filenames
- `--dedupe-uploads <Y|N>` - store files based on their hash to reduce data storage requirements if duplicates are uploaded with different filenames
- `--skip-release-env` - skip generation the release environment file

View File

@ -17,11 +17,11 @@ su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate"
## For from source installations (using git)
1. Go to the working directory of Pleroma (default is `/opt/pleroma`)
2. Run `git pull`. This pulls the latest changes from upstream.
2. Run `git checkout <tagged release>` [^1]. e.g. `git checkout v2.4.5` This pulls the [tagged release](https://git.pleroma.social/pleroma/pleroma/-/releases) from upstream.
3. Run `mix deps.get` [^1]. This pulls in any new dependencies.
4. Stop the Pleroma service.
5. Run `mix ecto.migrate` [^1] [^2]. This task performs database migrations, if there were any.
6. Start the Pleroma service.
[^1]: Depending on which install guide you followed (for example on Debian/Ubuntu), you want to run `mix` tasks as `pleroma` user by adding `sudo -Hu pleroma` before the command.
[^1]: Depending on which install guide you followed (for example on Debian/Ubuntu), you want to run `git` and `mix` tasks as `pleroma` user by adding `sudo -Hu pleroma` before the command.
[^2]: Prefix with `MIX_ENV=prod` to run it using the production config file.

View File

@ -116,3 +116,9 @@ Feel free to contact us to be added to this list!
- Contact: [@r@freesoftwareextremist.com](https://freesoftwareextremist.com/users/r)
- Features: Does not requires JavaScript
- Features: MastoAPI
### Glitch-lily
- Source Code: <https://lily.kazv.moe/infra/glitch-lily>
- Contact: [@tusooa@kazv.moe](https://kazv.moe/users/tusooa)
- Features: MastoAPI
- Based on [glitch-soc](https://github.com/glitch-soc/mastodon) frontend

View File

@ -8,18 +8,19 @@ For from source installations Pleroma configuration works by first importing the
To add configuration to your config file, you can copy it from the base config. The latest version of it can be viewed [here](https://git.pleroma.social/pleroma/pleroma/blob/develop/config/config.exs). You can also use this file if you don't know how an option is supposed to be formatted.
## :chat
## :shout
* `enabled` - Enables the backend chat. Defaults to `true`.
* `enabled` - Enables the backend Shoutbox chat feature. Defaults to `true`.
* `limit` - Shout character limit. Defaults to `5_000`
## :instance
* `name`: The instances name.
* `email`: Email used to reach an Administrator/Moderator of the instance.
* `notify_email`: Email used for notifications.
* `description`: The instances description, can be seen in nodeinfo and ``/api/v1/instance``.
* `short_description`: Shorter version of instance description, can be seen on ``/api/v1/instance``.
* `limit`: Posts character limit (CW/Subject included in the counter).
* `description_limit`: The character limit for image descriptions.
* `chat_limit`: Character limit of the instance chat messages.
* `remote_limit`: Hard character limit beyond which remote posts will be dropped.
* `upload_limit`: File size limit of uploads (except for avatar, background, banner).
* `avatar_upload_limit`: File size limit of users profile avatars.
@ -37,9 +38,9 @@ To add configuration to your config file, you can copy it from the base config.
* `federating`: Enable federation with other instances.
* `federation_incoming_replies_max_depth`: Max. depth of reply-to activities fetching on incoming federation, to prevent out-of-memory situations while fetching very long threads. If set to `nil`, threads of any depth will be fetched. Lower this value if you experience out-of-memory crashes.
* `federation_reachability_timeout_days`: Timeout (in days) of each external federation target being unreachable prior to pausing federating to it.
* `allow_relay`: Enable Pleromas Relay, which makes it possible to follow a whole instance.
* `allow_relay`: Permits remote instances to subscribe to all public posts of your instance. This may increase the visibility of your instance.
* `public`: Makes the client API in authenticated mode-only except for user-profiles. Useful for disabling the Local Timeline and The Whole Known Network. Note that there is a dependent setting restricting or allowing unauthenticated access to specific resources, see `restrict_unauthenticated` for more details.
* `quarantined_instances`: List of ActivityPub instances where private (DMs, followers-only) activities will not be send.
* `quarantined_instances`: ActivityPub instances where private (DMs, followers-only) activities will not be send.
* `allowed_post_formats`: MIME-type list of formats allowed to be posted (transformed into HTML).
* `extended_nickname_format`: Set to `true` to use extended local nicknames format (allows underscores/dashes). This will break federation with
older software for theses nicknames.
@ -48,6 +49,7 @@ To add configuration to your config file, you can copy it from the base config.
* `autofollowing_nicknames`: Set to nicknames of (local) users that automatically follows every newly registered user.
* `attachment_links`: Set to true to enable automatically adding attachment link text to statuses.
* `max_report_comment_size`: The maximum size of the report comment (Default: `1000`).
* `report_strip_status`: Strip associated statuses in reports to ids when closed/resolved, otherwise keep a copy.
* `safe_dm_mentions`: If set to true, only mentions at the beginning of a post will be used to address people in direct messages. This is to prevent accidental mentioning of people when talking about them (e.g. "@friend hey i really don't like @enemy"). Default: `false`.
* `healthcheck`: If set to true, system data will be shown on ``/api/v1/pleroma/healthcheck``.
* `remote_post_retention_days`: The default amount of days to retain remote posts when pruning the database.
@ -64,6 +66,43 @@ To add configuration to your config file, you can copy it from the base config.
* `cleanup_attachments`: Remove attachments along with statuses. Does not affect duplicate files and attachments without status. Enabling this will increase load to database when deleting statuses on larger instances.
* `show_reactions`: Let favourites and emoji reactions be viewed through the API (default: `true`).
* `password_reset_token_validity`: The time after which reset tokens aren't accepted anymore, in seconds (default: one day).
* `admin_privileges`: A list of privileges an admin has (e.g. delete messages, manage reports...)
* Possible values are:
* `:users_read`
* Allows admins to fetch users through the admin API.
* `:users_manage_invites`
* Allows admins to manage invites. This includes sending, resending, revoking and approving invites.
* `:users_manage_activation_state`
* Allows admins to activate and deactivate accounts. This also allows them to see deactivated users through the Mastodon API.
* `:users_manage_tags`
* Allows admins to set and remove tags for users. This can be useful in combination with MRF policies, such as `Pleroma.Web.ActivityPub.MRF.TagPolicy`.
* `:users_manage_credentials`
* Allows admins to trigger a password reset and set new credentials for an user.
* `:users_delete`
* Allows admins to delete accounts. Note that deleting an account is actually deactivating it and removing all data like posts, profile information, etc.
* `:messages_read`
* Allows admins to read messages through the admin API, including non-public posts and chats.
* `:messages_delete`
* Allows admins to delete messages from other users.
* `:instances_delete,`
* Allows admins to remove a whole remote instance from your instance. This will delete all users and messages from that remote instance.
* `:reports_manage_reports`
* Allows admins to see and manage reports.
* `:moderation_log_read,`
* Allows admins to read the entries in the moderation log.
* `:emoji_manage_emoji`
* Allows admins to manage custom emoji on the instance.
* `:statistics_read,`
* Allows admins to see some simple statistics about the instance.
* `moderator_privileges`: A list of privileges a moderator has (e.g. delete messages, manage reports...)
* Possible values are the same as for `admin_privileges`
## :database
* `improved_hashtag_timeline`: Setting to force toggle / force disable improved hashtags timeline. `:enabled` forces hashtags to be fetched from `hashtags` table for hashtags timeline. `:disabled` forces object-embedded hashtags to be used (slower). Keep it `:auto` for automatic behaviour (it is auto-set to `:enabled` [unless overridden] when HashtagsTableMigrator completes).
## Background migrations
* `populate_hashtags_table/sleep_interval_ms`: Sleep interval between each chunk of processed records in order to decrease the load on the system (defaults to 0 and should be keep default on most instances).
* `populate_hashtags_table/fault_rate_allowance`: Max rate of failed objects to actually processed objects in order to enable the feature (any value from 0.0 which tolerates no errors to 1.0 which will enable the feature even if hashtags transfer failed for all records).
## Welcome
* `direct_message`: - welcome message sent as a direct message.
@ -117,6 +156,10 @@ To add configuration to your config file, you can copy it from the base config.
* `Pleroma.Web.ActivityPub.MRF.ObjectAgePolicy`: Rejects or delists posts based on their age when received. (See [`:mrf_object_age`](#mrf_object_age)).
* `Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicy`: Sets a default expiration on all posts made by users of the local instance. Requires `Pleroma.Workers.PurgeExpiredActivity` to be enabled for processing the scheduled delections.
* `Pleroma.Web.ActivityPub.MRF.ForceBotUnlistedPolicy`: Makes all bot posts to disappear from public timelines.
* `Pleroma.Web.ActivityPub.MRF.FollowBotPolicy`: Automatically follows newly discovered users from the specified bot account. Local accounts, locked accounts, and users with "#nobot" in their bio are respected and excluded from being followed.
* `Pleroma.Web.ActivityPub.MRF.AntiFollowbotPolicy`: Drops follow requests from followbots. Users can still allow bots to follow them by first following the bot.
* `Pleroma.Web.ActivityPub.MRF.KeywordPolicy`: Rejects or removes from the federated timeline or replaces keywords. (See [`:mrf_keyword`](#mrf_keyword)).
* `Pleroma.Web.ActivityPub.MRF.ForceMentionsInContent`: Forces every mentioned user to be reflected in the post content.
* `transparency`: Make the content of your Message Rewrite Facility settings public (via nodeinfo).
* `transparency_exclusions`: Exclude specific instance names from MRF transparency. The use of the exclusions feature will be disclosed in nodeinfo as a boolean value.
@ -127,15 +170,16 @@ To add configuration to your config file, you can copy it from the base config.
Configuring MRF policies is not enough for them to take effect. You have to enable them by specifying their module in `policies` under [:mrf](#mrf) section.
#### :mrf_simple
* `media_removal`: List of instances to remove media from.
* `media_nsfw`: List of instances to put media as NSFW(sensitive) from.
* `federated_timeline_removal`: List of instances to remove from Federated (aka The Whole Known Network) Timeline.
* `reject`: List of instances to reject any activities from.
* `accept`: List of instances to accept any activities from.
* `followers_only`: List of instances to decrease post visibility to only the followers, including for DM mentions.
* `report_removal`: List of instances to reject reports from.
* `avatar_removal`: List of instances to strip avatars from.
* `banner_removal`: List of instances to strip banners from.
* `media_removal`: List of instances to strip media attachments from and the reason for doing so.
* `media_nsfw`: List of instances to tag all media as NSFW (sensitive) from and the reason for doing so.
* `federated_timeline_removal`: List of instances to remove from the Federated Timeline (aka The Whole Known Network) and the reason for doing so.
* `reject`: List of instances to reject activities (except deletes) from and the reason for doing so.
* `accept`: List of instances to only accept activities (except deletes) from and the reason for doing so.
* `followers_only`: Force posts from the given instances to be visible by followers only and the reason for doing so.
* `report_removal`: List of instances to reject reports from and the reason for doing so.
* `avatar_removal`: List of instances to strip avatars from and the reason for doing so.
* `banner_removal`: List of instances to strip banners from and the reason for doing so.
* `reject_deletes`: List of instances to reject deletions from and the reason for doing so.
#### :mrf_subchain
This policy processes messages through an alternate pipeline when a given message matches certain criteria.
@ -191,7 +235,7 @@ config :pleroma, :mrf_user_allowlist, %{
e.g., A value of 900 results in any post with a timestamp older than 15 minutes will be acted upon.
* `actions`: A list of actions to apply to the post:
* `:delist` removes the post from public timelines
* `:strip_followers` removes followers from the ActivityPub recipient list, ensuring they won't be delivered to home timelines
* `:strip_followers` removes followers from the ActivityPub recipient list, ensuring they won't be delivered to home timelines, additionally for followers-only it degrades to a direct message
* `:reject` rejects the message entirely
#### :mrf_steal_emoji
@ -203,9 +247,25 @@ config :pleroma, :mrf_user_allowlist, %{
* `days`: Default global expiration time for all local Create activities (in days)
#### :mrf_hashtag
* `sensitive`: List of hashtags to mark activities as sensitive (default: `nsfw`)
* `federated_timeline_removal`: List of hashtags to remove activities from the federated timeline (aka TWNK)
* `reject`: List of hashtags to reject activities from
Notes:
- The hashtags in the configuration do not have a leading `#`.
- This MRF Policy is always enabled, if you want to disable it you have to set empty lists
#### :mrf_follow_bot
* `follower_nickname`: The name of the bot account to use for following newly discovered users. Using `followbot` or similar is strongly suggested.
### :activitypub
* `unfollow_blocked`: Whether blocks result in people getting unfollowed
* `outgoing_blocks`: Whether to federate blocks to other instances
* `blockers_visible`: Whether a user can see the posts of users who blocked them
* `deny_follow_blocked`: Whether to disallow following an account that has blocked the user in question
* `sign_object_fetches`: Sign object fetches with HTTP signatures
* `authorized_fetch_mode`: Require HTTP signatures for AP fetches
@ -223,7 +283,7 @@ config :pleroma, :mrf_user_allowlist, %{
### :frontend_configurations
This can be used to configure a keyword list that keeps the configuration data for any kind of frontend. By default, settings for `pleroma_fe` and `masto_fe` are configured. You can find the documentation for `pleroma_fe` configuration into [Pleroma-FE configuration and customization for instance administrators](/frontend/CONFIGURATION/#options).
This can be used to configure a keyword list that keeps the configuration data for any kind of frontend. By default, settings for `pleroma_fe` are configured. You can find the documentation for `pleroma_fe` configuration into [Pleroma-FE configuration and customization for instance administrators](/frontend/CONFIGURATION/#options).
Frontends can access these settings at `/api/v1/pleroma/frontend_configurations`
@ -234,10 +294,7 @@ config :pleroma, :frontend_configurations,
pleroma_fe: %{
theme: "pleroma-dark",
# ... see /priv/static/static/config.json for the available keys.
},
masto_fe: %{
showInstanceSpecificPanel: true
}
}
```
These settings **need to be complete**, they will override the defaults.
@ -602,12 +659,18 @@ This filter replaces the filename (not the path) of an upload. For complete obfu
No specific configuration.
#### Pleroma.Upload.Filter.Exiftool
#### Pleroma.Upload.Filter.Exiftool.StripLocation
This filter only strips the GPS and location metadata with Exiftool leaving color profiles and attributes intact.
No specific configuration.
#### Pleroma.Upload.Filter.Exiftool.ReadDescription
This filter reads the ImageDescription and iptc:Caption-Abstract fields with Exiftool so clients can prefill the media description field.
No specific configuration.
#### Pleroma.Upload.Filter.Mogrify
* `args`: List of actions for the `mogrify` command like `"strip"` or `["strip", "auto-orient", {"implode", "1"}]`.
@ -745,7 +808,7 @@ Web Push Notifications configuration. You can use the mix task `mix web_push.gen
* ``private_key``: VAPID private key
## :logger
* `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog, and `Quack.Logger` to log to Slack
* `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog
An example to enable ONLY ExSyslogger (f/ex in ``prod.secret.exs``) with info and debug suppressed:
```elixir
@ -768,10 +831,10 @@ config :logger, :ex_syslogger,
See: [loggers documentation](https://hexdocs.pm/logger/Logger.html) and [ex_sysloggers documentation](https://hexdocs.pm/ex_syslogger/)
An example of logging info to local syslog, but warn to a Slack channel:
An example of logging info to local syslog, but debug to console:
```elixir
config :logger,
backends: [ {ExSyslogger, :ex_syslogger}, Quack.Logger ],
backends: [ {ExSyslogger, :ex_syslogger}, :console ],
level: :info
config :logger, :ex_syslogger,
@ -779,14 +842,12 @@ config :logger, :ex_syslogger,
ident: "pleroma",
format: "$metadata[$level] $message"
config :quack,
level: :warn,
meta: [:all],
webhook_url: "https://hooks.slack.com/services/YOUR-API-KEY-HERE"
config :logger, :console,
level: :debug,
format: "\n$time $metadata[$level] $message\n",
metadata: [:request_id]
```
See the [Quack Github](https://github.com/azohra/quack) for more details
## Database options

View File

@ -0,0 +1,62 @@
# How to use a different domain name for Pleroma and the users it serves
Pleroma users are primarily identified by a `user@example.org` handle, and you might want this identifier to be the same as your email or jabber account, for instance.
However, in this case, you are almost certainly serving some web content on `https://example.org` already, and you might want to use another domain (say `pleroma.example.org`) for Pleroma itself.
Pleroma supports that, but it might be tricky to set up, and any error might prevent you from federating with other instances.
*If you are already running Pleroma on `example.org`, it is no longer possible to move it to `pleroma.example.org`.*
## Account identifiers
It is important to understand that for federation purposes, a user in Pleroma has two unique identifiers associated:
- A webfinger `acct:` URI, used for discovery and as a verifiable global name for the user across Pleroma instances. In our example, our account's acct: URI is `acct:user@example.org`
- An author/actor URI, used in every other aspect of federation. This is the way in which users are identified in ActivityPub, the underlying protocol used for federation with other Pleroma instances.
In our case, it is `https://pleroma.example.org/users/user`.
Both account identifiers are unique and required for Pleroma. An important risk if you set up your Pleroma instance incorrectly is to create two users (with different acct: URIs) with conflicting author/actor URIs.
## WebFinger
As said earlier, each Pleroma user has an `acct`: URI, which is used for discovery and authentication. When you add @user@example.org, a webfinger query is performed. This is done in two steps:
1. Querying `https://example.org/.well-known/host-meta` (where the domain of the URL matches the domain part of the `acct`: URI) to get information on how to perform the query.
This file will indeed contain a URL template of the form `https://example.org/.well-known/webfinger?resource={uri}` that will be used in the second step.
2. Fill the returned template with the `acct`: URI to be queried and perform the query: `https://example.org/.well-known/webfinger?resource=acct:user@example.org`
## Configuring your Pleroma instance
**_DO NOT ATTEMPT TO CONFIGURE YOUR INSTANCE THIS WAY IF YOU DID NOT UNDERSTAND THE ABOVE_**
### Configuring Pleroma
Pleroma has a two configuration settings to enable using different domains for your users and Pleroma itself. `host` in `Pleroma.Web.Endpoint` and `domain` in `Pleroma.Web.WebFinger`. When the latter is not set, it defaults to the value of `host`.
*Be extra careful when configuring your Pleroma instance, as changing `host` may cause remote instances to register different accounts with the same author/actor URI, which will result in federation issues!*
```elixir
config :pleroma, Pleroma.Web.Endpoint,
url: [host: "pleroma.example.org"]
config :pleroma, Pleroma.Web.WebFinger, domain: "example.org"
```
- `domain` - is the domain for which your Pleroma instance has authority, it's the domain used in `acct:` URI. In our example, `domain` would be set to `example.org`. This is used in WebFinger account ids, which are the canonical account identifier in some other fediverse software like Mastodon. **If you change `domain`, the accounts on your server will be shown as different accounts in those software**.
- `host` - is the domain used for any URL generated for your instance, including the author/actor URL's. In our case, that would be `pleroma.example.org`. This is used in AP ids, which are the canonical account identifier in Pleroma and some other fediverse software. **You should not change this after you have set up the instance**.
### Configuring WebFinger domain
Now, you have Pleroma running at `https://pleroma.example.org` as well as a website at `https://example.org`. If you recall how webfinger queries work, the first step is to query `https://example.org/.well-known/host-meta`, which will contain an URL template.
Therefore, the easiest way to configure `example.org` is to redirect `/.well-known/host-meta` to `pleroma.example.org`.
With nginx, it would be as simple as adding:
```nginx
location = /.well-known/host-meta {
return 301 https://pleroma.example.org$request_uri;
}
```
in example.org's server block.

View File

@ -59,7 +59,7 @@ The configuration of Pleroma has traditionally been managed with a config file,
Here is an example of a server config stripped down after migration:
```
use Mix.Config
import Config
config :pleroma, Pleroma.Web.Endpoint,
url: [host: "cool.pleroma.site", scheme: "https", port: 443]

View File

@ -5,7 +5,7 @@ Pleroma's full text search feature is powered by PostgreSQL's native [text searc
## Setup and test the new search config
In most cases, you would need an extension installed to support parsing CJK text. Here are a few extension you may choose from, or you are more than welcome to share additional ones you found working for you with the rest of Pleroma community.
In most cases, you would need an extension installed to support parsing CJK text. Here are a few extensions you may choose from, or you are more than welcome to share additional ones you found working for you with the rest of Pleroma community.
* [a generic n-gram parser](https://github.com/huangjimmy/pg_cjk_parser) supports Simplifed/Traditional Chinese, Japanese, and Korean
* [a Korean parser](https://github.com/i0seph/textsearch_ko) based on mecab
@ -34,7 +34,7 @@ Check output of the query, and see if it matches your expectation.
mix pleroma.database set_text_search_config YOUR.CONFIG
```
Note: index update may take a while.
Note: index update may take a while, and it can be done while the instance is up and running, so you may restart db connection as soon as you see `Recreate index` in task output.
## Restart database connection
Since some changes above will only apply with a new database connection, you will have to restart either Pleroma or PostgreSQL process, or use `pg_terminate_backend` SQL command without restarting either.

View File

@ -55,18 +55,18 @@ Servers should be configured as lists.
### Example
This example will enable `SimplePolicy`, block media from `illegalporn.biz`, mark media as NSFW from `porn.biz` and `porn.business`, reject messages from `spam.com`, remove messages from `spam.university` from the federated timeline and block reports (flags) from `whiny.whiner`:
This example will enable `SimplePolicy`, block media from `illegalporn.biz`, mark media as NSFW from `porn.biz` and `porn.business`, reject messages from `spam.com`, remove messages from `spam.university` from the federated timeline and block reports (flags) from `whiny.whiner`. We also give a reason why the moderation was done:
```elixir
config :pleroma, :mrf,
policies: [Pleroma.Web.ActivityPub.MRF.SimplePolicy]
config :pleroma, :mrf_simple,
media_removal: ["illegalporn.biz"],
media_nsfw: ["porn.biz", "porn.business"],
reject: ["spam.com"],
federated_timeline_removal: ["spam.university"],
report_removal: ["whiny.whiner"]
media_removal: [{"illegalporn.biz", "Media can contain illegal contant"}],
media_nsfw: [{"porn.biz", "unmarked nsfw media"}, {"porn.business", "A lot of unmarked nsfw media"}],
reject: [{"spam.com", "They keep spamming our users"}],
federated_timeline_removal: [{"spam.university", "Annoying low-quality posts who otherwise fill up TWKN"}],
report_removal: [{"whiny.whiner", "Keep spamming us with irrelevant reports"}]
```
### Use with Care
@ -82,7 +82,7 @@ For example, here is a sample policy module which rewrites all messages to "new
```elixir
defmodule Pleroma.Web.ActivityPub.MRF.RewritePolicy do
@moduledoc "MRF policy which rewrites all Notes to have 'new message content'."
@behaviour Pleroma.Web.ActivityPub.MRF
@behaviour Pleroma.Web.ActivityPub.MRF.Policy
# Catch messages which contain Note objects with actual data to filter.
# Capture the object as `object`, the message content as `content` and the

View File

@ -261,6 +261,46 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
}
```
## `PATCH /api/v1/pleroma/admin/users/suggest`
### Suggest a user
Adds the user(s) to follower recommendations.
- Params:
- `nicknames`: nicknames array
- Response:
```json
{
users: [
{
// user object
}
]
}
```
## `PATCH /api/v1/pleroma/admin/users/unsuggest`
### Unsuggest a user
Removes the user(s) from follower recommendations.
- Params:
- `nicknames`: nicknames array
- Response:
```json
{
users: [
{
// user object
}
]
}
```
## `GET /api/v1/pleroma/admin/users/:nickname_or_id`
### Retrive the details of a user
@ -319,6 +359,22 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
}
```
## `DELETE /api/v1/pleroma/admin/instances/:instance`
### Delete all users and activities from a remote instance
Note: this will trigger a job to remove instance content in the background.
It may take some time.
- Params:
- `instance`: remote instance host
- Response:
- The `instance` name as a string
```json
"lain.com"
```
## `GET /api/v1/pleroma/admin/statuses`
### Retrives all latest statuses
@ -1008,7 +1064,6 @@ List of settings which support only full update by key:
```elixir
@full_key_update [
{:pleroma, :ecto_repos},
{:quack, :meta},
{:mime, :types},
{:cors_plug, [:max_age, :methods, :expose, :headers]},
{:auto_linker, :opts},
@ -1028,18 +1083,18 @@ List of settings which support only full update by subkey:
]
```
*Settings without explicit key must be sended in separate config object params.*
*Settings without explicit key must be sent in separate config object params.*
```elixir
config :quack,
level: :debug,
meta: [:all],
config :foo,
bar: :baz,
meta: [:data],
...
```
```json
{
"configs": [
{"group": ":quack", "key": ":level", "value": ":debug"},
{"group": ":quack", "key": ":meta", "value": [":all"]},
{"group": ":foo", "key": ":bar", "value": ":baz"},
{"group": ":foo", "key": ":meta", "value": [":data"]},
...
]
}
@ -1580,3 +1635,117 @@ Returns the content of the document
"error": "Could not install frontend"
}
```
## `GET /api/v1/pleroma/admin/announcements`
### List announcements
- Params: `offset`, `limit`
- Response: JSON, list of announcements
```json
[
{
"id": "AHDp0GBdRn1EPN5HN2",
"content": "some content",
"starts_at": null,
"ends_at": null,
"all_day": false,
"published_at": "2022-03-09T02:13:05",
"reactions": [],
"statuses": [],
"tags": [],
"emojis": [],
"updated_at": "2022-03-09T02:13:05"
}
]
```
Note that this differs from the Mastodon API variant: Mastodon API only returns *active* announcements, while this returns all.
## `GET /api/v1/pleroma/admin/announcements/:id`
### Display one announcement
- Response: JSON, one announcement
```json
{
"id": "AHDp0GBdRn1EPN5HN2",
"content": "some content",
"starts_at": null,
"ends_at": null,
"all_day": false,
"published_at": "2022-03-09T02:13:05",
"reactions": [],
"statuses": [],
"tags": [],
"emojis": [],
"updated_at": "2022-03-09T02:13:05"
}
```
## `POST /api/v1/pleroma/admin/announcements`
### Create an announcement
- Params:
- `content`: string, required, announcement content
- `starts_at`: datetime, optional, default to null, the time when the announcement will become active (displayed to users); if it is null, the announcement will be active immediately
- `ends_at`: datetime, optional, default to null, the time when the announcement will become inactive (no longer displayed to users); if it is null, the announcement will be active until an admin deletes it
- `all_day`: boolean, optional, default to false, tells the client whether to only display dates for `starts_at` and `ends_at`
- Response: JSON, created announcement
```json
{
"id": "AHDp0GBdRn1EPN5HN2",
"content": "some content",
"starts_at": null,
"ends_at": null,
"all_day": false,
"published_at": "2022-03-09T02:13:05",
"reactions": [],
"statuses": [],
"tags": [],
"emojis": [],
"updated_at": "2022-03-09T02:13:05"
}
```
## `PATCH /api/v1/pleroma/admin/announcements/:id`
### Change an announcement
- Params: same as `POST /api/v1/pleroma/admin/announcements`, except no param is required.
- Updates the announcement according to params. Missing params are kept as-is.
- Response: JSON, updated announcement
```json
{
"id": "AHDp0GBdRn1EPN5HN2",
"content": "some content",
"starts_at": null,
"ends_at": null,
"all_day": false,
"published_at": "2022-03-09T02:13:05",
"reactions": [],
"statuses": [],
"tags": [],
"emojis": [],
"updated_at": "2022-03-09T02:13:05"
}
```
## `DELETE /api/v1/pleroma/admin/announcements/:id`
### Delete an announcement
- Response: JSON, empty object
```json
{}
```

View File

@ -38,6 +38,11 @@ Has these additional fields under the `pleroma` object:
- `thread_muted`: true if the thread the post belongs to is muted
- `emoji_reactions`: A list with emoji / reaction maps. The format is `{name: "☕", count: 1, me: true}`. Contains no information about the reacting users, for that use the `/statuses/:id/reactions` endpoint.
- `parent_visible`: If the parent of this post is visible to the user or not.
- `pinned_at`: a datetime (iso8601) when status was pinned, `null` otherwise.
The `GET /api/v1/statuses/:id/source` endpoint additionally has the following attributes:
- `content_type`: The content type of the status source.
## Scheduled statuses
@ -240,6 +245,7 @@ Additional parameters can be added to the JSON body/Form data:
- `discoverable` - if true, external services (search bots) etc. are allowed to index / list the account (regardless of this setting, user will still appear in regular search results).
- `actor_type` - the type of this account.
- `accepts_chat_messages` - if false, this account will reject all chat messages.
- `language` - user's preferred language for receiving emails (digest, confirmation, etc.)
All images (avatar, banner and background) can be reset to the default by sending an empty string ("") instead of a file.
@ -255,9 +261,29 @@ This information is returned in the `/api/v1/accounts/verify_credentials` endpoi
*Pleroma supports refreshing tokens.*
`POST /oauth/token`
### POST `/oauth/token`
Post here request with `grant_type=refresh_token` to obtain new access token. Returns an access token.
You can obtain access tokens for a user in a few additional ways.
#### Refreshing a token
To obtain a new access token from a refresh token, pass `grant_type=refresh_token` with the following extra parameters:
- `refresh_token`: The refresh token.
#### Getting a token with a password
To obtain a token from a user's password, pass `grant_type=password` with the following extra parameters:
- `username`: Username to authenticate.
- `password`: The user's password.
#### Response body
Additional fields are returned in the response:
- `id`: The primary key of this token in Pleroma's database.
- `me` (user tokens only): The ActivityPub ID of the user who owns the token.
## Account Registration
@ -271,6 +297,7 @@ Has these additional parameters (which are the same as in Pleroma-API):
- `captcha_token`: optional, contains provider-specific captcha token
- `captcha_answer_data`: optional, contains provider-specific captcha data
- `token`: invite token required when the registrations aren't public.
- `language`: optional, user's preferred language for receiving emails (digest, confirmation, etc.), default to the language set in the `userLanguage` cookies or `Accept-Language` header.
## Instance
@ -356,18 +383,6 @@ Pleroma is generally compatible with the Mastodon 2.7.2 API, but some newer feat
- `GET /api/v1/identity_proofs`: Returns an empty array, `[]`
### Endorsements
*Added in Mastodon 2.5.0*
- `GET /api/v1/endorsements`: Returns an empty array, `[]`
### Profile directory
*Added in Mastodon 3.0.0*
- `GET /api/v1/directory`: Returns HTTP 404
### Featured tags
*Added in Mastodon 3.0.0*

View File

@ -0,0 +1,347 @@
# Nodeinfo
See also [the Nodeinfo standard](https://nodeinfo.diaspora.software/).
## `/.well-known/nodeinfo`
### The well-known path
* Method: `GET`
* Authentication: not required
* Params: none
* Response: JSON
* Example response:
```json
{
"links":[
{
"href":"https://example.com/nodeinfo/2.0.json",
"rel":"http://nodeinfo.diaspora.software/ns/schema/2.0"
},
{
"href":"https://example.com/nodeinfo/2.1.json",
"rel":"http://nodeinfo.diaspora.software/ns/schema/2.1"
}
]
}
```
## `/nodeinfo/2.0.json`
### Nodeinfo 2.0
* Method: `GET`
* Authentication: not required
* Params: none
* Response: JSON
* Example response:
```json
{
"metadata":{
"accountActivationRequired":false,
"features":[
"pleroma_api",
"mastodon_api",
"mastodon_api_streaming",
"polls",
"pleroma_explicit_addressing",
"shareable_emoji_packs",
"multifetch",
"pleroma:api/v1/notifications:include_types_filter",
"chat",
"shout",
"relay",
"pleroma_emoji_reactions",
"pleroma_chat_messages"
],
"federation":{
"enabled":true,
"exclusions":false,
"mrf_hashtag":{
"federated_timeline_removal":[
],
"reject":[
],
"sensitive":[
"nsfw"
]
},
"mrf_object_age":{
"actions":[
"delist",
"strip_followers"
],
"threshold":604800
},
"mrf_policies":[
"ObjectAgePolicy",
"TagPolicy",
"HashtagPolicy"
],
"quarantined_instances":[
]
},
"fieldsLimits":{
"maxFields":10,
"maxRemoteFields":20,
"nameLength":512,
"valueLength":2048
},
"invitesEnabled":false,
"mailerEnabled":false,
"nodeDescription":"Pleroma: An efficient and flexible fediverse server",
"nodeName":"Example",
"pollLimits":{
"max_expiration":31536000,
"max_option_chars":200,
"max_options":20,
"min_expiration":0
},
"postFormats":[
"text/plain",
"text/html",
"text/markdown",
"text/bbcode"
],
"private":false,
"restrictedNicknames":[
".well-known",
"~",
"about",
"activities",
"api",
"auth",
"check_password",
"dev",
"friend-requests",
"inbox",
"internal",
"main",
"media",
"nodeinfo",
"notice",
"oauth",
"objects",
"ostatus_subscribe",
"pleroma",
"proxy",
"push",
"registration",
"relay",
"settings",
"status",
"tag",
"user-search",
"user_exists",
"users",
"web",
"verify_credentials",
"update_credentials",
"relationships",
"search",
"confirmation_resend",
"mfa"
],
"skipThreadContainment":true,
"staffAccounts":[
"https://example.com/users/admin",
"https://example.com/users/staff"
],
"suggestions":{
"enabled":false
},
"uploadLimits":{
"avatar":2000000,
"background":4000000,
"banner":4000000,
"general":16000000
}
},
"openRegistrations":true,
"protocols":[
"activitypub"
],
"services":{
"inbound":[
],
"outbound":[
]
},
"software":{
"name":"pleroma",
"version":"2.4.1"
},
"usage":{
"localPosts":27,
"users":{
"activeHalfyear":129,
"activeMonth":70,
"total":235
}
},
"version":"2.0"
}
```
## `/nodeinfo/2.1.json`
### Nodeinfo 2.1
* Method: `GET`
* Authentication: not required
* Params: none
* Response: JSON
* Example response:
```json
{
"metadata":{
"accountActivationRequired":false,
"features":[
"pleroma_api",
"mastodon_api",
"mastodon_api_streaming",
"polls",
"pleroma_explicit_addressing",
"shareable_emoji_packs",
"multifetch",
"pleroma:api/v1/notifications:include_types_filter",
"chat",
"shout",
"relay",
"pleroma_emoji_reactions",
"pleroma_chat_messages"
],
"federation":{
"enabled":true,
"exclusions":false,
"mrf_hashtag":{
"federated_timeline_removal":[
],
"reject":[
],
"sensitive":[
"nsfw"
]
},
"mrf_object_age":{
"actions":[
"delist",
"strip_followers"
],
"threshold":604800
},
"mrf_policies":[
"ObjectAgePolicy",
"TagPolicy",
"HashtagPolicy"
],
"quarantined_instances":[
]
},
"fieldsLimits":{
"maxFields":10,
"maxRemoteFields":20,
"nameLength":512,
"valueLength":2048
},
"invitesEnabled":false,
"mailerEnabled":false,
"nodeDescription":"Pleroma: An efficient and flexible fediverse server",
"nodeName":"Example",
"pollLimits":{
"max_expiration":31536000,
"max_option_chars":200,
"max_options":20,
"min_expiration":0
},
"postFormats":[
"text/plain",
"text/html",
"text/markdown",
"text/bbcode"
],
"private":false,
"restrictedNicknames":[
".well-known",
"~",
"about",
"activities",
"api",
"auth",
"check_password",
"dev",
"friend-requests",
"inbox",
"internal",
"main",
"media",
"nodeinfo",
"notice",
"oauth",
"objects",
"ostatus_subscribe",
"pleroma",
"proxy",
"push",
"registration",
"relay",
"settings",
"status",
"tag",
"user-search",
"user_exists",
"users",
"web",
"verify_credentials",
"update_credentials",
"relationships",
"search",
"confirmation_resend",
"mfa"
],
"skipThreadContainment":true,
"staffAccounts":[
"https://example.com/users/admin",
"https://example.com/users/staff"
],
"suggestions":{
"enabled":false
},
"uploadLimits":{
"avatar":2000000,
"background":4000000,
"banner":4000000,
"general":16000000
}
},
"openRegistrations":true,
"protocols":[
"activitypub"
],
"services":{
"inbound":[
],
"outbound":[
]
},
"software":{
"name":"pleroma",
"repository":"https://git.pleroma.social/pleroma/pleroma",
"version":"2.4.1"
},
"usage":{
"localPosts":27,
"users":{
"activeHalfyear":129,
"activeMonth":70,
"total":235
}
},
"version":"2.1"
}
```

View File

@ -37,7 +37,7 @@ The `/api/v1/pleroma/*` path is backwards compatible with `/api/pleroma/*` (`/ap
```
* Note: Same data as Mastodon APIs `/api/v1/custom_emojis` but in a different format
## `/api/v1/pleroma/follow_import`
## `/api/pleroma/follow_import`
### Imports your follows, for example from a Mastodon CSV file.
* Method: `POST`
* Authentication: required
@ -46,7 +46,7 @@ The `/api/v1/pleroma/*` path is backwards compatible with `/api/pleroma/*` (`/ap
* Response: HTTP 200 on success, 500 on error
* Note: Users that can't be followed are silently skipped.
## `/api/v1/pleroma/blocks_import`
## `/api/pleroma/blocks_import`
### Imports your blocks.
* Method: `POST`
* Authentication: required
@ -54,7 +54,7 @@ The `/api/v1/pleroma/*` path is backwards compatible with `/api/pleroma/*` (`/ap
* `list`: STRING or FILE containing a whitespace-separated list of accounts to block
* Response: HTTP 200 on success, 500 on error
## `/api/v1/pleroma/mutes_import`
## `/api/pleroma/mutes_import`
### Imports your mutes.
* Method: `POST`
* Authentication: required
@ -70,7 +70,7 @@ The `/api/v1/pleroma/*` path is backwards compatible with `/api/pleroma/*` (`/ap
* Response: Provider specific JSON, the only guaranteed parameter is `type`
* Example response: `{"type": "kocaptcha", "token": "whatever", "url": "https://captcha.kotobank.ch/endpoint", "seconds_valid": 300}`
## `/api/v1/pleroma/delete_account`
## `/api/pleroma/delete_account`
### Delete an account
* Method `POST`
* Authentication: required
@ -79,7 +79,7 @@ The `/api/v1/pleroma/*` path is backwards compatible with `/api/pleroma/*` (`/ap
* Response: JSON. Returns `{"status": "success"}` if the deletion was successful, `{"error": "[error message]"}` otherwise
* Example response: `{"error": "Invalid password."}`
## `/api/v1/pleroma/disable_account`
## `/api/pleroma/disable_account`
### Disable an account
* Method `POST`
* Authentication: required
@ -88,21 +88,22 @@ The `/api/v1/pleroma/*` path is backwards compatible with `/api/pleroma/*` (`/ap
* Response: JSON. Returns `{"status": "success"}` if the account was successfully disabled, `{"error": "[error message]"}` otherwise
* Example response: `{"error": "Invalid password."}`
## `/api/v1/pleroma/accounts/mfa`
## `/api/pleroma/accounts/mfa`
#### Gets current MFA settings
* method: `GET`
* Authentication: required
* OAuth scope: `read:security`
* Response: JSON. Returns `{"enabled": "false", "totp": false }`
* Response: JSON. Returns `{"settings": {"enabled": "false", "totp": false }}`
* Note: `enabled` is whether multi-factor auth is enabled for the user in general, while `totp` is one type of MFA.
## `/api/v1/pleroma/accounts/mfa/setup/totp`
## `/api/pleroma/accounts/mfa/setup/totp`
#### Pre-setup the MFA/TOTP method
* method: `GET`
* Authentication: required
* OAuth scope: `write:security`
* Response: JSON. Returns `{"key": [secret_key], "provisioning_uri": "[qr code uri]" }` when successful, otherwise returns HTTP 422 `{"error": "error_msg"}`
## `/api/v1/pleroma/accounts/mfa/confirm/totp`
## `/api/pleroma/accounts/mfa/confirm/totp`
#### Confirms & enables MFA/TOTP support for user account.
* method: `POST`
* Authentication: required
@ -113,7 +114,7 @@ The `/api/v1/pleroma/*` path is backwards compatible with `/api/pleroma/*` (`/ap
* Response: JSON. Returns `{}` if the enable was successful, HTTP 422 `{"error": "[error message]"}` otherwise
## `/api/v1/pleroma/accounts/mfa/totp`
## `/api/pleroma/accounts/mfa/totp`
#### Disables MFA/TOTP method for user account.
* method: `DELETE`
* Authentication: required
@ -123,7 +124,7 @@ The `/api/v1/pleroma/*` path is backwards compatible with `/api/pleroma/*` (`/ap
* Response: JSON. Returns `{}` if the disable was successful, HTTP 422 `{"error": "[error message]"}` otherwise
* Example response: `{"error": "Invalid password."}`
## `/api/v1/pleroma/accounts/mfa/backup_codes`
## `/api/pleroma/accounts/mfa/backup_codes`
#### Generstes backup codes MFA for user account.
* method: `GET`
* Authentication: required
@ -159,10 +160,12 @@ See [Admin-API](admin_api.md)
"muting": false,
"muting_notifications": false,
"subscribing": true,
"notifying": true,
"requested": false,
"domain_blocking": false,
"showing_reblogs": true,
"endorsed": false
"endorsed": false,
"note": ""
}
```
@ -183,10 +186,12 @@ See [Admin-API](admin_api.md)
"muting": false,
"muting_notifications": false,
"subscribing": false,
"notifying": false,
"requested": false,
"domain_blocking": false,
"showing_reblogs": true,
"endorsed": false
"endorsed": false,
"note": ""
}
```
@ -300,7 +305,7 @@ See [Admin-API](admin_api.md)
* Note: Behaves exactly the same as `POST /api/v1/upload`.
Can only accept images - any attempt to upload non-image files will be met with `HTTP 415 Unsupported Media Type`.
## `/api/v1/pleroma/notification_settings`
## `/api/pleroma/notification_settings`
### Updates user notification settings
* Method `PUT`
* Authentication: required
@ -327,7 +332,7 @@ See [Admin-API](admin_api.md)
}
```
## `/api/v1/pleroma/change_email`
## `/api/pleroma/change_email`
### Change account email
* Method `POST`
* Authentication: required
@ -337,6 +342,36 @@ See [Admin-API](admin_api.md)
* Response: JSON. Returns `{"status": "success"}` if the change was successful, `{"error": "[error message]"}` otherwise
* Note: Currently, Mastodon has no API for changing email. If they add it in future it might be incompatible with Pleroma.
## `/api/pleroma/move_account`
### Move account
* Method `POST`
* Authentication: required
* Params:
* `password`: user's password
* `target_account`: the nickname of the target account (e.g. `foo@example.org`)
* Response: JSON. Returns `{"status": "success"}` if the change was successful, `{"error": "[error message]"}` otherwise
* Note: This endpoint emits a `Move` activity to all followers of the current account. Some remote servers will automatically unfollow the current account and follow the target account upon seeing this, but this depends on the remote server implementation and cannot be guaranteed. For local followers , they will automatically unfollow and follow if and only if they have set the `allow_following_move` preference ("Allow auto-follow when following account moves").
## `/api/pleroma/aliases`
### Get aliases of the current account
* Method `GET`
* Authentication: required
* Response: JSON. Returns `{"aliases": [alias, ...]}`, where `alias` is the nickname of an alias, e.g. `foo@example.org`.
### Add alias to the current account
* Method `PUT`
* Authentication: required
* Params:
* `alias`: the nickname of the alias to add, e.g. `foo@example.org`.
* Response: JSON. Returns `{"status": "success"}` if the change was successful, `{"error": "[error message]"}` otherwise
### Delete alias from the current account
* Method `DELETE`
* Authentication: required
* Params:
* `alias`: the nickname of the alias to delete, e.g. `foo@example.org`.
* Response: JSON. Returns `{"status": "success"}` if the change was successful, `{"error": "[error message]"}` otherwise
# Pleroma Conversations
Pleroma Conversations have the same general structure that Mastodon Conversations have. The behavior differs in the following ways when using these endpoints:
@ -655,3 +690,77 @@ Emoji reactions work a lot like favourites do. They make it possible to react to
"url": "https://example.com/media/backups/archive-foobar-20200910T161803-QUhx6VYDRQ2wfV0SdA2Pfj_2CLM_ATUlw-D5l5TJf4Q.zip"
}]
```
## `GET /api/oauth_tokens`
### Retrieve a list of active sessions for the user
* Method: `GET`
* Authentication: required
* Params: none
* Response: JSON
* Example response:
```json
[
{
"app_name": "Pleroma FE",
"id": 9275,
"valid_until": "2121-11-24T15:51:08.234234"
},
{
"app_name": "Patron",
"id": 8805,
"valid_until": "2121-10-26T18:09:59.857150"
},
{
"app_name": "Soapbox FE",
"id": 9727,
"valid_until": "2121-12-25T16:52:39.692877"
}
]
```
## `DELETE /api/oauth_tokens/:id`
### Revoke a user session by its ID
* Method: `DELETE`
* Authentication: required
* Params: none
* Response: HTTP 200 on success, 500 on error
## `/api/v1/pleroma/settings/:app`
### Gets settings for some application
* Method `GET`
* Authentication: `read:accounts`
* Response: JSON. The settings for that application, or empty object if there is none.
* Example response:
```json
{
"some key": "some value"
}
```
### Updates settings for some application
* Method `PATCH`
* Authentication: `write:accounts`
* Request body: JSON object. The object will be merged recursively with old settings. If some field is set to null, it is removed.
* Example request:
```json
{
"some key": "some value",
"key to remove": null,
"nested field": {
"some key": "some value",
"key to remove": null
}
}
```
* Response: JSON. Updated (merged) settings for that application.
* Example response:
```json
{
"some key": "some value",
"nested field": {
"some key": "some value",
}
}
```

View File

@ -0,0 +1,9 @@
# Setting up a Gitlab-runner
When you push changes, a pipeline will start some automated jobs. These are done with so called [runners](https://docs.gitlab.com/runner/), services that run somewhere on a server and run these automated jobs. These jobs typically run tests and should pass. If not, you probably need to fix something.
Generally, Pleroma provides a runner, so you don't need to set up your own. However, if for whatever reason you want to set up your own, here's some high level instructions.
1. We use docker to run the jobs, so you should install that. For Debian, you need to allow non-free packages in the [source list](https://wiki.debian.org/SourcesList). Then you can install docker with `apt install docker-compose`.
2. You can [install](https://docs.gitlab.com/runner/install/index.html) and [configure](https://docs.gitlab.com/runner/register/index.html) a Gitlab-runner. It's probably easiest to install from the packages, but there are other options as well.
3. When registering the runner, you'll need some values. You can find them in the project under your own name. Choose "Settings", "CI/CD", and then expand "Runners". For executor you can choose "docker". For default image, you can use the image used in <https://git.pleroma.social/pleroma/pleroma/-/blob/develop/.gitlab-ci.yml#L1> (although it shouldn't matter much).

View File

@ -16,11 +16,4 @@ Installation instructions can be found in the installation section of these docs
Great! Now you can explore the fediverse! Open the login page for your Pleroma instance (e.g. <https://pleroma.soykaf.com>) and login with your username and password. (If you don't have an account yet, click on Register)
### Pleroma-FE
The default front-end used by Pleroma is Pleroma-FE. You can find more information on what it is and how to use it in the [Introduction to Pleroma-FE](../frontend).
### Mastodon interface
If the Pleroma interface isn't your thing, or you're just trying something new but you want to keep using the familiar Mastodon interface, we got that too!
Just add a "/web" after your instance url (e.g. <https://pleroma.soycaf.com/web>) and you'll end on the Mastodon web interface, but with a Pleroma backend! MAGIC!
The Mastodon interface is from the Glitch-soc fork. For more information on the Mastodon interface you can check the [Mastodon](https://docs.joinmastodon.org/) and [Glitch-soc](https://glitch-soc.github.io/docs/) documentation.
Remember, what you see is only the frontend part of Mastodon, the backend is still Pleroma.
The default front-end used by Pleroma is Pleroma-FE. You can find more information on what it is and how to use it in the [Introduction to Pleroma-FE](../frontend).

View File

@ -1,29 +1,14 @@
# Installing on Alpine Linux
{! backend/installation/otp_vs_from_source_source.include !}
## Installation
This guide is a step-by-step installation guide for Alpine Linux. The instructions were verified against Alpine v3.10 standard image. You might miss additional dependencies if you use `netboot` instead.
It assumes that you have administrative rights, either as root or a user with [sudo permissions](https://www.linode.com/docs/tools-reference/custom-kernels-distros/install-alpine-linux-on-your-linode/#configuration). If you want to run this guide with root, ignore the `sudo` at the beginning of the lines, unless it calls a user like `sudo -Hu pleroma`; in this case, use `su -l <username> -s $SHELL -c 'command'` instead.
### Required packages
* `postgresql`
* `elixir`
* `erlang`
* `erlang-parsetools`
* `erlang-xmerl`
* `git`
* `file-dev`
* Development Tools
* `cmake`
#### Optional packages used in this guide
* `nginx` (preferred, example configs for other reverse proxies can be found in the repo)
* `certbot` (or any other ACME client for Lets Encrypt certificates)
* `ImageMagick`
* `ffmpeg`
* `exiftool`
{! backend/installation/generic_dependencies.include !}
### Prepare the system
@ -117,7 +102,7 @@ cd /opt/pleroma
sudo -Hu pleroma mix deps.get
```
* Generate the configuration: `sudo -Hu pleroma mix pleroma.instance gen`
* Generate the configuration: `sudo -Hu pleroma MIX_ENV=prod mix pleroma.instance gen`
* Answer with `yes` if it asks you to install `rebar3`.
* This may take some time, because parts of pleroma get compiled first.
* After that it will ask you a few questions about your instance and generates a configuration file in `config/generated_config.exs`.
@ -240,4 +225,4 @@ sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new <username> <your@emailaddress
## Questions
Questions about the installation or didnt it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
Questions about the installation or didnt it work as it should be, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC.

View File

@ -1,4 +1,7 @@
# Installing on Arch Linux
{! backend/installation/otp_vs_from_source_source.include !}
## Installation
This guide will assume that you have administrative rights, either as root or a user with [sudo permissions](https://wiki.archlinux.org/index.php/Sudo). If you want to run this guide with root, ignore the `sudo` at the beginning of the lines, unless it calls a user like `sudo -Hu pleroma`; in this case, use `su <username> -s $SHELL -c 'command'` instead.
@ -92,7 +95,7 @@ cd /opt/pleroma
sudo -Hu pleroma mix deps.get
```
* Generate the configuration: `sudo -Hu pleroma mix pleroma.instance gen`
* Generate the configuration: `sudo -Hu pleroma MIX_ENV=prod mix pleroma.instance gen`
* Answer with `yes` if it asks you to install `rebar3`.
* This may take some time, because parts of pleroma get compiled first.
* After that it will ask you a few questions about your instance and generates a configuration file in `config/generated_config.exs`.
@ -215,4 +218,4 @@ sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new <username> <your@emailaddress
## Questions
Questions about the installation or didnt it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
Questions about the installation or didnt it work as it should be, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC.

View File

@ -1,27 +1,12 @@
# Installing on Debian Based Distributions
{! backend/installation/otp_vs_from_source_source.include !}
## Installation
This guide will assume you are on Debian Stretch. This guide should also work with Ubuntu 16.04 and 18.04. It also assumes that you have administrative rights, either as root or a user with [sudo permissions](https://www.digitalocean.com/community/tutorials/how-to-add-delete-and-grant-sudo-privileges-to-users-on-a-debian-vps). If you want to run this guide with root, ignore the `sudo` at the beginning of the lines, unless it calls a user like `sudo -Hu pleroma`; in this case, use `su <username> -s $SHELL -c 'command'` instead.
This guide will assume you are on Debian 11 (“bullseye”) or later. This guide should also work with Ubuntu 18.04 (“Bionic Beaver”) and later. It also assumes that you have administrative rights, either as root or a user with [sudo permissions](https://www.digitalocean.com/community/tutorials/how-to-add-delete-and-grant-sudo-privileges-to-users-on-a-debian-vps). If you want to run this guide with root, ignore the `sudo` at the beginning of the lines, unless it calls a user like `sudo -Hu pleroma`; in this case, use `su <username> -s $SHELL -c 'command'` instead.
### Required packages
* `postgresql` (9.6+, Ubuntu 16.04 comes with 9.5, you can get a newer version from [here](https://www.postgresql.org/download/linux/ubuntu/))
* `postgresql-contrib` (9.6+, same situtation as above)
* `elixir` (1.8+, Follow the guide to install from the Erlang Solutions repo or use [asdf](https://github.com/asdf-vm/asdf) as the pleroma user)
* `erlang-dev`
* `erlang-nox`
* `libmagic-dev`
* `git`
* `build-essential`
* `cmake`
#### Optional packages used in this guide
* `nginx` (preferred, example configs for other reverse proxies can be found in the repo)
* `certbot` (or any other ACME client for Lets Encrypt certificates)
* `ImageMagick`
* `ffmpeg`
* `exiftool`
{! backend/installation/generic_dependencies.include !}
### Prepare the system
@ -40,20 +25,14 @@ sudo apt install git build-essential postgresql postgresql-contrib cmake libmagi
### Install Elixir and Erlang
* Download and add the Erlang repository:
```shell
wget -P /tmp/ https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb
sudo dpkg -i /tmp/erlang-solutions_2.0_all.deb
```
* Install Elixir and Erlang:
* Install Elixir and Erlang (you might need to use backports or [asdf](https://github.com/asdf-vm/asdf) on old systems):
```shell
sudo apt update
sudo apt install elixir erlang-dev erlang-nox
```
### Optional packages: [`docs/installation/optional/media_graphics_packages.md`](../installation/optional/media_graphics_packages.md)
```shell
@ -90,7 +69,7 @@ cd /opt/pleroma
sudo -Hu pleroma mix deps.get
```
* Generate the configuration: `sudo -Hu pleroma mix pleroma.instance gen`
* Generate the configuration: `sudo -Hu pleroma MIX_ENV=prod mix pleroma.instance gen`
* Answer with `yes` if it asks you to install `rebar3`.
* This may take some time, because parts of pleroma get compiled first.
* After that it will ask you a few questions about your instance and generates a configuration file in `config/generated_config.exs`.
@ -202,4 +181,4 @@ sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new <username> <your@emailaddress
## Questions
Questions about the installation or didnt it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
Questions about the installation or didnt it work as it should be, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC.

View File

@ -89,7 +89,7 @@ sudo -Hu pleroma mix deps.get
* コンフィギュレーションを生成します。
```
sudo -Hu pleroma mix pleroma.instance gen
sudo -Hu pleroma MIX_ENV=prod mix pleroma.instance gen
```
* rebar3をインストールしてもよいか聞かれたら、yesを入力してください。
* このときにpleromaの一部がコンパイルされるため、この処理には時間がかかります。
@ -103,7 +103,7 @@ sudo -Hu pleroma mv config/{generated_config.exs,prod.secret.exs}
* 先程のコマンドで、すでに `config/setup_db.psql` というファイルが作られています。このファイルをもとに、データベースを作成します。
```
sudo -Hu pleroma mix pleroma.instance gen
sudo -Hu pleroma MIX_ENV=prod mix pleroma.instance gen
```
* そして、データベースのマイグレーションを実行します。
@ -191,5 +191,5 @@ sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new <username> <your@emailaddress
インストールについて質問がある、もしくは、うまくいかないときは、以下のところで質問できます。
* [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org)
* **Freenode** の **#pleroma** IRCチャンネル
* [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat)
* **libera.chat** の **#pleroma** IRCチャンネル

View File

@ -1,8 +1,10 @@
# Installing on FreeBSD
# Installing on FreeBSD
This document was written for FreeBSD 12.1, but should be work on future releases.
## Required software
{! backend/installation/generic_dependencies.include !}
## Installing software used in this guide
This assumes the target system has `pkg(8)`.
@ -54,7 +56,7 @@ Configure Pleroma. Note that you need a domain name at this point:
```
$ cd /home/pleroma/pleroma
$ mix deps.get # Enter "y" when asked to install Hex
$ mix pleroma.instance gen # You will be asked a few questions here.
$ MIX_ENV=prod mix pleroma.instance gen # You will be asked a few questions here.
$ cp config/generated_config.exs config/prod.secret.exs
```
@ -213,4 +215,4 @@ incorrect timestamps. You should have ntpd running.
## Questions
Questions about the installation or didnt it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
Questions about the installation or didnt it work as it should be, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC.

View File

@ -0,0 +1,16 @@
## Required dependencies
* PostgreSQL 9.6+
* Elixir 1.10+
* Erlang OTP 22.2+
* git
* file / libmagic
* gcc (clang might also work)
* GNU make
* CMake
## Optional dependencies
* ImageMagick
* FFmpeg
* exiftool

View File

@ -1,11 +1,12 @@
# Installing on Gentoo GNU/Linux
{! backend/installation/otp_vs_from_source_source.include !}
## Installation
This guide will assume that you have administrative rights, either as root or a user with [sudo permissions](https://wiki.gentoo.org/wiki/Sudo). Lines that begin with `#` indicate that they should be run as the superuser. Lines using `$` should be run as the indicated user, e.g. `pleroma$` should be run as the `pleroma` user.
### Configuring your hostname (optional)
If you would like your prompt to permanently include your host/domain, change `/etc/conf.d/hostname` to your hostname. You can reboot or use the `hostname` command to make immediate changes.
{! backend/installation/generic_dependencies.include !}
### Your make.conf, package.use, and USE flags
@ -54,7 +55,7 @@ Gentoo quite pointedly does not come with a cron daemon installed, and as such i
# emerge --ask dev-db/postgresql dev-lang/elixir dev-vcs/git www-servers/nginx app-crypt/certbot app-crypt/certbot-nginx dev-util/cmake sys-apps/file
```
If you would not like to install the optional packages, remove them from this line.
If you would not like to install the optional packages, remove them from this line.
If you're running this from a low-powered virtual machine, it should work though it will take some time. There were no issues on a VPS with a single core and 1GB of RAM; if you are using an even more limited device and run into issues, you can try creating a swapfile or use a more powerful machine running Gentoo to [cross build](https://wiki.gentoo.org/wiki/Cross_build_environment). If you have a wait ahead of you, now would be a good time to take a break, strech a bit, refresh your beverage of choice and/or get a snack, and reply to Arch users' posts with "I use Gentoo btw" as we do.
@ -79,12 +80,12 @@ The output from emerging postgresql should give you a command for initializing t
```
* Start postgres and enable the system service
```shell
# /etc/init.d/postgresql-11 start
# rc-update add postgresql-11 default
```
### A note on licenses, the AGPL, and deployment procedures
If you do not plan to make any modifications to your Pleroma instance, cloning directly from the main repo will get you what you need. However, if you plan on doing any contributions to upstream development, making changes or modifications to your instance, making custom themes, or want to play around--and let's be honest here, if you're using Gentoo that is most likely you--you will save yourself a lot of headache later if you take the time right now to fork the Pleroma repo and use that in the following section.
@ -135,7 +136,7 @@ pleroma$ mix deps.get
* Generate the configuration:
```shell
pleroma$ mix pleroma.instance gen
pleroma$ MIX_ENV=prod mix pleroma.instance gen
```
* Answer with `yes` if it asks you to install `rebar3`.
@ -241,7 +242,7 @@ First, ensure that the command you will be installing into your crontab works.
# /usr/bin/certbot renew --nginx
```
Assuming not much time has passed since you got certbot working a few steps ago, you should get a message for all domains you installed certificates for saying `Cert not yet due for renewal`.
Assuming not much time has passed since you got certbot working a few steps ago, you should get a message for all domains you installed certificates for saying `Cert not yet due for renewal`.
Now, run crontab as a superuser with `crontab -e` or `sudo crontab -e` as appropriate, and add the following line to your cron:
@ -298,4 +299,4 @@ If you opted to allow sudo for the `pleroma` user but would like to remove the a
## Questions
Questions about the installation or didnt it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
Questions about the installation or didnt it work as it should be, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC.

View File

@ -1,10 +1,11 @@
# Switching a from-source install to OTP releases
## What are OTP releases?
OTP releases are as close as you can get to binary releases with Erlang/Elixir. The release is self-contained, and provides everything needed to boot it, it is easily administered via the provided shell script to open up a remote console, start/stop/restart the release, start in the background, send remote commands, and more.
{! backend/installation/otp_vs_from_source.include !}
In this guide we cover how you can migrate from a from source installation to one using OTP releases.
## Pre-requisites
You will be running commands as root. If you aren't root already, please elevate your priviledges by executing `sudo su`/`su`.
You will be running commands as root. If you aren't root already, please elevate your privileges by executing `sudo su`/`su`.
The system needs to have `curl` and `unzip` installed for downloading and unpacking release builds.

View File

@ -1,6 +1,8 @@
# Installing on NetBSD
## Required software
{! backend/installation/generic_dependencies.include !}
## Installing software used in this guide
pkgin should have been installed by the NetBSD installer if you selected
the right options. If it isn't installed, install it using pkg_add.
@ -71,7 +73,7 @@ Configure Pleroma. Note that you need a domain name at this point:
```
$ cd /home/pleroma/pleroma
$ mix deps.get
$ mix pleroma.instance gen # You will be asked a few questions here.
$ MIX_ENV=prod mix pleroma.instance gen # You will be asked a few questions here.
```
Since Postgres is configured, we can now initialize the database. There should
@ -193,8 +195,6 @@ Run `# /etc/rc.d/pleroma start` to start Pleroma.
Restart nginx with `# /etc/rc.d/nginx restart` and you should be up and running.
If you need further help, contact niaa on freenode.
Make sure your time is in sync, or other instances will receive your posts with
incorrect timestamps. You should have ntpd running.
@ -208,4 +208,4 @@ incorrect timestamps. You should have ntpd running.
## Questions
Questions about the installation or didnt it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
Questions about the installation or didnt it work as it should be, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC.

View File

@ -0,0 +1,15 @@
# Installing on NixOS
NixOS contains a source build package of pleroma and a NixOS module to install it.
For installation add this to your configuration.nix and add a config.exs next to it:
```nix
services.pleroma = {
enable = true;
configs = [ (lib.fileContents ./config.exs) ];
secretConfigFile = "/var/lib/pleroma/secret.exs";
};
```
## Questions
The nix community uses matrix for communication: [#nix:nixos.org](https://matrix.to/#/#nix:nixos.org)

View File

@ -4,19 +4,11 @@ This guide describes the installation and configuration of pleroma (and the requ
For any additional information regarding commands and configuration files mentioned here, check the man pages [online](https://man.openbsd.org/) or directly on your server with the man command.
{! backend/installation/generic_dependencies.include !}
### Preparing the system
#### Required software
The following packages need to be installed:
* elixir
* gmake
* git
* postgresql-server
* postgresql-contrib
* cmake
* ffmpeg
* ImageMagick
To install them, run the following command (with doas or as root):
```
@ -239,7 +231,7 @@ Enter a shell as \_pleroma (as root `su _pleroma -`) and enter pleroma's install
Then follow the main installation guide:
* run `mix deps.get`
* run `mix pleroma.instance gen` and enter your instance's information when asked
* run `MIX_ENV=prod mix pleroma.instance gen` and enter your instance's information when asked
* copy config/generated\_config.exs to config/prod.secret.exs. The default values should be sufficient but you should edit it and check that everything seems OK.
* exit your current shell back to a root one and run `psql -U postgres -f /home/_pleroma/pleroma/config/setup_db.psql` to setup the database.
* return to a \_pleroma shell into pleroma's installation directory (`su _pleroma -;cd ~/pleroma`) and run `MIX_ENV=prod mix ecto.migrate`
@ -264,4 +256,4 @@ LC_ALL=en_US.UTF-8 MIX_ENV=prod mix pleroma.user new <username> <your@emailaddre
## Questions
Questions about the installation or didnt it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
Questions about the installation or didnt it work as it should be, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC.

View File

@ -10,8 +10,8 @@ suositeltavaa tehdä komennon `doas` avulla, katso `doas (1)` ja `doas.conf (5)`
Tästä eteenpäin oletuksena on, että domain "esimerkki.com" osoittaa
serverin IP-osoitteeseen.
Jos asennuksen kanssa on ongelmia, IRC-kanava #pleroma Freenodessa tai
Matrix-kanava #freenode_#pleroma:matrix.org ovat hyviä paikkoja löytää apua
Jos asennuksen kanssa on ongelmia, IRC-kanava #pleroma Libera.chat tai
Matrix-kanava #pleroma:libera.chat ovat hyviä paikkoja löytää apua
(englanniksi), `/msg eal kukkuu` jos haluat välttämättä puhua härmää.
Asenna tarvittava ohjelmisto:

View File

@ -1,9 +1,9 @@
# Optional software packages needed for specific functionality
For specific Pleroma functionality (which is disabled by default) some or all of the below packages are required:
* `ImageMagic`
* `ffmpeg`
* `exiftool`
* `ImageMagic`
* `ffmpeg`
* `exiftool`
Please refer to documentation in `docs/installation` on how to install them on specific OS.
@ -14,19 +14,20 @@ Note: the packages are not required with the current default settings of Pleroma
`ImageMagick` is a set of tools to create, edit, compose, or convert bitmap images.
It is required for the following Pleroma features:
* `Pleroma.Upload.Filters.Mogrify`, `Pleroma.Upload.Filters.Mogrifun` upload filters (related config: `Plaroma.Upload/filters` in `config/config.exs`)
* Media preview proxy for still images (related config: `media_preview_proxy/enabled` in `config/config.exs`)
* `Pleroma.Upload.Filters.Mogrify`, `Pleroma.Upload.Filters.Mogrifun` upload filters (related config: `Plaroma.Upload/filters` in `config/config.exs`)
* Media preview proxy for still images (related config: `media_preview_proxy/enabled` in `config/config.exs`)
## `ffmpeg`
`ffmpeg` is software to record, convert and stream audio and video.
It is required for the following Pleroma features:
* Media preview proxy for videos (related config: `media_preview_proxy/enabled` in `config/config.exs`)
* Media preview proxy for videos (related config: `media_preview_proxy/enabled` in `config/config.exs`)
## `exiftool`
`exiftool` is media files metadata reader/writer.
It is required for the following Pleroma features:
* `Pleroma.Upload.Filters.Exiftool` upload filter (related config: `Plaroma.Upload/filters` in `config/config.exs`)
* `Pleroma.Upload.Filters.Exiftool.StripLocation` upload filter (related config: `Plaroma.Upload/filters` in `config/config.exs`)
* `Pleroma.Upload.Filters.Exiftool.ReadDescription` upload filter (related config: `Plaroma.Upload/filters` in `config/config.exs`)

View File

@ -1,10 +1,14 @@
# Installing on Linux using OTP releases
{! backend/installation/otp_vs_from_source.include !}
This guide covers a installation using an OTP release. To install Pleroma from source, please check out the corresponding guide for your distro.
## Pre-requisites
* A machine running Linux with GNU (e.g. Debian, Ubuntu) or musl (e.g. Alpine) libc and `x86_64`, `aarch64` or `armv7l` CPU, you have root access to. If you are not sure if it's compatible see [Detecting flavour section](#detecting-flavour) below
* A (sub)domain pointed to the machine
You will be running commands as root. If you aren't root already, please elevate your priviledges by executing `sudo su`/`su`.
You will be running commands as root. If you aren't root already, please elevate your privileges by executing `sudo su`/`su`.
While in theory OTP releases are possbile to install on any compatible machine, for the sake of simplicity this guide focuses only on Debian/Ubuntu and Alpine.
@ -31,7 +35,7 @@ Other than things bundled in the OTP release Pleroma depends on:
=== "Alpine"
```
echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories
awk 'NR==2' /etc/apk/repositories | sed 's/main/community/' | tee -a /etc/apk/repositories
apk update
apk add curl unzip ncurses postgresql postgresql-contrib nginx certbot file-dev
```
@ -50,7 +54,6 @@ Per [`docs/installation/optional/media_graphics_packages.md`](optional/media_gra
=== "Alpine"
```
echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories
apk update
apk add imagemagick ffmpeg exiftool
```
@ -232,7 +235,7 @@ At this point if you open your (sub)domain in a browser you should see a 502 err
If everything worked, you should see Pleroma-FE when visiting your domain. If that didn't happen, try reviewing the installation steps, starting Pleroma in the foreground and seeing if there are any errrors.
Still doesn't work? Feel free to contact us on [#pleroma on freenode](https://irc.pleroma.social) or via matrix at <https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org>, you can also [file an issue on our Gitlab](https://git.pleroma.social/pleroma/pleroma-support/issues/new)
Questions about the installation or didnt it work as it should be, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC, you can also [file an issue on our Gitlab](https://git.pleroma.social/pleroma/pleroma-support/issues/new).
## Post installation
@ -290,7 +293,7 @@ nginx -t
## Create your first user and set as admin
```sh
cd /opt/pleroma/bin
cd /opt/pleroma
su pleroma -s $SHELL -lc "./bin/pleroma_ctl user new joeuser joeuser@sld.tld --admin"
```
This will create an account withe the username of 'joeuser' with the email address of joeuser@sld.tld, and set that user's account as an admin. This will result in a link that you can paste into the browser, which logs you in and enables you to set the password.
@ -301,4 +304,4 @@ This will create an account withe the username of 'joeuser' with the email addre
## Questions
Questions about the installation or didnt it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
Questions about the installation or didnt it work as it should be, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC, you can also [file an issue on our Gitlab](https://git.pleroma.social/pleroma/pleroma-support/issues/new).

View File

@ -0,0 +1,3 @@
## OTP releases vs from-source installations
There are two ways to install Pleroma. You can use OTP releases or do a from-source installation. OTP releases are as close as you can get to binary releases with Erlang/Elixir. The release is self-contained, and provides everything needed to boot it, it is easily administered via the provided shell script to open up a remote console, start/stop/restart the release, start in the background, send remote commands, and more. With from source installations you install Pleroma from source, meaning you have to install certain dependencies like Erlang+Elixir and compile Pleroma yourself.

View File

@ -0,0 +1,3 @@
{! backend/installation/otp_vs_from_source.include !}
This guide covers a from-source installation. To install using OTP releases, please check out [the OTP guide](./otp_en.md).

View File

@ -0,0 +1,9 @@
# Installing on Yunohost
[YunoHost](https://yunohost.org) is a server operating system aimed at self-hosting. The YunoHost community maintains a package of Pleroma which allows you to install Pleroma on YunoHost. You can install it via the normal way through the admin web interface, or through the CLI. More information can be found at [the repo of the package](https://github.com/YunoHost-Apps/pleroma_ynh).
## Questions
Questions and problems related to the YunoHost parts can be done through the [regular YunoHost channels](https://yunohost.org/en/help).
For questions about Pleroma, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC.

View File

@ -1,2 +1,2 @@
elixir_version=1.9.4
elixir_version=1.10.4
erlang_version=22.3.4.1

View File

@ -5,34 +5,13 @@
# 2. Copy this section into your Caddyfile and restart Caddy.
example.tld {
log /var/log/caddy/pleroma_access.log
errors /var/log/caddy/pleroma_error.log
log {
output file /var/log/caddy/pleroma.log
}
gzip
encode gzip
# this is explicitly IPv4 since Pleroma.Web.Endpoint binds on IPv4 only
# and `localhost.` resolves to [::0] on some systems: see issue #930
proxy / 127.0.0.1:4000 {
websocket
transparent
}
tls {
# Remove the rest of the lines in here, if you want to support older devices
key_type p256
ciphers ECDHE-ECDSA-WITH-CHACHA20-POLY1305 ECDHE-RSA-WITH-CHACHA20-POLY1305 ECDHE-ECDSA-AES256-GCM-SHA384 ECDHE-RSA-AES256-GCM-SHA384 ECDHE-ECDSA-AES128-GCM-SHA256 ECDHE-RSA-AES128-GCM-SHA256
}
# If you do not want to use the mediaproxy function, remove these lines.
# To use this directive, you need the http.cache plugin for Caddy.
cache {
match_path /media
default_max_age 720m
}
cache {
match_path /proxy
default_max_age 720m
}
# Stop removing lines here.
reverse_proxy 127.0.0.1:4000
}

View File

@ -1,48 +0,0 @@
#!/bin/sh
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
project_id="74"
project_branch="rebase/glitch-soc"
static_dir="instance/static"
# For bundling:
# project_branch="pleroma"
# static_dir="priv/static"
if [ ! -d "${static_dir}" ]
then
echo "Error: ${static_dir} directory is missing, are you sure you are running this script at the root of pleromas repository?"
exit 1
fi
last_modified="$(curl --fail -s -I 'https://git.pleroma.social/api/v4/projects/'${project_id}'/jobs/artifacts/'${project_branch}'/download?job=build' | grep '^Last-Modified:' | cut -d: -f2-)"
echo "branch:${project_branch}"
echo "Last-Modified:${last_modified}"
artifact="mastofe.zip"
if [ "${last_modified}x" = "x" ]
then
echo "ERROR: Couldn't get the modification date of the latest build archive, maybe it expired, exiting..."
exit 1
fi
if [ -e mastofe.timestamp ] && [ "$(cat mastofe.timestamp)" = "${last_modified}" ]
then
echo "MastoFE is up-to-date, exiting..."
exit 0
fi
curl --fail -c - "https://git.pleroma.social/api/v4/projects/${project_id}/jobs/artifacts/${project_branch}/download?job=build" -o "${artifact}" || exit
# TODO: Update the emoji as well
rm -fr "${static_dir}/sw.js" "${static_dir}/packs" || exit
unzip -q "${artifact}" || exit
cp public/assets/sw.js "${static_dir}/sw.js" || exit
cp -r public/packs "${static_dir}/packs" || exit
echo "${last_modified}" > mastofe.timestamp
rm -fr public
rm -i "${artifact}"

View File

@ -466,7 +466,7 @@
%% == PostgreSQL ==
%% {rdbms, global, default, [{workers, 10}],
%% [{server, {pgsql, "server", 5432, "database", "username", "password"}}]},
%% [{server, {pgsql, "server", "port", "database", "username", "password"}}]},
%% == ODBC (MSSQL) ==
%% {rdbms, global, default, [{workers, 10}],

View File

@ -81,6 +81,19 @@ server {
proxy_pass http://phoenix;
}
# Uncomment this if you want notice compatibility routes for frontends like Soapbox.
# location ~ ^/@[^/]+/([^/]+)$ {
# proxy_pass http://phoenix/notice/$1;
# }
#
# location ~ ^/@[^/]+/posts/([^/]+)$ {
# proxy_pass http://phoenix/notice/$1;
# }
#
# location ~ ^/[^/]+/status/([^/]+)$ {
# proxy_pass http://phoenix/notice/$1;
# }
location ~ ^/(media|proxy) {
proxy_cache pleroma_media_cache;
slice 1m;

View File

@ -1,4 +1,5 @@
# Recommended varnishncsa logging format: '%h %l %u %t "%m %{X-Forwarded-Proto}i://%{Host}i%U%q %H" %s %b "%{Referer}i" "%{User-agent}i"'
# Please use Varnish 7.0+ for proper Range Requests / Chunked encoding support
vcl 4.1;
import std;
@ -22,11 +23,6 @@ sub vcl_recv {
set req.http.X-Forwarded-Proto = "https";
}
# CHUNKED SUPPORT
if (req.http.Range ~ "bytes=") {
set req.http.x-range = req.http.Range;
}
# Pipe if WebSockets request is coming through
if (req.http.upgrade ~ "(?i)websocket") {
return (pipe);
@ -35,9 +31,9 @@ sub vcl_recv {
# Allow purging of the cache
if (req.method == "PURGE") {
if (!client.ip ~ purge) {
return(synth(405,"Not allowed."));
return (synth(405,"Not allowed."));
}
return(purge);
return (purge);
}
}
@ -53,17 +49,11 @@ sub vcl_backend_response {
return (retry);
}
# CHUNKED SUPPORT
if (bereq.http.x-range ~ "bytes=" && beresp.status == 206) {
set beresp.ttl = 10m;
set beresp.http.CR = beresp.http.content-range;
}
# Bypass cache for large files
# 50000000 ~ 50MB
if (std.integer(beresp.http.content-length, 0) > 50000000) {
set beresp.uncacheable = true;
return(deliver);
return (deliver);
}
# Don't cache objects that require authentication
@ -94,7 +84,7 @@ sub vcl_synth {
if (resp.status == 750) {
set resp.status = 301;
set resp.http.Location = req.http.x-redir;
return(deliver);
return (deliver);
}
}
@ -106,25 +96,12 @@ sub vcl_pipe {
}
}
sub vcl_hash {
# CHUNKED SUPPORT
if (req.http.x-range ~ "bytes=") {
hash_data(req.http.x-range);
unset req.http.Range;
}
}
sub vcl_backend_fetch {
# Be more lenient for slow servers on the fediverse
if (bereq.url ~ "^/proxy/") {
set bereq.first_byte_timeout = 300s;
}
# CHUNKED SUPPORT
if (bereq.http.x-range) {
set bereq.http.Range = bereq.http.x-range;
}
if (bereq.retries == 0) {
# Clean up the X-Varnish-Backend-503 flag that is used internally
# to mark broken backend responses that should be retried.
@ -143,14 +120,6 @@ sub vcl_backend_fetch {
}
}
sub vcl_deliver {
# CHUNKED SUPPORT
if (resp.http.CR) {
set resp.http.Content-Range = resp.http.CR;
unset resp.http.CR;
}
}
sub vcl_backend_error {
# Retry broken backend responses.
set bereq.http.X-Varnish-Backend-503 = "1";

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Pleroma do

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.App do

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.Benchmark do

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.Config do
@ -27,7 +27,7 @@ def run(["migrate_from_db" | options]) do
{opts, _} =
OptionParser.parse!(options,
strict: [env: :string, delete: :boolean],
strict: [env: :string, delete: :boolean, path: :string],
aliases: [d: :delete]
)
@ -259,18 +259,41 @@ defp create(group, settings) do
defp migrate_from_db(opts) do
env = opts[:env] || Pleroma.Config.get(:env)
filename = "#{env}.exported_from_db.secret.exs"
config_path =
if Pleroma.Config.get(:release) do
:config_path
|> Pleroma.Config.get()
|> Path.dirname()
else
"config"
cond do
opts[:path] ->
opts[:path]
Pleroma.Config.get(:release) ->
:config_path
|> Pleroma.Config.get()
|> Path.dirname()
true ->
"config"
end
|> Path.join("#{env}.exported_from_db.secret.exs")
|> Path.join(filename)
file = File.open!(config_path, [:write, :utf8])
with {:ok, file} <- File.open(config_path, [:write, :utf8]) do
write_config(file, config_path, opts)
shell_info("Database configuration settings have been exported to #{config_path}")
else
_ ->
shell_error("Impossible to save settings to this directory #{Path.dirname(config_path)}")
tmp_config_path = Path.join(System.tmp_dir!(), filename)
file = File.open!(tmp_config_path)
shell_info(
"Saving database configuration settings to #{tmp_config_path}. Copy it to the #{Path.dirname(config_path)} manually."
)
write_config(file, tmp_config_path, opts)
end
end
defp write_config(file, path, opts) do
IO.write(file, config_header())
ConfigDB
@ -278,20 +301,11 @@ defp migrate_from_db(opts) do
|> Enum.each(&write_and_delete(&1, file, opts[:delete]))
:ok = File.close(file)
System.cmd("mix", ["format", config_path])
shell_info(
"Database configuration settings have been exported to config/#{env}.exported_from_db.secret.exs"
)
System.cmd("mix", ["format", path])
end
if Code.ensure_loaded?(Config.Reader) do
defp config_header, do: "import Config\r\n\r\n"
defp read_file(config_file), do: Config.Reader.read_imports!(config_file)
else
defp config_header, do: "use Mix.Config\r\n\r\n"
defp read_file(config_file), do: Mix.Config.eval!(config_file)
end
defp config_header, do: "import Config\r\n\r\n"
defp read_file(config_file), do: Config.Reader.read_imports!(config_file)
defp write_and_delete(config, file, delete?) do
config

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.CountStatuses do

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.Database do
@ -8,10 +8,13 @@ defmodule Mix.Tasks.Pleroma.Database do
alias Pleroma.Object
alias Pleroma.Repo
alias Pleroma.User
require Logger
require Pleroma.Constants
import Ecto.Query
import Mix.Pleroma
use Mix.Task
@shortdoc "A collection of database related tasks"
@ -93,6 +96,15 @@ def run(["prune_objects" | args]) do
)
|> Repo.delete_all(timeout: :infinity)
prune_hashtags_query = """
DELETE FROM hashtags AS ht
WHERE NOT EXISTS (
SELECT 1 FROM hashtags_objects hto
WHERE ht.id = hto.hashtag_id)
"""
Repo.query(prune_hashtags_query)
if Keyword.get(options, :vacuum) do
Maintenance.vacuum("full")
end
@ -142,9 +154,8 @@ def run(["ensure_expiration"]) do
|> join(:inner, [a], o in Object,
on:
fragment(
"(?->>'id') = COALESCE((?)->'object'->> 'id', (?)->>'object')",
"(?->>'id') = associated_object_id((?))",
o.data,
a.data,
a.data
)
)
@ -197,7 +208,9 @@ def run(["set_text_search_config", tsconfig]) do
new.fts_content := to_tsvector(new.data->>'content');
RETURN new;
END
$$ LANGUAGE plpgsql"
$$ LANGUAGE plpgsql",
[],
timeout: :infinity
)
shell_info("Refresh RUM index")
@ -207,11 +220,41 @@ def run(["set_text_search_config", tsconfig]) do
Ecto.Adapters.SQL.query!(
Pleroma.Repo,
"CREATE INDEX objects_fts ON objects USING gin(to_tsvector('#{tsconfig}', data->>'content')); "
"CREATE INDEX CONCURRENTLY objects_fts ON objects USING gin(to_tsvector('#{tsconfig}', data->>'content')); ",
[],
timeout: :infinity
)
end
shell_info('Done.')
end
end
# Rolls back a specific migration (leaving subsequent migrations applied).
# WARNING: imposes a risk of unrecoverable data loss — proceed at your own responsibility.
# Based on https://stackoverflow.com/a/53825840
def run(["rollback", version]) do
prompt = "SEVERE WARNING: this operation may result in unrecoverable data loss. Continue?"
if shell_prompt(prompt, "n") in ~w(Yn Y y) do
{_, result, _} =
Ecto.Migrator.with_repo(Pleroma.Repo, fn repo ->
version = String.to_integer(version)
re = ~r/^#{version}_.*\.exs/
path = Ecto.Migrator.migrations_path(repo)
with {_, "" <> file} <- {:find, Enum.find(File.ls!(path), &String.match?(&1, re))},
{_, [{mod, _} | _]} <- {:compile, Code.compile_file(Path.join(path, file))},
{_, :ok} <- {:rollback, Ecto.Migrator.down(repo, version, mod)} do
{:ok, "Reversed migration: #{file}"}
else
{:find, _} -> {:error, "No migration found with version prefix: #{version}"}
{:compile, e} -> {:error, "Problem compiling migration module: #{inspect(e)}"}
{:rollback, e} -> {:error, "Problem reversing migration: #{inspect(e)}"}
end
end)
shell_info(inspect(result))
end
end
end

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.Digest do

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.Docs do

View File

@ -1,6 +1,6 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-onl
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.Ecto do
@doc """

View File

@ -1,6 +1,6 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-onl
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.Ecto.Migrate do
use Mix.Task

View File

@ -1,6 +1,6 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-onl
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.Ecto.Rollback do
use Mix.Task

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.Email do

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.Emoji do

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.Frontend do

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.Instance do
@ -34,7 +34,8 @@ def run(["gen" | rest]) do
static_dir: :string,
listen_ip: :string,
listen_port: :string,
strip_uploads: :string,
strip_uploads_location: :string,
read_uploads_description: :string,
anonymize_uploads: :string,
dedupe_uploads: :string
],
@ -161,7 +162,7 @@ def run(["gen" | rest]) do
)
|> Path.expand()
{strip_uploads_message, strip_uploads_default} =
{strip_uploads_location_message, strip_uploads_location_default} =
if Pleroma.Utils.command_available?("exiftool") do
{"Do you want to strip location (GPS) data from uploaded images? This requires exiftool, it was detected as installed. (y/n)",
"y"}
@ -170,12 +171,29 @@ def run(["gen" | rest]) do
"n"}
end
strip_uploads =
strip_uploads_location =
get_option(
options,
:strip_uploads,
strip_uploads_message,
strip_uploads_default
:strip_uploads_location,
strip_uploads_location_message,
strip_uploads_location_default
) === "y"
{read_uploads_description_message, read_uploads_description_default} =
if Pleroma.Utils.command_available?("exiftool") do
{"Do you want to read data from uploaded files so clients can use it to prefill fields like image description? This requires exiftool, it was detected as installed. (y/n)",
"y"}
else
{"Do you want to read data from uploaded files so clients can use it to prefill fields like image description? This requires exiftool, it was detected as not installed, please install it if you answer yes. (y/n)",
"n"}
end
read_uploads_description =
get_option(
options,
:read_uploads_description,
read_uploads_description_message,
read_uploads_description_default
) === "y"
anonymize_uploads =
@ -199,6 +217,7 @@ def run(["gen" | rest]) do
secret = :crypto.strong_rand_bytes(64) |> Base.encode64() |> binary_part(0, 64)
jwt_secret = :crypto.strong_rand_bytes(64) |> Base.encode64() |> binary_part(0, 64)
signing_salt = :crypto.strong_rand_bytes(8) |> Base.encode64() |> binary_part(0, 8)
lv_signing_salt = :crypto.strong_rand_bytes(8) |> Base.encode64() |> binary_part(0, 8)
{web_push_public_key, web_push_private_key} = :crypto.generate_key(:ecdh, :prime256v1)
template_dir = Application.app_dir(:pleroma, "priv") <> "/templates"
@ -217,6 +236,7 @@ def run(["gen" | rest]) do
secret: secret,
jwt_secret: jwt_secret,
signing_salt: signing_salt,
lv_signing_salt: lv_signing_salt,
web_push_public_key: Base.url_encode64(web_push_public_key, padding: false),
web_push_private_key: Base.url_encode64(web_push_private_key, padding: false),
db_configurable?: db_configurable?,
@ -227,7 +247,8 @@ def run(["gen" | rest]) do
listen_port: listen_port,
upload_filters:
upload_filters(%{
strip: strip_uploads,
strip_location: strip_uploads_location,
read_description: read_uploads_description,
anonymize: anonymize_uploads,
dedupe: dedupe_uploads
})
@ -295,12 +316,19 @@ defp write_robots_txt(static_dir, indexable, template_dir) do
defp upload_filters(filters) when is_map(filters) do
enabled_filters =
if filters.strip do
[Pleroma.Upload.Filter.Exiftool]
if filters.strip_location do
[Pleroma.Upload.Filter.Exiftool.StripLocation]
else
[]
end
enabled_filters =
if filters.read_description do
enabled_filters ++ [Pleroma.Upload.Filter.Exiftool.ReadDescription]
else
enabled_filters
end
enabled_filters =
if filters.anonymize do
enabled_filters ++ [Pleroma.Upload.Filter.AnonymizeFilename]

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.NotificationSettings do

View File

@ -1,3 +1,7 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.OpenapiSpec do
def run([path]) do
# Load Pleroma application to get version info

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.RefreshCounterCache do

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.Relay do

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.RobotsTxt do

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.Uploads do

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.User do
@ -51,9 +51,7 @@ def run(["new", nickname, email | rest]) do
A user will be created with the following information:
- nickname: #{nickname}
- email: #{email}
- password: #{
if(generated_password?, do: "[generated; a reset link will be created]", else: password)
}
- password: #{if(generated_password?, do: "[generated; a reset link will be created]", else: password)}
- name: #{name}
- bio: #{bio}
- moderator: #{if(moderator?, do: "true", else: "false")}
@ -114,15 +112,10 @@ def run(["reset_password", nickname]) do
{:ok, token} <- Pleroma.PasswordResetToken.create_token(user) do
shell_info("Generated password reset token for #{user.nickname}")
IO.puts(
"URL: #{
Pleroma.Web.Router.Helpers.reset_password_url(
Pleroma.Web.Endpoint,
:reset,
token.token
)
}"
)
url =
Pleroma.Web.Router.Helpers.reset_password_url(Pleroma.Web.Endpoint, :reset, token.token)
IO.puts("URL: #{url}")
else
_ ->
shell_error("No local user #{nickname}")
@ -321,9 +314,7 @@ def run(["invites"]) do
end
shell_info(
"ID: #{invite.id} | Token: #{invite.token} | Token type: #{invite.invite_type} | Used: #{
invite.used
}#{expire_info}#{using_info}"
"ID: #{invite.id} | Token: #{invite.token} | Token type: #{invite.invite_type} | Used: #{invite.used}#{expire_info}#{using_info}"
)
end)
end
@ -424,15 +415,45 @@ def run(["list"]) do
users
|> Enum.each(fn user ->
shell_info(
"#{user.nickname} moderator: #{user.is_moderator}, admin: #{user.is_admin}, locked: #{
user.is_locked
}, is_active: #{user.is_active}"
"#{user.nickname} moderator: #{user.is_moderator}, admin: #{user.is_admin}, locked: #{user.is_locked}, is_active: #{user.is_active}"
)
end)
end)
|> Stream.run()
end
def run(["fix_follow_state", local_user, remote_user]) do
start_pleroma()
with {:local, %User{} = local} <- {:local, User.get_by_nickname(local_user)},
{:remote, %User{} = remote} <- {:remote, User.get_by_nickname(remote_user)},
{:follow_data, %{data: %{"state" => request_state}}} <-
{:follow_data, Pleroma.Web.ActivityPub.Utils.fetch_latest_follow(local, remote)} do
calculated_state = User.following?(local, remote)
shell_info(
"Request state is #{request_state}, vs calculated state of following=#{calculated_state}"
)
if calculated_state == false && request_state == "accept" do
shell_info("Discrepancy found, fixing")
Pleroma.Web.CommonAPI.reject_follow_request(local, remote)
shell_info("Relationship fixed")
else
shell_info("No discrepancy found")
end
else
{:local, _} ->
shell_error("No local user #{local_user}")
{:remote, _} ->
shell_error("No remote user #{remote_user}")
{:follow_data, _} ->
shell_error("No follow data for #{local_user} and #{remote_user}")
end
end
defp set_moderator(user, value) do
{:ok, user} =
user

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Phoenix.Transports.WebSocket.Raw do

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Activity do
@ -53,7 +53,7 @@ defmodule Pleroma.Activity do
#
# ```
# |> join(:inner, [activity], o in Object,
# on: fragment("(?->>'id') = COALESCE((?)->'object'->> 'id', (?)->>'object')",
# on: fragment("(?->>'id') = associated_object_id((?))",
# o.data, activity.data, activity.data))
# |> preload([activity, object], [object: object])
# ```
@ -69,9 +69,8 @@ def with_joined_object(query, join_type \\ :inner) do
join(query, join_type, [activity], o in Object,
on:
fragment(
"(?->>'id') = COALESCE(?->'object'->>'id', ?->>'object')",
"(?->>'id') = associated_object_id(?)",
o.data,
activity.data,
activity.data
),
as: :object
@ -113,6 +112,7 @@ def with_preloaded_bookmark(query, %User{} = user) do
from([a] in query,
left_join: b in Bookmark,
on: b.user_id == ^user.id and b.activity_id == a.id,
as: :bookmark,
preload: [bookmark: b]
)
end
@ -123,6 +123,7 @@ def with_preloaded_report_notes(query) do
from([a] in query,
left_join: r in ReportNote,
on: a.id == r.activity_id,
as: :report_note,
preload: [report_notes: r]
)
end
@ -182,40 +183,48 @@ def get_by_ap_id_with_object(ap_id) do
|> Repo.one()
end
@spec get_by_id(String.t()) :: Activity.t() | nil
def get_by_id(id) do
case FlakeId.flake_id?(id) do
true ->
Activity
|> where([a], a.id == ^id)
|> restrict_deactivated_users()
|> Repo.one()
@doc """
Gets activity by ID, doesn't load activities from deactivated actors by default.
"""
@spec get_by_id(String.t(), keyword()) :: t() | nil
def get_by_id(id, opts \\ [filter: [:restrict_deactivated]]), do: get_by_id_with_opts(id, opts)
_ ->
nil
@spec get_by_id_with_user_actor(String.t()) :: t() | nil
def get_by_id_with_user_actor(id), do: get_by_id_with_opts(id, preload: [:user_actor])
@spec get_by_id_with_object(String.t()) :: t() | nil
def get_by_id_with_object(id), do: get_by_id_with_opts(id, preload: [:object])
defp get_by_id_with_opts(id, opts) do
if FlakeId.flake_id?(id) do
query = Queries.by_id(id)
with_filters_query =
if is_list(opts[:filter]) do
Enum.reduce(opts[:filter], query, fn
{:type, type}, acc -> Queries.by_type(acc, type)
:restrict_deactivated, acc -> restrict_deactivated_users(acc)
_, acc -> acc
end)
else
query
end
with_preloads_query =
if is_list(opts[:preload]) do
Enum.reduce(opts[:preload], with_filters_query, fn
:user_actor, acc -> with_preloaded_user_actor(acc)
:object, acc -> with_preloaded_object(acc)
_, acc -> acc
end)
else
with_filters_query
end
Repo.one(with_preloads_query)
end
end
def get_by_id_with_user_actor(id) do
case FlakeId.flake_id?(id) do
true ->
Activity
|> where([a], a.id == ^id)
|> with_preloaded_user_actor()
|> Repo.one()
_ ->
nil
end
end
def get_by_id_with_object(id) do
Activity
|> where(id: ^id)
|> with_preloaded_object()
|> Repo.one()
end
def all_by_ids_with_object(ids) do
Activity
|> where([a], a.id in ^ids)
@ -267,6 +276,11 @@ def get_create_by_object_ap_id_with_object(ap_id) when is_binary(ap_id) do
def get_create_by_object_ap_id_with_object(_), do: nil
@spec create_by_id_with_object(String.t()) :: t() | nil
def create_by_id_with_object(id) do
get_by_id_with_opts(id, preload: [:object], filter: [type: "Create"])
end
defp get_in_reply_to_activity_from_object(%Object{data: %{"inReplyTo" => ap_id}}) do
get_create_by_object_ap_id_with_object(ap_id)
end
@ -277,7 +291,8 @@ def get_in_reply_to_activity(%Activity{} = activity) do
get_in_reply_to_activity_from_object(Object.normalize(activity, fetch: false))
end
def normalize(obj) when is_map(obj), do: get_by_ap_id_with_object(obj["id"])
def normalize(%Activity{data: %{"id" => ap_id}}), do: get_by_ap_id_with_object(ap_id)
def normalize(%{"id" => ap_id}), do: get_by_ap_id_with_object(ap_id)
def normalize(ap_id) when is_binary(ap_id), do: get_by_ap_id_with_object(ap_id)
def normalize(_), do: nil
@ -286,7 +301,7 @@ def delete_all_by_object_ap_id(id) when is_binary(id) do
|> Queries.by_object_id()
|> Queries.exclude_type("Delete")
|> select([u], u)
|> Repo.delete_all()
|> Repo.delete_all(timeout: :infinity)
|> elem(1)
|> Enum.find(fn
%{data: %{"type" => "Create", "object" => ap_id}} when is_binary(ap_id) -> ap_id == id
@ -298,13 +313,15 @@ def delete_all_by_object_ap_id(id) when is_binary(id) do
def delete_all_by_object_ap_id(_), do: nil
defp purge_web_resp_cache(%Activity{} = activity) do
%{path: path} = URI.parse(activity.data["id"])
@cachex.del(:web_resp_cache, path)
defp purge_web_resp_cache(%Activity{data: %{"id" => id}} = activity) when is_binary(id) do
with %{path: path} <- URI.parse(id) do
@cachex.del(:web_resp_cache, path)
end
activity
end
defp purge_web_resp_cache(nil), do: nil
defp purge_web_resp_cache(activity), do: activity
def follow_accepted?(
%Activity{data: %{"type" => "Follow", "object" => followed_ap_id}} = activity
@ -344,11 +361,11 @@ def following_requests_for_actor(%User{ap_id: ap_id}) do
end
def restrict_deactivated_users(query) do
deactivated_users =
from(u in User.Query.build(%{deactivated: true}), select: u.ap_id)
|> Repo.all()
Activity.Queries.exclude_authors(query, deactivated_users)
query
|> join(:inner, [activity], user in User,
as: :user,
on: activity.actor == user.ap_id and user.is_active == true
)
end
defdelegate search(user, query, options \\ []), to: Pleroma.Activity.Search
@ -366,12 +383,6 @@ def direct_conversation_id(activity, for_user) do
end
end
@spec pinned_by_actor?(Activity.t()) :: boolean()
def pinned_by_actor?(%Activity{} = activity) do
actor = user_actor(activity)
activity.id in actor.pinned_activities
end
@spec get_by_object_ap_id_with_object(String.t()) :: t() | nil
def get_by_object_ap_id_with_object(ap_id) when is_binary(ap_id) do
ap_id
@ -382,4 +393,13 @@ def get_by_object_ap_id_with_object(ap_id) when is_binary(ap_id) do
end
def get_by_object_ap_id_with_object(_), do: nil
@spec add_by_params_query(String.t(), String.t(), String.t()) :: Ecto.Query.t()
def add_by_params_query(object_id, actor, target) do
object_id
|> Queries.by_object_id()
|> Queries.by_type("Add")
|> Queries.by_actor(actor)
|> where([a], fragment("?->>'target' = ?", a.data, ^target))
end
end

View File

@ -0,0 +1,81 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Activity.HTML do
alias Pleroma.HTML
alias Pleroma.Object
@cachex Pleroma.Config.get([:cachex, :provider], Cachex)
# We store a list of cache keys related to an activity in a
# separate cache, scrubber_management_cache. It has the same
# size as scrubber_cache (see application.ex). Every time we add
# a cache to scrubber_cache, we update scrubber_management_cache.
#
# The most recent write of a certain key in the management cache
# is the same as the most recent write of any record related to that
# key in the main cache.
# Assuming LRW ( https://hexdocs.pm/cachex/Cachex.Policy.LRW.html ),
# this means when the management cache is evicted by cachex, all
# related records in the main cache will also have been evicted.
defp get_cache_keys_for(activity_id) do
with {:ok, list} when is_list(list) <- @cachex.get(:scrubber_management_cache, activity_id) do
list
else
_ -> []
end
end
defp add_cache_key_for(activity_id, additional_key) do
current = get_cache_keys_for(activity_id)
unless additional_key in current do
@cachex.put(:scrubber_management_cache, activity_id, [additional_key | current])
end
end
def invalidate_cache_for(activity_id) do
keys = get_cache_keys_for(activity_id)
Enum.map(keys, &@cachex.del(:scrubber_cache, &1))
@cachex.del(:scrubber_management_cache, activity_id)
end
def get_cached_scrubbed_html_for_activity(
content,
scrubbers,
activity,
key \\ "",
callback \\ fn x -> x end
) do
key = "#{key}#{generate_scrubber_signature(scrubbers)}|#{activity.id}"
@cachex.fetch!(:scrubber_cache, key, fn _key ->
object = Object.normalize(activity, fetch: false)
add_cache_key_for(activity.id, key)
HTML.ensure_scrubbed_html(content, scrubbers, object.data["fake"] || false, callback)
end)
end
def get_cached_stripped_html_for_activity(content, activity, key) do
get_cached_scrubbed_html_for_activity(
content,
FastSanitize.Sanitizer.StripTags,
activity,
key,
&HtmlEntities.decode/1
)
end
defp generate_scrubber_signature(scrubber) when is_atom(scrubber) do
generate_scrubber_signature([scrubber])
end
defp generate_scrubber_signature(scrubbers) do
Enum.reduce(scrubbers, "", fn scrubber, signature ->
"#{signature}#{to_string(scrubber)}"
end)
end
end

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Activity.Ir.Topics do
@ -13,6 +13,14 @@ def get_activity_topics(activity) do
|> List.flatten()
end
defp generate_topics(%{data: %{"type" => "ChatMessage"}}, %{data: %{"type" => "Delete"}}) do
["user", "user:pleroma_chat"]
end
defp generate_topics(%{data: %{"type" => "ChatMessage"}}, %{data: %{"type" => "Create"}}) do
[]
end
defp generate_topics(%{data: %{"type" => "Answer"}}, _) do
[]
end
@ -21,7 +29,7 @@ defp generate_topics(object, activity) do
["user", "list"] ++ visibility_tags(object, activity)
end
defp visibility_tags(object, activity) do
defp visibility_tags(object, %{data: %{"type" => type}} = activity) when type != "Announce" do
case Visibility.get_visibility(activity) do
"public" ->
if activity.local do
@ -31,6 +39,10 @@ defp visibility_tags(object, activity) do
end
|> item_creation_tags(object, activity)
"local" ->
["public:local"]
|> item_creation_tags(object, activity)
"direct" ->
["direct"]
@ -39,6 +51,10 @@ defp visibility_tags(object, activity) do
end
end
defp visibility_tags(_object, _activity) do
[]
end
defp item_creation_tags(tags, object, %{data: %{"type" => "Create"}} = activity) do
tags ++
remote_topics(activity) ++ hashtags_to_topics(object) ++ attachment_topics(object, activity)
@ -48,14 +64,12 @@ defp item_creation_tags(tags, _, _) do
tags
end
defp hashtags_to_topics(%{data: %{"tag" => tags}}) do
tags
|> Enum.filter(&is_bitstring(&1))
|> Enum.map(fn tag -> "hashtag:" <> tag end)
defp hashtags_to_topics(object) do
object
|> Object.hashtags()
|> Enum.map(fn hashtag -> "hashtag:" <> hashtag end)
end
defp hashtags_to_topics(_), do: []
defp remote_topics(%{local: true}), do: []
defp remote_topics(%{actor: actor}) when is_binary(actor),
@ -65,7 +79,18 @@ defp remote_topics(_), do: []
defp attachment_topics(%{data: %{"attachment" => []}}, _act), do: []
defp attachment_topics(_object, %{local: true}), do: ["public:media", "public:local:media"]
defp attachment_topics(_object, %{local: true} = activity) do
case Visibility.get_visibility(activity) do
"public" ->
["public:media", "public:local:media"]
"local" ->
["public:local:media"]
_ ->
[]
end
end
defp attachment_topics(_object, %{actor: actor}) when is_binary(actor),
do: ["public:media", "public:remote:media:" <> URI.parse(actor).host]

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Activity.Queries do
@ -14,6 +14,11 @@ defmodule Pleroma.Activity.Queries do
alias Pleroma.Activity
alias Pleroma.User
@spec by_id(query(), String.t()) :: query()
def by_id(query \\ Activity, id) do
from(a in query, where: a.id == ^id)
end
@spec by_ap_id(query, String.t()) :: query
def by_ap_id(query \\ Activity, ap_id) do
from(
@ -47,8 +52,7 @@ def by_object_id(query, object_ids) when is_list(object_ids) do
activity in query,
where:
fragment(
"coalesce((?)->'object'->>'id', (?)->>'object') = ANY(?)",
activity.data,
"associated_object_id((?)) = ANY(?)",
activity.data,
^object_ids
)
@ -59,8 +63,7 @@ def by_object_id(query, object_id) when is_binary(object_id) do
from(activity in query,
where:
fragment(
"coalesce((?)->'object'->>'id', (?)->>'object') = ?",
activity.data,
"associated_object_id((?)) = ?",
activity.data,
^object_id
)

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Activity.Search do
@ -26,19 +26,23 @@ def search(user, search_query, options \\ []) do
:plain
end
Activity
|> Activity.with_preloaded_object()
|> Activity.restrict_deactivated_users()
|> restrict_public()
|> query_with(index_type, search_query, search_function)
|> maybe_restrict_local(user)
|> maybe_restrict_author(author)
|> maybe_restrict_blocked(user)
|> Pagination.fetch_paginated(
%{"offset" => offset, "limit" => limit, "skip_order" => index_type == :rum},
:offset
)
|> maybe_fetch(user, search_query)
try do
Activity
|> Activity.with_preloaded_object()
|> Activity.restrict_deactivated_users()
|> restrict_public(user)
|> query_with(index_type, search_query, search_function)
|> maybe_restrict_local(user)
|> maybe_restrict_author(author)
|> maybe_restrict_blocked(user)
|> Pagination.fetch_paginated(
%{"offset" => offset, "limit" => limit, "skip_order" => index_type == :rum},
:offset
)
|> maybe_fetch(user, search_query)
rescue
_ -> maybe_fetch([], user, search_query)
end
end
def maybe_restrict_author(query, %User{} = author) do
@ -53,7 +57,19 @@ def maybe_restrict_blocked(query, %User{} = user) do
def maybe_restrict_blocked(query, _), do: query
defp restrict_public(q) do
defp restrict_public(q, user) when not is_nil(user) do
intended_recipients = [
Pleroma.Constants.as_public(),
Pleroma.Web.ActivityPub.Utils.as_local_public()
]
from([a, o] in q,
where: fragment("?->>'type' = 'Create'", a.data),
where: fragment("? && ?", ^intended_recipients, a.recipients)
)
end
defp restrict_public(q, _user) do
from([a, o] in q,
where: fragment("?->>'type' = 'Create'", a.data),
where: ^Pleroma.Constants.as_public() in a.recipients
@ -61,10 +77,17 @@ defp restrict_public(q) do
end
defp query_with(q, :gin, search_query, :plain) do
%{rows: [[tsc]]} =
Ecto.Adapters.SQL.query!(
Pleroma.Repo,
"select current_setting('default_text_search_config')::regconfig::oid;"
)
from([a, o] in q,
where:
fragment(
"to_tsvector(?->>'content') @@ plainto_tsquery(?)",
"to_tsvector(?::oid::regconfig, ?->>'content') @@ plainto_tsquery(?)",
^tsc,
o.data,
^search_query
)
@ -72,10 +95,17 @@ defp query_with(q, :gin, search_query, :plain) do
end
defp query_with(q, :gin, search_query, :websearch) do
%{rows: [[tsc]]} =
Ecto.Adapters.SQL.query!(
Pleroma.Repo,
"select current_setting('default_text_search_config')::regconfig::oid;"
)
from([a, o] in q,
where:
fragment(
"to_tsvector(?->>'content') @@ websearch_to_tsquery(?)",
"to_tsvector(?::oid::regconfig, ?->>'content') @@ websearch_to_tsquery(?)",
^tsc,
o.data,
^search_query
)

160
lib/pleroma/announcement.ex Normal file
View File

@ -0,0 +1,160 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Announcement do
use Ecto.Schema
import Ecto.Changeset, only: [cast: 3, validate_required: 2]
import Ecto.Query
alias Pleroma.AnnouncementReadRelationship
alias Pleroma.Repo
@type t :: %__MODULE__{}
@primary_key {:id, FlakeId.Ecto.CompatType, autogenerate: true}
schema "announcements" do
field(:data, :map)
field(:starts_at, :utc_datetime)
field(:ends_at, :utc_datetime)
field(:rendered, :map)
timestamps(type: :utc_datetime)
end
def change(struct, params \\ %{}) do
struct
|> cast(validate_params(struct, params), [:data, :starts_at, :ends_at, :rendered])
|> validate_required([:data])
end
defp validate_params(struct, params) do
base_data =
%{
"content" => "",
"all_day" => false
}
|> Map.merge((struct && struct.data) || %{})
merged_data =
Map.merge(base_data, params.data)
|> Map.take(["content", "all_day"])
params
|> Map.merge(%{data: merged_data})
|> add_rendered_properties()
end
def add_rendered_properties(params) do
{content_html, _, _} =
Pleroma.Web.CommonAPI.Utils.format_input(params.data["content"], "text/plain",
mentions_format: :full
)
rendered = %{
"content" => content_html
}
params
|> Map.put(:rendered, rendered)
end
def add(params) do
changeset = change(%__MODULE__{}, params)
Repo.insert(changeset)
end
def update(announcement, params) do
changeset = change(announcement, params)
Repo.update(changeset)
end
def list_all do
__MODULE__
|> Repo.all()
end
def list_paginated(%{limit: limited_number, offset: offset_number}) do
__MODULE__
|> limit(^limited_number)
|> offset(^offset_number)
|> Repo.all()
end
def get_by_id(id) do
Repo.get_by(__MODULE__, id: id)
end
def delete_by_id(id) do
with announcement when not is_nil(announcement) <- get_by_id(id),
{:ok, _} <- Repo.delete(announcement) do
:ok
else
_ ->
:error
end
end
def read_by?(announcement, user) do
AnnouncementReadRelationship.exists?(user, announcement)
end
def mark_read_by(announcement, user) do
AnnouncementReadRelationship.mark_read(user, announcement)
end
def render_json(announcement, opts \\ []) do
extra_params =
case Keyword.fetch(opts, :for) do
{:ok, user} when not is_nil(user) ->
%{read: read_by?(announcement, user)}
_ ->
%{}
end
admin_extra_params =
case Keyword.fetch(opts, :admin) do
{:ok, true} ->
%{pleroma: %{raw_content: announcement.data["content"]}}
_ ->
%{}
end
base = %{
id: announcement.id,
content: announcement.rendered["content"],
starts_at: announcement.starts_at,
ends_at: announcement.ends_at,
all_day: announcement.data["all_day"],
published_at: announcement.inserted_at,
updated_at: announcement.updated_at,
mentions: [],
statuses: [],
tags: [],
emojis: [],
reactions: []
}
base
|> Map.merge(extra_params)
|> Map.merge(admin_extra_params)
end
# "visible" means:
# starts_at < time < ends_at
def list_all_visible_when(time) do
__MODULE__
|> where([a], is_nil(a.starts_at) or a.starts_at < ^time)
|> where([a], is_nil(a.ends_at) or a.ends_at > ^time)
|> Repo.all()
end
def list_all_visible do
list_all_visible_when(DateTime.now("Etc/UTC") |> elem(1))
end
end

View File

@ -0,0 +1,55 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.AnnouncementReadRelationship do
use Ecto.Schema
import Ecto.Changeset
alias FlakeId.Ecto.CompatType
alias Pleroma.Announcement
alias Pleroma.Repo
alias Pleroma.User
@type t :: %__MODULE__{}
schema "announcement_read_relationships" do
belongs_to(:user, User, type: CompatType)
belongs_to(:announcement, Announcement, type: CompatType)
timestamps(updated_at: false)
end
def mark_read(user, announcement) do
%__MODULE__{}
|> cast(%{user_id: user.id, announcement_id: announcement.id}, [:user_id, :announcement_id])
|> validate_required([:user_id, :announcement_id])
|> foreign_key_constraint(:user_id)
|> foreign_key_constraint(:announcement_id)
|> unique_constraint([:user_id, :announcement_id])
|> Repo.insert()
end
def mark_unread(user, announcement) do
with relationship <- get(user, announcement),
{:exists, true} <- {:exists, not is_nil(relationship)},
{:ok, _} <- Repo.delete(relationship) do
:ok
else
{:exists, false} ->
:ok
_ ->
:error
end
end
def get(user, announcement) do
Repo.get_by(__MODULE__, user_id: user.id, announcement_id: announcement.id)
end
def exists?(user, announcement) do
not is_nil(get(user, announcement))
end
end

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Application do
@ -25,7 +25,7 @@ def user_agent do
if Process.whereis(Pleroma.Web.Endpoint) do
case Config.get([:http, :user_agent], :default) do
:default ->
info = "#{Pleroma.Web.base_url()} <#{Config.get([:instance, :email], "")}>"
info = "#{Pleroma.Web.Endpoint.url()} <#{Config.get([:instance, :email], "")}>"
named_version() <> "; " <> info
custom ->
@ -61,6 +61,11 @@ def start(_type, _args) do
adapter = Application.get_env(:tesla, :adapter)
if match?({Tesla.Adapter.Finch, _}, adapter) do
Logger.info("Starting Finch")
Finch.start_link(name: MyFinch)
end
if adapter == Tesla.Adapter.Gun do
if version = Pleroma.OTPVersion.version() do
[major, minor] =
@ -89,7 +94,8 @@ def start(_type, _args) do
Pleroma.Repo,
Config.TransferTask,
Pleroma.Emoji,
Pleroma.Web.Plugs.RateLimiter.Supervisor
Pleroma.Web.Plugs.RateLimiter.Supervisor,
{Task.Supervisor, name: Pleroma.TaskSupervisor}
] ++
cachex_children() ++
http_children(adapter, @mix_env) ++
@ -102,14 +108,22 @@ def start(_type, _args) do
] ++
task_children(@mix_env) ++
dont_run_in_test(@mix_env) ++
chat_child(chat_enabled?()) ++
[
Pleroma.Gopher.Server
]
shout_child(shout_enabled?()) ++
[Pleroma.Gopher.Server]
# See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: Pleroma.Supervisor]
# If we have a lot of caches, default max_restarts can cause test
# resets to fail.
# Go for the default 3 unless we're in test
max_restarts =
if @mix_env == :test do
100
else
3
end
opts = [strategy: :one_for_one, name: Pleroma.Supervisor, max_restarts: max_restarts]
result = Supervisor.start_link(children, opts)
set_postgres_server_version()
@ -186,6 +200,7 @@ defp cachex_children do
build_cachex("object", default_ttl: 25_000, ttl_interval: 1000, limit: 2500),
build_cachex("rich_media", default_ttl: :timer.minutes(120), limit: 5000),
build_cachex("scrubber", limit: 2500),
build_cachex("scrubber_management", limit: 2500),
build_cachex("idempotency", expiration: idempotency_expiration(), limit: 2500),
build_cachex("web_resp", limit: 2500),
build_cachex("emoji_packs", expiration: emoji_packs_expiration(), limit: 10),
@ -218,7 +233,7 @@ def build_cachex(type, opts),
type: :worker
}
defp chat_enabled?, do: Config.get([:chat, :enabled])
defp shout_enabled?, do: Config.get([:shout, :enabled])
defp dont_run_in_test(env) when env in [:test, :benchmark], do: []
@ -230,17 +245,24 @@ defp dont_run_in_test(_) do
keys: :duplicate,
partitions: System.schedulers_online()
]}
] ++ background_migrators()
end
defp background_migrators do
[
Pleroma.Migrators.HashtagsTableMigrator,
Pleroma.Migrators.ContextObjectsDeletionMigrator
]
end
defp chat_child(true) do
defp shout_child(true) do
[
Pleroma.Web.ChatChannel.ChatChannelState,
Pleroma.Web.ShoutChannel.ShoutChannelState,
{Phoenix.PubSub, [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2]}
]
end
defp chat_child(_), do: []
defp shout_child(_), do: []
defp task_children(:test) do
[

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.ApplicationRequirements do
@ -34,15 +34,16 @@ defp handle_result({:error, message}), do: raise(VerifyError, message: message)
defp check_welcome_message_config!(:ok) do
if Pleroma.Config.get([:welcome, :email, :enabled], false) and
not Pleroma.Emails.Mailer.enabled?() do
Logger.error("""
To send welcome email do you need to enable mail.
\nconfig :pleroma, Pleroma.Emails.Mailer, enabled: true
""")
Logger.warn("""
To send welcome emails, you need to enable the mailer.
Welcome emails will NOT be sent with the current config.
{:error, "The mail disabled."}
else
:ok
Enable the mailer:
config :pleroma, Pleroma.Emails.Mailer, enabled: true
""")
end
:ok
end
defp check_welcome_message_config!(result), do: result
@ -51,18 +52,21 @@ defp check_welcome_message_config!(result), do: result
#
def check_confirmation_accounts!(:ok) do
if Pleroma.Config.get([:instance, :account_activation_required]) &&
not Pleroma.Config.get([Pleroma.Emails.Mailer, :enabled]) do
Logger.error(
"Account activation enabled, but no Mailer settings enabled.\n" <>
"Please set config :pleroma, :instance, account_activation_required: false\n" <>
"Otherwise setup and enable Mailer."
)
not Pleroma.Emails.Mailer.enabled?() do
Logger.warn("""
Account activation is required, but the mailer is disabled.
Users will NOT be able to confirm their accounts with this config.
Either disable account activation or enable the mailer.
{:error,
"Account activation enabled, but Mailer is disabled. Cannot send confirmation emails."}
else
:ok
Disable account activation:
config :pleroma, :instance, account_activation_required: false
Enable the mailer:
config :pleroma, Pleroma.Emails.Mailer, enabled: true
""")
end
:ok
end
def check_confirmation_accounts!(result), do: result
@ -160,9 +164,13 @@ defp do_check_rum!(setting, migrate) do
defp check_system_commands!(:ok) do
filter_commands_statuses = [
check_filter(Pleroma.Upload.Filters.Exiftool, "exiftool"),
check_filter(Pleroma.Upload.Filters.Mogrify, "mogrify"),
check_filter(Pleroma.Upload.Filters.Mogrifun, "mogrify")
check_filter(Pleroma.Upload.Filter.Exiftool.StripLocation, "exiftool"),
check_filter(Pleroma.Upload.Filter.Exiftool.ReadDescription, "exiftool"),
check_filter(Pleroma.Upload.Filter.Mogrify, "mogrify"),
check_filter(Pleroma.Upload.Filter.Mogrifun, "mogrify"),
check_filter(Pleroma.Upload.Filter.AnalyzeMetadata, "mogrify"),
check_filter(Pleroma.Upload.Filter.AnalyzeMetadata, "convert"),
check_filter(Pleroma.Upload.Filter.AnalyzeMetadata, "ffprobe")
]
preview_proxy_commands_status =

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.BBS.Authenticator do

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.BBS.Handler do
@ -19,9 +19,7 @@ def on_shell(username, _pubkey, _ip, _port) do
def on_connect(username, ip, port, method) do
Logger.debug(fn ->
"""
Incoming SSH shell #{inspect(self())} requested for #{username} from #{inspect(ip)}:#{
inspect(port)
} using #{inspect(method)}
Incoming SSH shell #{inspect(self())} requested for #{username} from #{inspect(ip)}:#{inspect(port)} using #{inspect(method)}
"""
end)
end
@ -44,8 +42,45 @@ defp loop(state) do
def puts_activity(activity) do
status = Pleroma.Web.MastodonAPI.StatusView.render("show.json", %{activity: activity})
IO.puts("-- #{status.id} by #{status.account.display_name} (#{status.account.acct})")
IO.puts(HTML.strip_tags(status.content))
status.content
|> String.split("<br/>")
|> Enum.map(&HTML.strip_tags/1)
|> Enum.map(&HtmlEntities.decode/1)
|> Enum.map(&IO.puts/1)
end
def puts_notification(activity, user) do
notification =
Pleroma.Web.MastodonAPI.NotificationView.render("show.json", %{
notification: activity,
for: user
})
IO.puts(
"== (#{notification.type}) #{notification.status.id} by #{notification.account.display_name} (#{notification.account.acct})"
)
notification.status.content
|> String.split("<br/>")
|> Enum.map(&HTML.strip_tags/1)
|> Enum.map(&HtmlEntities.decode/1)
|> (fn x ->
case x do
[content] ->
"> " <> content
[head | _tail] ->
# "> " <> hd <> "..."
head
|> String.slice(1, 80)
|> (fn x -> "> " <> x <> "..." end).()
end
end).()
|> IO.puts()
IO.puts("")
end
@ -55,6 +90,11 @@ def handle_command(state, "help") do
IO.puts("home - Show the home timeline")
IO.puts("p <text> - Post the given text")
IO.puts("r <id> <text> - Reply to the post with the given id")
IO.puts("t <id> - Show a thread from the given id")
IO.puts("n - Show notifications")
IO.puts("n read - Mark all notifactions as read")
IO.puts("f <id> - Favourites the post with the given id")
IO.puts("R <id> - Repeat the post with the given id")
IO.puts("quit - Quit")
state
@ -75,11 +115,53 @@ def handle_command(%{user: user} = state, "r " <> text) do
state
end
def handle_command(%{user: user} = state, "t " <> activity_id) do
with %Activity{} = activity <- Activity.get_by_id(activity_id) do
activities =
ActivityPub.fetch_activities_for_context(activity.data["context"], %{
blocking_user: user,
user: user,
exclude_id: activity.id
})
case activities do
[] ->
activity_id
|> Activity.get_by_id()
|> puts_activity()
_ ->
activities
|> Enum.reverse()
|> Enum.each(&puts_activity/1)
end
else
_e -> IO.puts("Could not show this thread...")
end
state
end
def handle_command(%{user: user} = state, "n read") do
Pleroma.Notification.clear(user)
IO.puts("All notifications were marked as read")
state
end
def handle_command(%{user: user} = state, "n") do
user
|> Pleroma.Web.MastodonAPI.MastodonAPI.get_notifications(%{})
|> Enum.each(&puts_notification(&1, user))
state
end
def handle_command(%{user: user} = state, "p " <> text) do
text = String.trim(text)
with {:ok, _activity} <- CommonAPI.post(user, %{status: text}) do
IO.puts("Posted!")
with {:ok, activity} <- CommonAPI.post(user, %{status: text}) do
IO.puts("Posted! ID: #{activity.id}")
else
_e -> IO.puts("Could not post...")
end
@ -87,6 +169,19 @@ def handle_command(%{user: user} = state, "p " <> text) do
state
end
def handle_command(%{user: user} = state, "f " <> id) do
id = String.trim(id)
with %Activity{} = activity <- Activity.get_by_id(id),
{:ok, _activity} <- CommonAPI.favorite(user, activity) do
IO.puts("Favourited!")
else
_e -> IO.puts("Could not Favourite...")
end
state
end
def handle_command(state, "home") do
user = state.user
@ -125,7 +220,7 @@ defp wait_input(state, input) do
loop(%{state | counter: state.counter + 1})
{:error, :interrupted} ->
{:input, ^input, {:error, :interrupted}} ->
IO.puts("Caught Ctrl+C...")
loop(%{state | counter: state.counter + 1})

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Bookmark do

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Caching do

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Captcha do

View File

@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Captcha.Kocaptcha do

Some files were not shown because too many files have changed in this diff Show More