Commit graph

5333 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Alex Gleason
b11dbbf403
UserController: fall back to frontend when user isn't found 2021-08-17 18:32:32 -05: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
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
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
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
Haelwenn (lanodan) Monnier
61d233921c
ObjectValidator.stringify_keys: filter out nil values 2021-08-11 21:38:10 +02: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 (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 (lanodan) Monnier
c64eae40a2
ObjectAgePolicy: Fix pattern matching on published 2021-08-10 07:41:06 +02: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
Sean King
1841bd8383 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remove/mastofe 2021-08-06 08:08:20 -06: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
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
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
44ede0657f
Merge remote-tracking branch 'pleroma/develop' into staff-plug 2021-08-04 11:48:57 -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
0114754db2
MastodonAPI: Support poll notification 2021-07-17 22:19:38 -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
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
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
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
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
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 (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
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
be2da95c36
Correctly purge a remote user 2021-06-29 21:45:38 -05:00
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
54af527759
Upgrade Ecto to v3.6.2, remove deprecated ecto_explain 2021-06-23 13:22:32 -05:00
Haelwenn (lanodan) Monnier
fc6ab78a84
Add test on changing [:instance, :upload_limit] 2021-06-22 12:25:25 +02:00
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
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
dc8fe91dec Metadata.Utils.attachment_url/1 was used in this test too 2021-06-09 10:06:44 -05:00
Haelwenn (lanodan) Monnier
c839078a75
ObjectValidators.{Announce,EmojiReact,Like}: Fix context, actor & addressing 2021-06-09 04:23:02 +02:00
d70db63084 Set the correct height/width if the data is available when generating opengraph metadata 2021-06-08 16:58:33 -05:00
d4ac9445cd Twittercard metadata for images should also include dimensions if available 2021-06-08 16:19:12 -05:00
5de65ce3e8 Set the correct height/width if the data is available when generating twittercard metadata 2021-06-08 15:59:55 -05:00
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
3121ed1325 Blurhash varies slightly by computer generating it, so just validate it wasn't nil 2021-06-08 14:53:03 -05:00
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
f1abe39f6f Update test names and verify blurhash is correctly generated for images 2021-06-08 14:05:13 -05:00
1c4c73c6a0 Add test for AnalyzeMetadata upload filter fetching dimensions from a video 2021-06-08 14:02:56 -05: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
017f947fc1 Channel name was incorrect. We left it as chat:public for backwards compatibility. 2021-06-07 16:10:24 -05:00
a5ae0432ed Test was named incorrectly and did not execute 2021-06-07 16:09:47 -05:00
f5ef7fe43b Fix test warnings 2021-06-07 16:06:53 -05:00
264458531a Formatting 2021-06-07 15:47:50 -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
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
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
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
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
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
d9513b11d3 Forgot to move migration test when rebasing 2021-06-01 11:49:47 -05:00
9ce2c017c0 We want clear_config/2 in all tests now 2021-06-01 11:49:47 -05:00