Commit graph

1330 commits

Author SHA1 Message Date
Thomas Citharel d0835232d6
refactor(backend): change naming of function names to avoid the is_ prefix
Following Credo.Check.Readability.PredicateFunctionNames check

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2024-01-04 13:35:08 +01:00
Thomas Citharel b3ba45e8a7
fix(back): fix instances filtering
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2024-01-04 13:02:16 +01:00
Thomas Citharel 428537df1f
refactor: remove some outdated todos and legacy fallbacks
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2024-01-04 13:02:16 +01:00
Thomas Citharel f7585cfc75
fix(backend): validate length of instance actor details and set description column to text
Closes #1393

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2024-01-04 13:02:05 +01:00
Thomas Citharel c3aa145148
refactor(backend): extract convert_ecto_errors in the Mobilizon.Storage.Ecto module
And use it to log refreshing instance errors

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2024-01-04 12:59:15 +01:00
Thomas Citharel 9308c5399d
fix(activitypub): handle any type of error when fetching Application actor from NodeInfo
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2024-01-03 18:33:16 +01:00
Thomas Citharel 7c51ef79b9
refactor(activitypub): simplify request to get instances list and status
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2024-01-03 18:33:15 +01:00
Thomas Citharel 2f4b8feeba
fix(activitypub): refresh NodeInfo metadata straight away when adding a new instance to follow
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2024-01-03 18:33:14 +01:00
Thomas Citharel 6d2f08f3c1
refactor(activitypub): log instance actor details before it's created
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2024-01-03 18:33:13 +01:00
Thomas Citharel da3b074619
fix(nodeinfo): make sure we only process JSON content
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2024-01-03 18:33:13 +01:00
Thomas Citharel 881695ca19
refactor(http): extract HTTP header tests to a new module
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-22 16:00:33 +01:00
Thomas Citharel 7351468842
fix(activitypub): handle actors following with manually_approves_followers not set
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-22 15:57:29 +01:00
Thomas Citharel 58e4239aae Merge branch 'extract-nodeinfo-metadata' into 'main'
feat(nodeinfo): extract and save NodeInfo information from instances to...

Closes #1392

See merge request framasoft/mobilizon!1513
2023-12-21 10:05:26 +00:00
Thomas Citharel 99b2339424
feat(nodeinfo): extract and save NodeInfo information from instances to display it on instances list
We also try to detect the application actor if it's not given by NodeInfo metadata (FEP-2677)
(guessing for Mobilizon, PeerTube & Mastodon).

Closes #1392

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-21 10:45:56 +01:00
Thomas Citharel ff0440c634
fix(feeds): increase feed item limit from 500 to 5000
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-20 09:26:58 +01:00
Thomas Citharel 3c75856149
fix(feeds): make sure posts for feeds are ordered by publication date desc
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-20 09:26:28 +01:00
Thomas Citharel e73fd9b370
fix(activitypub): make relay outbox events ordered by desc publication date
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-20 09:24:59 +01:00
summersamara 31411bfc03
Fix ICS feed missing events: order by "begins_on" DESC so that the latest events are always included
potsda.mn/mobilizon#37
2023-12-20 09:07:47 +01:00
Thomas Citharel 001a0ed1a5
fix(activitypub): do not try to calculate timezone from missing geo-coordinates
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-19 10:53:12 +01:00
Thomas Citharel 64237cfc26
feat(activitypub): allow simple text for address field
Closes #1387

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-19 10:52:31 +01:00
Thomas Citharel 00250ff33a
refactor(activitypub): cleanup unused imports and variables
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-19 09:53:05 +01:00
Thomas Citharel dd775b6ae2
fix(nodeinfo): fix getting application actor information from NodeInfo response
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-19 09:52:32 +01:00
Thomas Citharel f10977a99a
feat(activitypub): implement FEP-2677 to identify the application actor used for federation
Instead of always assuming it will be @relay@host.tld

Closes #1367

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-14 16:31:58 +01:00
Thomas Citharel 459f486a90
refactor(docker): allow webPush configuration to be configured using env variables in Docker
Closes #1383

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-11 16:31:24 +01:00
778a69cd 5030b755a0
fix: allow html_to_text to receive nil, e.g. for empty event descriptions
Fixes potsda.mn/mobilizon#34

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-11 09:42:06 +01:00
Thomas Citharel 7210f86889
feat(cli): add command to test emails send correctly
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-07 09:17:33 +01:00
Thomas Citharel 4855af8f87
feat(docker): allow to configure loglevel at runtime through env variable
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-07 09:17:33 +01:00
Thomas Citharel 09f41328ab
fix(graphql): set default value for resource type parameter
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-06 14:43:51 +01:00
Thomas Citharel dc6647f5dc
fix: sanitize descriptions from resources
Currently resources descriptions are not used anywhere but they are
prefilled from source URL preview. Still, doesn't hurt to sanitize
these.

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-06 11:47:28 +01:00
Thomas Citharel ffff379d47
fix: always consider report content as text
Report content was used as HTML in front-end and e-mails but wasn't sanitized as such.

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-06 11:05:56 +01:00
Thomas Citharel 5b337f952a
refactor(activitypub): handle failure finding public key in actor keys
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-06 08:25:02 +01:00
Thomas Citharel 147096cc3d
refactor: to lower cyclomatic complexity
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-05 08:40:01 +01:00
Thomas Citharel 89d1ee42f4
fix(backend): handle ecto errors when fetching and create entities
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-05 08:06:16 +01:00
Thomas Citharel f1084c101f
fix(activitypub): fix receiving comments
Should fix race conditions and actors deleted of received comments

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-05 08:02:09 +01:00
Thomas Citharel 5e8f9afb62
fix(activitypub): compact ical:status in activitystream data
Was kept for no other reason than disambiguation with https://schema.org/status, but no need if we
specify the correct alias in the context.

Keeps a fallback for older versions compatibility

Closes #1378

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-04 14:05:27 +01:00
Thomas Citharel 9e41bc1ad6
fix(backend): only send suspension notification emails when actor's suspended and not just deleted
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-04 09:02:38 +01:00
Thomas Citharel 32caebb1d0
fix: prevent sending group physical address if it's empty and allow empty text for timezone
As old addresses don't hold TZ information

Closes #1357

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-03 18:14:00 +01:00
Thomas Citharel 8795576865
fix(activitypub): add missing externalParticipationUrl context
Closes #1376

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-03 17:51:05 +01:00
Thomas Citharel 5fcf3d5267
test: fix tests using verified routes
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-01 16:34:48 +01:00
Thomas Citharel 11e42d6601
feat(background): add a job to refresh participant stats
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-01 11:29:56 +01:00
Thomas Citharel 3f2a88fcfa
fix: fix creating participant stats
Map.update/4 does not pass initial value to callback function, so increasing for a new role would
set 0 instead of 1

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-01 11:29:54 +01:00
Thomas Citharel 9e6b232a78
feat: add links to cancel anonymous participations in emails
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-01 11:29:53 +01:00
Thomas Citharel b315e1d7ff
refactor: use Phoenix verified routes
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-01 11:29:53 +01:00
Thomas Citharel 49b070d939
fix(api): allow localhost as a valid uri host for applications
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-11-30 09:45:25 +01:00
Thomas Citharel cd53062c01
fix: add a final fallback if we have default_language: nil in instance config
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-11-23 11:20:38 +01:00
Thomas Citharel c731f0f084
test: fix tests
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-11-21 17:29:58 +01:00
Thomas Citharel 99c80c6490
chore: upgrade deps
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-11-21 16:40:32 +01:00
Thomas Citharel d7daafc4ea
fix(export): fix iCalendar export description HTML conversion
Paragraphs and line breaks are now properly handled when converting from HTML to text

Closes #888

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-11-21 15:40:34 +01:00
Thomas Citharel b97f1c997f
refactor: use dedicated email for event announcements
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-11-21 15:28:56 +01:00
Thomas Citharel 18314956ca
fix(api): fix allowing posting event private announcement
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-11-21 12:00:04 +01:00