forked from potsda.mn/mobilizon
Merge branch 'main' of https://framagit.org/framasoft/mobilizon into fomo-3.1.0
Update to 3.1.0
This commit is contained in:
commit
d945361341
139
CHANGELOG.md
139
CHANGELOG.md
|
@ -5,6 +5,93 @@ 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/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## 3.1.0 (2023-05-31)
|
||||
|
||||
### Features
|
||||
|
||||
* **API:** Allow to create apps, with permissions and both Authorization Code Flow and Device Flow
|
||||
* **addresses:** Allow to enter manual addresses ([85d643d](https://framagit.org/framasoft/mobilizon/-/commit/85d643d0ecd5e7504f32953b9ed1509697b915e2))
|
||||
* **docker:** Specify the folder where tzdata downloads data so that it can be used in a volume ([4bb0625](https://framagit.org/framasoft/mobilizon/-/commit/4bb062528f12be530a3754ca23c1bc6dbc862e5a)), closes [#1280](https://framagit.org/framasoft/mobilizon/-/issues/1280)
|
||||
* **spam:** Introduce checking new accounts, events & comments for spam with the help of Akismet ([317a343](https://framagit.org/framasoft/mobilizon/-/commit/317a3434b221a1a91b66d8443984269404863a8e))
|
||||
* **rate-limiting:** Introduce rate-limiting on some endpoints ([c07ba3a5](https://framagit.org/framasoft/mobilizon/-/commit/c07ba3a5d19c419ef8aaf3ea9ca6e7f48e4f4487))
|
||||
* **front:** improve padding on event tags ([7fa452d](https://framagit.org/framasoft/mobilizon/-/commit/7fa452d9e3f9bb2443e571c9a32eaed51e32480a))
|
||||
* **front:** make admin profile view linkable directly with parameters ([08ce7e2](https://framagit.org/framasoft/mobilizon/-/commit/08ce7e26b73045279261ab87a14cb4f3dab5df1e))
|
||||
* **front:** make profile members link to profile on group admin view and the reverse ([96129d2](https://framagit.org/framasoft/mobilizon/-/commit/96129d2339133027220d3b5fcb1c52f84bcc5cbb))
|
||||
* **front:** make profiles and group admin views default to local ([3e0324d](https://framagit.org/framasoft/mobilizon/-/commit/3e0324d36ec5a8aa388e6b5d598a6f9a0c596797))
|
||||
* **front:** redirect user to homepage on disconnect when currently on private page ([d5a6df9](https://framagit.org/framasoft/mobilizon/-/commit/d5a6df9940fb458c5dbaee149015c02ebc370c6b)), closes [#1278](https://framagit.org/framasoft/mobilizon/-/issues/1278)
|
||||
* **front:** show skeleton content on event view until the event is loaded ([dc3b93f](https://framagit.org/framasoft/mobilizon/-/commit/dc3b93ffb5a4b072aec792533fd6e4b58ed7a893))
|
||||
* **i18n:** activate croatian language ([94182ae](https://framagit.org/framasoft/mobilizon/-/commit/94182aed2d8a22d00534f6376dfda2658bc8ba7e))
|
||||
* **i18n:** activate japanese language ([6bd8034](https://framagit.org/framasoft/mobilizon/-/commit/6bd8034fe816a432c3547de6d1ad8a18e73dc314)), closes [#1293](https://framagit.org/framasoft/mobilizon/-/issues/1293)
|
||||
* **post:** show post visibily in PostListItem component ([ec7ca4d](https://framagit.org/framasoft/mobilizon/-/commit/ec7ca4ddf18a38cf6f51d38b540eecc9858f3c98))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **global-search:** Add option values in debug log before calling global search service ([8141bb0](https://framagit.org/framasoft/mobilizon/-/commit/8141bb0acbc4eb02a917c5bc18712d0d954c4ee5))
|
||||
* **apps:** Fix cleaning application data background job ([aa20f69](https://framagit.org/framasoft/mobilizon/-/commit/aa20f6991127ddee546fc0b867298c1342dbcb4d))
|
||||
* **apps:** Show message when the user doesn't have approved apps yet ([e0ee9c1](https://framagit.org/framasoft/mobilizon/-/commit/e0ee9c143b0335753db5dfae19e324781d55bd4e))
|
||||
* **auth:** Handle logging-in with disabled auth provider ([a22a5e3](https://framagit.org/framasoft/mobilizon/-/commit/a22a5e3cb924869e32cb9ed71dab3e03d91c018f))
|
||||
* **backend:** Fix Mobilizon.Events.list_participations_for_user_query/1 ([bcf6fd8](https://framagit.org/framasoft/mobilizon/-/commit/bcf6fd893c762c12b63d7e02da43cd5c05db509b))
|
||||
* **backend:** Handle CLDR data having no standard property for a language ([dbe2da7](https://framagit.org/framasoft/mobilizon/-/commit/dbe2da79c3aa1543b87dce61b5fd90195fb53afe))
|
||||
* **backend:** Ignore group mentions for now ([b5f106b](https://framagit.org/framasoft/mobilizon/-/commit/b5f106b0a81fefba3203f8ec5855e834a2078222))
|
||||
* **back:** Improve error message when requesting reset passwords and new instructions ([1c1d0d4](https://framagit.org/framasoft/mobilizon/-/commit/1c1d0d47d70cf19abe5be42e7ec3a73656a8172b))
|
||||
* **back:** Replace NaiveDateTime uses with DateTime for consistency ([8ea00e7](https://framagit.org/framasoft/mobilizon/-/commit/8ea00e7c1827ce3056ae51968a62fb3dc03ac6eb))
|
||||
* **back:** Various small fixes in backend ([2a57340](https://framagit.org/framasoft/mobilizon/-/commit/2a57340a82e414e69924ad89e8db9fc326742cc7))
|
||||
* bind pagination current prop ([4bcf572](https://framagit.org/framasoft/mobilizon/-/commit/4bcf572c54d904587d0409e2eb68b4ca6cf48fec))
|
||||
* **federation:** Account suspension should use actor in question as author and not relay actor ([79b48da](https://framagit.org/framasoft/mobilizon/-/commit/79b48da22209a8b2f1b234b8b8e121543a39b22b))
|
||||
* **feeds:** Only provide future events in ICS/Atom feeds ([f3a4431](https://framagit.org/framasoft/mobilizon/-/commit/f3a443138a0e1e6cf34fc593f5c174d56c21e904)), closes [#1246](https://framagit.org/framasoft/mobilizon/-/issues/1246)
|
||||
* Fix type of variable in navbar ([50ab531](https://framagit.org/framasoft/mobilizon/-/commit/50ab531156214f883cb03f785ccf65e3f19ef50e))
|
||||
* **follow-instances:** Show correct error message when trying to follow already following actor ([d969c66](https://framagit.org/framasoft/mobilizon/-/commit/d969c6648f15e1ed280169a4c55d612bb002f03f))
|
||||
* **front:** Fix about sections titles ([487f406](https://framagit.org/framasoft/mobilizon/-/commit/487f4069b14fde6304c9a42cec5b1c1af79814c5))
|
||||
* **front:** Fix autocomplete attribute in o-inputitems after Oruga new version BC ([d2ba732](https://framagit.org/framasoft/mobilizon/-/commit/d2ba732b8b51986b739f6fbe3d74fa68e4b74ba0))
|
||||
* **front:** Fix behaviour when deleting an event from event list ([cfd10ea](https://framagit.org/framasoft/mobilizon/-/commit/cfd10ea96078f03ad3b4f5682e37078ffae16ee4))
|
||||
* **front:** Fix event list month order ([63c9ed6](https://framagit.org/framasoft/mobilizon/-/commit/63c9ed62de94d6d150798c949bad3d8a2dd4db23)), closes [#1244](https://framagit.org/framasoft/mobilizon/-/issues/1244)
|
||||
* **front:** Fix instances list pagination ([8543204](https://framagit.org/framasoft/mobilizon/-/commit/8543204bd95de886d8d35bd491f23ecbc0a6ef8d)), closes [#1277](https://framagit.org/framasoft/mobilizon/-/issues/1277)
|
||||
* **front:** Fix pagination display on dark mode ([4375438](https://framagit.org/framasoft/mobilizon/-/commit/4375438dc9fd2f1c5c9d7ed6670dde04f2da520f))
|
||||
* **front:** Fix style of My Events participations ([35b07dc](https://framagit.org/framasoft/mobilizon/-/commit/35b07dceaa41c74c28ea49655b755e341f56df32))
|
||||
* **front:** Focus report comment input in report modal ([2c28312](https://framagit.org/framasoft/mobilizon/-/commit/2c28312fc957901b86c2f3d1db8fc3376f505d37)), closes [#1236](https://framagit.org/framasoft/mobilizon/-/issues/1236)
|
||||
* **front:** Handle "Failed to fetch dynamically imported module" errors by refreshing the page ([3d21a06](https://framagit.org/framasoft/mobilizon/-/commit/3d21a067897e4aa24f6404686ca6896044584796))
|
||||
* **front:** Improve Delete account modal UI ([c420bbc](https://framagit.org/framasoft/mobilizon/-/commit/c420bbccc9bd1c348e41904e826dc49c71d7eeb4))
|
||||
* **front:** Improve resend inscription instructions view and show error when appropriate ([5563052](https://framagit.org/framasoft/mobilizon/-/commit/55630527957d4f6a2e1e6845e64a92bc4794efc8))
|
||||
* **front:** No cache-only for config ([8dcb76c](https://framagit.org/framasoft/mobilizon/-/commit/8dcb76c30d4fa835837fd3b3833f83682fbae615))
|
||||
* **front:** Small UI fixes on identity pickers ([6faafd6](https://framagit.org/framasoft/mobilizon/-/commit/6faafd639303e4b57ed81db2ffb5db4ad598b904))
|
||||
* **i18n:** Update translations ([3b7dbcd](https://framagit.org/framasoft/mobilizon/-/commit/3b7dbcd71f0d19d5e723a03c56ca0b1abbd16f5d))
|
||||
* **map:** Fix style of the map marker ([c7b90cd](https://framagit.org/framasoft/mobilizon/-/commit/c7b90cd60a14abea7aebab7e1d87f37a44371f7c))
|
||||
* **map:** Only show map details when needed ([23b5e59](https://framagit.org/framasoft/mobilizon/-/commit/23b5e5930cb9bdb57b1d7fa3ec899d7e4d3571be))
|
||||
* **map:** Only show marker if we have it's position ([f0cc5ff](https://framagit.org/framasoft/mobilizon/-/commit/f0cc5ffb8feb2f4d70416792a8ab2f4f44bfba85))
|
||||
* **password-reset:** Lower time before being available to reset password or resend instructions ([73eb460](https://framagit.org/framasoft/mobilizon/-/commit/73eb4603b185c341b63481ed934f66e19aa0784f))
|
||||
* **search:** Fix event search order ([a4e7ee3](https://framagit.org/framasoft/mobilizon/-/commit/a4e7ee37bedc63b2193a401c801b3b1298f566d2))
|
||||
* **typespec:** Fix missing return type in typespec ([2043c98](https://framagit.org/framasoft/mobilizon/-/commit/2043c98717e8621b3953d347be0b4a35f494af98))
|
||||
* Change the way preferredUsername is synced ([a73e5a08](https://framagit.org/framasoft/mobilizon/-/commit/a73e5a085ef48a88dbb8f9c407df0430ca89fe1f))
|
||||
* datetimepicker: change colors for day & time selectors on dark mode ([b18e8fd3](https://framagit.org/framasoft/mobilizon/-/commit/b18e8fd37c76190ca7f6db82e408cdb005d1810a))
|
||||
* Save IP and login date from directly registered accounts ([1db5c4ae](https://framagit.org/framasoft/mobilizon/-/commit/1db5c4ae2d49d5adbda2c0825ee0320322b525d6))
|
||||
* Make sure every cache is properly cleared when managing an event ([f531c39b](https://framagit.org/framasoft/mobilizon/-/commit/f531c39b7e8829a5e3ff68f624b04e12266f2148))
|
||||
* Add page title for Categories view ([0775814e](https://framagit.org/framasoft/mobilizon/-/commit/0775814e19e6f6ddde564f7a29ae80fab2175d3f))
|
||||
* Fix notifications settings not working ([31fd99bd](https://framagit.org/framasoft/mobilizon/-/commit/31fd99bd3760872e452351b33765d25b2b9720f2))
|
||||
* **discussionlistitem:** remove unecessary parameter in vue router target ([779812c](https://framagit.org/framasoft/mobilizon/-/commit/779812c746cf722dd86bcc0ad3bc58e558c13223))
|
||||
* **emails:** make sure group notification emails are only sent once per email ([927e95f](https://framagit.org/framasoft/mobilizon/-/commit/927e95f387653c7d620e9051c30843ba49c2d65c))
|
||||
* **frontend:** event edition UI improvements ([0e14a36](https://framagit.org/framasoft/mobilizon/-/commit/0e14a36c6d30ebe386b2136d29539f3b3e914efc))
|
||||
* **frontend:** only show map on event edition when we have an address or we want to put in details ([02867e6](https://framagit.org/framasoft/mobilizon/-/commit/02867e6e1482ac8770f94fd2bd00174bb31fbdc7))
|
||||
* **front:** fix showing current group avatar & banners ([20b4aaa](https://framagit.org/framasoft/mobilizon/-/commit/20b4aaabc97080e85cb68fd03393379c7ef82d95))
|
||||
* **front:** fix showing current identity avatar & banners ([d0f4721](https://framagit.org/framasoft/mobilizon/-/commit/d0f4721925d0c50340d6db8a4e9f4d3e4ca01457))
|
||||
* **front:** improve UI of the glossary page ([d47b69d](https://framagit.org/framasoft/mobilizon/-/commit/d47b69d6caa7c4405ab2e573ba407f9b2450c3bb))
|
||||
* **front:** increase padding next to arrow down in `<select>` elements ([94f186c](https://framagit.org/framasoft/mobilizon/-/commit/94f186ce5080316cd633e0344651b0050c2f14d4))
|
||||
* **front:** remove cache-only for ABOUT GraphQL details on homepage ([6858bcb](https://framagit.org/framasoft/mobilizon/-/commit/6858bcbbda6d8527bd15b9138e7bb30c5ead72d7))
|
||||
* **front:** remove leftover console.logs ([6da0dba](https://framagit.org/framasoft/mobilizon/-/commit/6da0dba0fd6d071ce5978802104538d0c2ef7dae))
|
||||
* **front:** reset page number to 1 when search criteria changes ([d73bafe](https://framagit.org/framasoft/mobilizon/-/commit/d73bafec97cd7d8eda887d21870427262befab0f)), closes [#1272](https://framagit.org/framasoft/mobilizon/-/issues/1272)
|
||||
* **front:** various UI improvements for group page ([b097567](https://framagit.org/framasoft/mobilizon/-/commit/b0975672c1c06ace364cf47bfcfa39db9c3b712b))
|
||||
* **graphql:** fix calling GET_GROUP ([2933ee0](https://framagit.org/framasoft/mobilizon/-/commit/2933ee06791a24dbf8c8b2a2eabc67f71e56f361))
|
||||
* **group:** rephrase "Public Page" to "Announcements", as all posts are not necessary public ([b0a564f](https://framagit.org/framasoft/mobilizon/-/commit/b0a564f64f72f40b6bb9560f9bc0fbea5d099fd7)), closes [#900](https://framagit.org/framasoft/mobilizon/-/issues/900)
|
||||
* **i18n:** fix Swedish translations error that prevented Participate button from showing up ([643a5b5](https://framagit.org/framasoft/mobilizon/-/commit/643a5b5921f91fed6a9f674c0ab3a36bf2d05835)), closes [#1281](https://framagit.org/framasoft/mobilizon/-/issues/1281)
|
||||
* **rich media:** fix error handling when resource preview URL leads to empty parsed data ([850b4e2](https://framagit.org/framasoft/mobilizon/-/commit/850b4e2a735e335c4737caa8b60e190613e778ef)), closes [#1279](https://framagit.org/framasoft/mobilizon/-/issues/1279)
|
||||
* **sharepostmodal:** only show the share warning message if the post is accessible by link ([8e626dc](https://framagit.org/framasoft/mobilizon/-/commit/8e626dce7807640a89770e50ca2621d34d6a5d97))
|
||||
* **apps:** fix device flow authorization process ([9a457fb](https://framagit.org/framasoft/mobilizon/commits/9a457fb011b77b27dc465f1bc7327a08f554ccfb))
|
||||
* **apps:** fix typo in redirect_uri parameter ([5664625](https://framagit.org/framasoft/mobilizon/commits/5664625c1c57ccba947400475414c1301d4bf955))
|
||||
* **apps:** show scope from device activation in authorize device view ([c9d2074](https://framagit.org/framasoft/mobilizon/commits/c9d20748a4dd3e0687515f4776335d0ec9bdfcdc))
|
||||
* **front:** fix homepage event and groups cards snapping ([8809db5](https://framagit.org/framasoft/mobilizon/commits/8809db582ccf45fcd477f46dcf70e106720626a8))
|
||||
* **front:** fix selecting addresses in autocomplete ([e0488dd](https://framagit.org/framasoft/mobilizon/commits/e0488dd87ffc0184162a2ff67a13717e6263d56d))
|
||||
* include user role in moderator role ([c4d6019](https://framagit.org/framasoft/mobilizon/-/commit/c4d60194a6900a3f9430355c5fbb346d910e4df6))
|
||||
|
||||
|
||||
## 3.1.0-rc.2 (2023-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
@ -20,36 +107,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
### Bug Fixes
|
||||
|
||||
* **discussionlistitem:** remove unecessary parameter in vue router target ([779812c](https://framagit.org/framasoft/mobilizon/-/commit779812c746cf722dd86bcc0ad3bc58e558c13223))
|
||||
* **emails:** make sure group notification emails are only sent once per email ([927e95f](https://framagit.org/framasoft/mobilizon/-/commit927e95f387653c7d620e9051c30843ba49c2d65c))
|
||||
* **frontend:** event edition UI improvements ([0e14a36](https://framagit.org/framasoft/mobilizon/-/commit0e14a36c6d30ebe386b2136d29539f3b3e914efc))
|
||||
* **frontend:** only show map on event edition when we have an address or we want to put in details ([02867e6](https://framagit.org/framasoft/mobilizon/-/commit02867e6e1482ac8770f94fd2bd00174bb31fbdc7))
|
||||
* **front:** fix showing current group avatar & banners ([20b4aaa](https://framagit.org/framasoft/mobilizon/-/commit20b4aaabc97080e85cb68fd03393379c7ef82d95))
|
||||
* **front:** fix showing current identity avatar & banners ([d0f4721](https://framagit.org/framasoft/mobilizon/-/commitd0f4721925d0c50340d6db8a4e9f4d3e4ca01457))
|
||||
* **front:** improve UI of the glossary page ([d47b69d](https://framagit.org/framasoft/mobilizon/-/commitd47b69d6caa7c4405ab2e573ba407f9b2450c3bb))
|
||||
* **front:** increase padding next to arrow down in `<select>` elements ([94f186c](https://framagit.org/framasoft/mobilizon/-/commit94f186ce5080316cd633e0344651b0050c2f14d4))
|
||||
* **front:** remove cache-only for ABOUT GraphQL details on homepage ([6858bcb](https://framagit.org/framasoft/mobilizon/-/commit6858bcbbda6d8527bd15b9138e7bb30c5ead72d7))
|
||||
* **front:** remove leftover console.logs ([6da0dba](https://framagit.org/framasoft/mobilizon/-/commit6da0dba0fd6d071ce5978802104538d0c2ef7dae))
|
||||
* **front:** reset page number to 1 when search criteria changes ([d73bafe](https://framagit.org/framasoft/mobilizon/-/commitd73bafec97cd7d8eda887d21870427262befab0f)), closes [#1272](https://framagit.org/framasoft/mobilizon/-/issues/1272)
|
||||
* **front:** various UI improvements for group page ([b097567](https://framagit.org/framasoft/mobilizon/-/commitb0975672c1c06ace364cf47bfcfa39db9c3b712b))
|
||||
* **graphql:** fix calling GET_GROUP ([2933ee0](https://framagit.org/framasoft/mobilizon/-/commit2933ee06791a24dbf8c8b2a2eabc67f71e56f361))
|
||||
* **group:** rephrase "Public Page" to "Announcements", as all posts are not necessary public ([b0a564f](https://framagit.org/framasoft/mobilizon/-/commitb0a564f64f72f40b6bb9560f9bc0fbea5d099fd7)), closes [#900](https://framagit.org/framasoft/mobilizon/-/issues/900)
|
||||
* **i18n:** fix Swedish translations error that prevented Participate button from showing up ([643a5b5](https://framagit.org/framasoft/mobilizon/-/commit643a5b5921f91fed6a9f674c0ab3a36bf2d05835)), closes [#1281](https://framagit.org/framasoft/mobilizon/-/issues/1281)
|
||||
* **rich media:** fix error handling when resource preview URL leads to empty parsed data ([850b4e2](https://framagit.org/framasoft/mobilizon/-/commit850b4e2a735e335c4737caa8b60e190613e778ef)), closes [#1279](https://framagit.org/framasoft/mobilizon/-/issues/1279)
|
||||
* **sharepostmodal:** only show the share warning message if the post is accessible by link ([8e626dc](https://framagit.org/framasoft/mobilizon/-/commit8e626dce7807640a89770e50ca2621d34d6a5d97))
|
||||
* **discussionlistitem:** remove unecessary parameter in vue router target ([779812c](https://framagit.org/framasoft/mobilizon/-/commit/779812c746cf722dd86bcc0ad3bc58e558c13223))
|
||||
* **emails:** make sure group notification emails are only sent once per email ([927e95f](https://framagit.org/framasoft/mobilizon/-/commit/927e95f387653c7d620e9051c30843ba49c2d65c))
|
||||
* **frontend:** event edition UI improvements ([0e14a36](https://framagit.org/framasoft/mobilizon/-/commit/0e14a36c6d30ebe386b2136d29539f3b3e914efc))
|
||||
* **frontend:** only show map on event edition when we have an address or we want to put in details ([02867e6](https://framagit.org/framasoft/mobilizon/-/commit/02867e6e1482ac8770f94fd2bd00174bb31fbdc7))
|
||||
* **front:** fix showing current group avatar & banners ([20b4aaa](https://framagit.org/framasoft/mobilizon/-/commit/20b4aaabc97080e85cb68fd03393379c7ef82d95))
|
||||
* **front:** fix showing current identity avatar & banners ([d0f4721](https://framagit.org/framasoft/mobilizon/-/commit/d0f4721925d0c50340d6db8a4e9f4d3e4ca01457))
|
||||
* **front:** improve UI of the glossary page ([d47b69d](https://framagit.org/framasoft/mobilizon/-/commit/d47b69d6caa7c4405ab2e573ba407f9b2450c3bb))
|
||||
* **front:** increase padding next to arrow down in `<select>` elements ([94f186c](https://framagit.org/framasoft/mobilizon/-/commit/94f186ce5080316cd633e0344651b0050c2f14d4))
|
||||
* **front:** remove cache-only for ABOUT GraphQL details on homepage ([6858bcb](https://framagit.org/framasoft/mobilizon/-/commit/6858bcbbda6d8527bd15b9138e7bb30c5ead72d7))
|
||||
* **front:** remove leftover console.logs ([6da0dba](https://framagit.org/framasoft/mobilizon/-/commit/6da0dba0fd6d071ce5978802104538d0c2ef7dae))
|
||||
* **front:** reset page number to 1 when search criteria changes ([d73bafe](https://framagit.org/framasoft/mobilizon/-/commit/d73bafec97cd7d8eda887d21870427262befab0f)), closes [#1272](https://framagit.org/framasoft/mobilizon/-/issues/1272)
|
||||
* **front:** various UI improvements for group page ([b097567](https://framagit.org/framasoft/mobilizon/-/commit/b0975672c1c06ace364cf47bfcfa39db9c3b712b))
|
||||
* **graphql:** fix calling GET_GROUP ([2933ee0](https://framagit.org/framasoft/mobilizon/-/commit/2933ee06791a24dbf8c8b2a2eabc67f71e56f361))
|
||||
* **group:** rephrase "Public Page" to "Announcements", as all posts are not necessary public ([b0a564f](https://framagit.org/framasoft/mobilizon/-/commit/b0a564f64f72f40b6bb9560f9bc0fbea5d099fd7)), closes [#900](https://framagit.org/framasoft/mobilizon/-/issues/900)
|
||||
* **i18n:** fix Swedish translations error that prevented Participate button from showing up ([643a5b5](https://framagit.org/framasoft/mobilizon/-/commit/643a5b5921f91fed6a9f674c0ab3a36bf2d05835)), closes [#1281](https://framagit.org/framasoft/mobilizon/-/issues/1281)
|
||||
* **rich media:** fix error handling when resource preview URL leads to empty parsed data ([850b4e2](https://framagit.org/framasoft/mobilizon/-/commit/850b4e2a735e335c4737caa8b60e190613e778ef)), closes [#1279](https://framagit.org/framasoft/mobilizon/-/issues/1279)
|
||||
* **sharepostmodal:** only show the share warning message if the post is accessible by link ([8e626dc](https://framagit.org/framasoft/mobilizon/-/commit/8e626dce7807640a89770e50ca2621d34d6a5d97))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **front:** improve padding on event tags ([7fa452d](https://framagit.org/framasoft/mobilizon/-/commit7fa452d9e3f9bb2443e571c9a32eaed51e32480a))
|
||||
* **front:** make admin profile view linkable directly with parameters ([08ce7e2](https://framagit.org/framasoft/mobilizon/-/commit08ce7e26b73045279261ab87a14cb4f3dab5df1e))
|
||||
* **front:** make profile members link to profile on group admin view and the reverse ([96129d2](https://framagit.org/framasoft/mobilizon/-/commit96129d2339133027220d3b5fcb1c52f84bcc5cbb))
|
||||
* **front:** make profiles and group admin views default to local ([3e0324d](https://framagit.org/framasoft/mobilizon/-/commit3e0324d36ec5a8aa388e6b5d598a6f9a0c596797))
|
||||
* **front:** redirect user to homepage on disconnect when currently on private page ([d5a6df9](https://framagit.org/framasoft/mobilizon/-/commitd5a6df9940fb458c5dbaee149015c02ebc370c6b)), closes [#1278](https://framagit.org/framasoft/mobilizon/-/issues/1278)
|
||||
* **front:** show skeleton content on event view until the event is loaded ([dc3b93f](https://framagit.org/framasoft/mobilizon/-/commitdc3b93ffb5a4b072aec792533fd6e4b58ed7a893))
|
||||
* **i18n:** activate croatian language ([94182ae](https://framagit.org/framasoft/mobilizon/-/commit94182aed2d8a22d00534f6376dfda2658bc8ba7e))
|
||||
* **i18n:** activate japanese language ([6bd8034](https://framagit.org/framasoft/mobilizon/-/commit6bd8034fe816a432c3547de6d1ad8a18e73dc314)), closes [#1293](https://framagit.org/framasoft/mobilizon/-/issues/1293)
|
||||
* **post:** show post visibily in PostListItem component ([ec7ca4d](https://framagit.org/framasoft/mobilizon/-/commitec7ca4ddf18a38cf6f51d38b540eecc9858f3c98))
|
||||
* **front:** improve padding on event tags ([7fa452d](https://framagit.org/framasoft/mobilizon/-/commit/7fa452d9e3f9bb2443e571c9a32eaed51e32480a))
|
||||
* **front:** make admin profile view linkable directly with parameters ([08ce7e2](https://framagit.org/framasoft/mobilizon/-/commit/08ce7e26b73045279261ab87a14cb4f3dab5df1e))
|
||||
* **front:** make profile members link to profile on group admin view and the reverse ([96129d2](https://framagit.org/framasoft/mobilizon/-/commit/96129d2339133027220d3b5fcb1c52f84bcc5cbb))
|
||||
* **front:** make profiles and group admin views default to local ([3e0324d](https://framagit.org/framasoft/mobilizon/-/commit/3e0324d36ec5a8aa388e6b5d598a6f9a0c596797))
|
||||
* **front:** redirect user to homepage on disconnect when currently on private page ([d5a6df9](https://framagit.org/framasoft/mobilizon/-/commit/d5a6df9940fb458c5dbaee149015c02ebc370c6b)), closes [#1278](https://framagit.org/framasoft/mobilizon/-/issues/1278)
|
||||
* **front:** show skeleton content on event view until the event is loaded ([dc3b93f](https://framagit.org/framasoft/mobilizon/-/commit/dc3b93ffb5a4b072aec792533fd6e4b58ed7a893))
|
||||
* **i18n:** activate croatian language ([94182ae](https://framagit.org/framasoft/mobilizon/-/commit/94182aed2d8a22d00534f6376dfda2658bc8ba7e))
|
||||
* **i18n:** activate japanese language ([6bd8034](https://framagit.org/framasoft/mobilizon/-/commit/6bd8034fe816a432c3547de6d1ad8a18e73dc314)), closes [#1293](https://framagit.org/framasoft/mobilizon/-/issues/1293)
|
||||
* **post:** show post visibily in PostListItem component ([ec7ca4d](https://framagit.org/framasoft/mobilizon/-/commit/ec7ca4ddf18a38cf6f51d38b540eecc9858f3c98))
|
||||
|
||||
|
||||
## 3.1.0-beta.2 (2023-05-23)
|
||||
|
|
|
@ -377,6 +377,8 @@ config :mobilizon, Mobilizon.Service.GlobalSearch.SearchMobilizon,
|
|||
img_src: ["search.joinmobilizon.org"]
|
||||
]
|
||||
|
||||
config :mobilizon, Mobilizon.Service.AntiSpam, service: Mobilizon.Service.AntiSpam.Akismet
|
||||
|
||||
# Import environment specific config. This must remain at the bottom
|
||||
# of this file so it overrides the configuration defined above.
|
||||
import_config "#{config_env()}.exs"
|
||||
|
|
|
@ -90,6 +90,8 @@ config :junit_formatter, report_dir: "."
|
|||
|
||||
config :mobilizon, :http_security, report_uri: "https://endpoint.com"
|
||||
|
||||
config :mobilizon, Mobilizon.Service.AntiSpam, service: Mobilizon.Service.AntiSpam.Mock
|
||||
|
||||
if System.get_env("DOCKER", "false") == "false" && File.exists?("./config/test.secret.exs") do
|
||||
import_config "test.secret.exs"
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mobilizon",
|
||||
"version": "3.1.0-rc.2",
|
||||
"version": "3.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
|
|
@ -8,7 +8,7 @@ defmodule Mobilizon.GraphQL.API.Reports do
|
|||
alias Mobilizon.Federation.ActivityPub.{Actions, Activity}
|
||||
alias Mobilizon.Reports, as: ReportsAction
|
||||
alias Mobilizon.Reports.{Note, Report, ReportStatus}
|
||||
alias Mobilizon.Service.Akismet
|
||||
alias Mobilizon.Service.AntiSpam.Akismet
|
||||
alias Mobilizon.Users.User
|
||||
import Mobilizon.Web.Gettext, only: [dgettext: 2]
|
||||
require Logger
|
||||
|
|
|
@ -7,7 +7,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Comment do
|
|||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Discussions.Comment, as: CommentModel
|
||||
alias Mobilizon.Events.{Event, EventOptions}
|
||||
alias Mobilizon.Service.Akismet
|
||||
alias Mobilizon.Service.AntiSpam
|
||||
alias Mobilizon.Users.User
|
||||
import Mobilizon.Web.Gettext
|
||||
|
||||
|
@ -45,14 +45,14 @@ defmodule Mobilizon.GraphQL.Resolvers.Comment do
|
|||
if comment_moderation != :closed || actor_id == organizer_actor_id do
|
||||
args = Map.put(args, :actor_id, actor_id)
|
||||
|
||||
if Akismet.check_comment(
|
||||
if AntiSpam.service().check_comment(
|
||||
args.text,
|
||||
preferred_username,
|
||||
!is_nil(Map.get(args, :in_reply_to_comment_id)),
|
||||
email,
|
||||
current_ip,
|
||||
user_agent
|
||||
) do
|
||||
) == :ham do
|
||||
do_create_comment(args)
|
||||
else
|
||||
{:error,
|
||||
|
|
|
@ -5,7 +5,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Config do
|
|||
|
||||
alias Mobilizon.Config
|
||||
alias Mobilizon.Events.Categories
|
||||
alias Mobilizon.Service.{Akismet, FrontEndAnalytics}
|
||||
alias Mobilizon.Service.{AntiSpam, FrontEndAnalytics}
|
||||
|
||||
@doc """
|
||||
Gets config.
|
||||
|
@ -146,7 +146,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Config do
|
|||
features: %{
|
||||
groups: Config.instance_group_feature_enabled?(),
|
||||
event_creation: Config.instance_event_creation_enabled?(),
|
||||
antispam: Akismet.ready?()
|
||||
antispam: AntiSpam.service().ready?()
|
||||
},
|
||||
restrictions: %{
|
||||
only_admin_can_create_groups: Config.only_admin_can_create_groups?(),
|
||||
|
|
|
@ -13,7 +13,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Event do
|
|||
|
||||
alias Mobilizon.Federation.ActivityPub.Activity
|
||||
alias Mobilizon.Federation.ActivityPub.Permission
|
||||
alias Mobilizon.Service.Akismet
|
||||
alias Mobilizon.Service.AntiSpam
|
||||
alias Mobilizon.Service.TimezoneDetector
|
||||
import Mobilizon.Users.Guards, only: [is_moderator: 1]
|
||||
import Mobilizon.Web.Gettext
|
||||
|
@ -260,7 +260,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Event do
|
|||
args |> Map.put(:organizer_actor, organizer_actor) |> extract_timezone(user.id),
|
||||
{:askismet, :ham} <-
|
||||
{:askismet,
|
||||
Akismet.check_event(
|
||||
AntiSpam.service().check_event(
|
||||
args.description,
|
||||
organizer_actor.preferred_username,
|
||||
email,
|
||||
|
|
|
@ -8,7 +8,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Person do
|
|||
alias Mobilizon.{Actors, Events, Users}
|
||||
alias Mobilizon.Actors.{Actor, Follower, Member}
|
||||
alias Mobilizon.Events.Participant
|
||||
alias Mobilizon.Service.Akismet
|
||||
alias Mobilizon.Service.AntiSpam
|
||||
alias Mobilizon.Storage.{Page, Repo}
|
||||
alias Mobilizon.Users.User
|
||||
import Mobilizon.Web.Gettext
|
||||
|
@ -133,18 +133,20 @@ defmodule Mobilizon.GraphQL.Resolvers.Person do
|
|||
def create_person(
|
||||
_parent,
|
||||
%{preferred_username: _preferred_username} = args,
|
||||
%{context: %{current_user: user}} = _resolution
|
||||
%{context: %{current_user: user} = context} = _resolution
|
||||
) do
|
||||
args = Map.put(args, :user_id, user.id)
|
||||
user_agent = Map.get(context, :user_agent, "")
|
||||
|
||||
with args <- Map.update(args, :preferred_username, "", &String.downcase/1),
|
||||
{:akismet, :ham} <-
|
||||
{:akismet,
|
||||
Akismet.check_profile(
|
||||
{:spam, :ham} <-
|
||||
{:spam,
|
||||
AntiSpam.service().check_profile(
|
||||
args.preferred_username,
|
||||
args.summary,
|
||||
user.email,
|
||||
user.current_sign_in_ip
|
||||
user.current_sign_in_ip,
|
||||
user_agent
|
||||
)},
|
||||
{:picture, args} when is_map(args) <- {:picture, save_attached_pictures(args)},
|
||||
{:ok, %Actor{} = new_person} <- Actors.new_person(args) do
|
||||
|
@ -308,9 +310,9 @@ defmodule Mobilizon.GraphQL.Resolvers.Person do
|
|||
{:ok, %User{} = user} ->
|
||||
if is_nil(Users.get_actor_for_user(user)) do
|
||||
# No profile yet, we can create one
|
||||
with {:akismet, :ham} <-
|
||||
{:akismet,
|
||||
Akismet.check_profile(
|
||||
with {:spam, :ham} <-
|
||||
{:spam,
|
||||
AntiSpam.service().check_profile(
|
||||
args.preferred_username,
|
||||
args.summary,
|
||||
args.email,
|
||||
|
@ -326,7 +328,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Person do
|
|||
{:error, _err} ->
|
||||
{:error, dgettext("errors", "Error while uploading pictures")}
|
||||
|
||||
{:akismet, _} ->
|
||||
{:spam, _} ->
|
||||
{:error, dgettext("errors", "Your profile was detected as spam.")}
|
||||
end
|
||||
else
|
||||
|
|
|
@ -8,7 +8,7 @@ defmodule Mobilizon.GraphQL.Resolvers.User do
|
|||
alias Mobilizon.{Actors, Admin, Config, Events, FollowedGroupActivity, Users}
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Federation.ActivityPub.Actions
|
||||
alias Mobilizon.Service.Akismet
|
||||
alias Mobilizon.Service.AntiSpam
|
||||
alias Mobilizon.Service.Auth.Authenticator
|
||||
alias Mobilizon.Storage.{Page, Repo}
|
||||
alias Mobilizon.Users.{Setting, User}
|
||||
|
@ -161,8 +161,8 @@ defmodule Mobilizon.GraphQL.Resolvers.User do
|
|||
with {:ok, email} <- lowercase_domain(email),
|
||||
:registration_ok <- check_registration_config(email),
|
||||
:not_deny_listed <- check_registration_denylist(email),
|
||||
{:akismet, :ham} <-
|
||||
{:akismet, Akismet.check_user(email, current_ip, user_agent)},
|
||||
{:spam, :ham} <-
|
||||
{:spam, AntiSpam.service().check_user(email, current_ip, user_agent)},
|
||||
{:ok, %User{} = user} <-
|
||||
args
|
||||
|> Map.merge(%{email: email, current_sign_in_ip: current_ip, current_sign_in_at: now})
|
||||
|
@ -186,7 +186,7 @@ defmodule Mobilizon.GraphQL.Resolvers.User do
|
|||
"Your e-mail has been denied registration or uses a disallowed e-mail provider"
|
||||
)}
|
||||
|
||||
{:akismet, _} ->
|
||||
{:spam, _} ->
|
||||
{:error,
|
||||
dgettext(
|
||||
"errors",
|
||||
|
|
|
@ -6,7 +6,7 @@ defmodule Mix.Tasks.Mobilizon.Maintenance.DetectSpam do
|
|||
alias Mobilizon.{Actors, Config, Events, Users}
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Events.Event
|
||||
alias Mobilizon.Service.Akismet
|
||||
alias Mobilizon.Service.AntiSpam
|
||||
import Mix.Tasks.Mobilizon.Common
|
||||
alias Mobilizon.Federation.ActivityPub.Actions
|
||||
alias Mobilizon.Web.Endpoint
|
||||
|
@ -23,24 +23,29 @@ defmodule Mix.Tasks.Mobilizon.Maintenance.DetectSpam do
|
|||
dry_run: :boolean,
|
||||
verbose: :boolean,
|
||||
forward_reports: :boolean,
|
||||
local_only: :boolean
|
||||
local_only: :boolean,
|
||||
only_profiles: :boolean,
|
||||
only_events: :boolean
|
||||
],
|
||||
aliases: [
|
||||
d: :dry_run,
|
||||
v: :verbose,
|
||||
f: :forward_reports,
|
||||
l: :local_only
|
||||
l: :local_only,
|
||||
p: :only_profiles,
|
||||
e: :only_events
|
||||
]
|
||||
)
|
||||
|
||||
start_mobilizon()
|
||||
|
||||
unless Akismet.ready?() do
|
||||
unless anti_spam().ready?() do
|
||||
shell_error("Akismet is missing an API key in the configuration")
|
||||
end
|
||||
|
||||
anonymous_actor_id = Config.anonymous_actor_id()
|
||||
|
||||
unless only_events?(options) do
|
||||
options
|
||||
|> Keyword.get(:local_only, false)
|
||||
|> profiles()
|
||||
|
@ -49,7 +54,9 @@ defmodule Mix.Tasks.Mobilizon.Maintenance.DetectSpam do
|
|||
process_profile(profile, Keyword.put(options, :anonymous_actor_id, anonymous_actor_id))
|
||||
end)
|
||||
|> Stream.run()
|
||||
end
|
||||
|
||||
unless only_profiles?(options) do
|
||||
options
|
||||
|> Keyword.get(:local_only, false)
|
||||
|> events()
|
||||
|
@ -59,6 +66,7 @@ defmodule Mix.Tasks.Mobilizon.Maintenance.DetectSpam do
|
|||
end)
|
||||
|> Stream.run()
|
||||
end
|
||||
end
|
||||
|
||||
defp profiles(local_only) do
|
||||
shell_info("Starting scanning of profiles")
|
||||
|
@ -79,7 +87,7 @@ defmodule Mix.Tasks.Mobilizon.Maintenance.DetectSpam do
|
|||
email = if(is_nil(user), do: nil, else: user.email)
|
||||
ip = if(is_nil(user), do: nil, else: user.current_sign_in_ip || user.last_sign_in_ip)
|
||||
|
||||
case Akismet.check_profile(preferred_username, summary, email, ip) do
|
||||
case anti_spam().check_profile(preferred_username, summary, email, ip, nil) do
|
||||
res when res in [:spam, :discard] ->
|
||||
handle_spam_profile(preferred_username, id, options)
|
||||
|
||||
|
@ -113,7 +121,13 @@ defmodule Mix.Tasks.Mobilizon.Maintenance.DetectSpam do
|
|||
{nil, nil}
|
||||
end
|
||||
|
||||
case Akismet.check_event(event_description, organizer_actor.preferred_username, email, ip) do
|
||||
case anti_spam().check_event(
|
||||
event_description,
|
||||
organizer_actor.preferred_username,
|
||||
email,
|
||||
ip,
|
||||
nil
|
||||
) do
|
||||
res when res in [:spam, :discard] ->
|
||||
handle_spam_event(event_id, title, uuid, organizer_actor.id, options)
|
||||
|
||||
|
@ -174,4 +188,8 @@ defmodule Mix.Tasks.Mobilizon.Maintenance.DetectSpam do
|
|||
|
||||
defp verbose?(options), do: Keyword.get(options, :verbose, false)
|
||||
defp dry_run?(options), do: Keyword.get(options, :dry_run, false)
|
||||
defp only_profiles?(options), do: Keyword.get(options, :only_profiles, false)
|
||||
defp only_events?(options), do: Keyword.get(options, :only_events, false)
|
||||
|
||||
defp anti_spam, do: AntiSpam.service()
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
defmodule Mobilizon.Service.Akismet do
|
||||
defmodule Mobilizon.Service.AntiSpam.Akismet do
|
||||
@moduledoc """
|
||||
Validate user data
|
||||
"""
|
||||
|
@ -9,12 +9,16 @@ defmodule Mobilizon.Service.Akismet do
|
|||
alias Mobilizon.Discussions.Comment
|
||||
alias Mobilizon.Events.Event
|
||||
alias Mobilizon.Reports.Report
|
||||
alias Mobilizon.Service.AntiSpam.Provider
|
||||
alias Mobilizon.Users.User
|
||||
alias Mobilizon.Web.Endpoint
|
||||
require Logger
|
||||
|
||||
@behaviour Provider
|
||||
|
||||
@env Application.compile_env(:mobilizon, :env)
|
||||
|
||||
@impl Provider
|
||||
@spec check_user(String.t(), String.t(), String.t()) ::
|
||||
:ham | :spam | :discard | {:error, HTTPoison.Response.t()}
|
||||
def check_user(email, ip, user_agent) do
|
||||
|
@ -27,6 +31,7 @@ defmodule Mobilizon.Service.Akismet do
|
|||
})
|
||||
end
|
||||
|
||||
@impl Provider
|
||||
@spec check_profile(String.t(), String.t(), String.t() | nil, String.t(), String.t()) ::
|
||||
:ham | :spam | :discard | {:error, HTTPoison.Response.t()}
|
||||
def check_profile(username, summary, email \\ nil, ip \\ "127.0.0.1", user_agent \\ nil) do
|
||||
|
@ -41,6 +46,7 @@ defmodule Mobilizon.Service.Akismet do
|
|||
})
|
||||
end
|
||||
|
||||
@impl Provider
|
||||
@spec check_event(String.t(), String.t(), String.t() | nil, String.t(), String.t()) ::
|
||||
:ham | :spam | :discard | {:error, HTTPoison.Response.t()}
|
||||
def check_event(event_body, username, email \\ nil, ip \\ "127.0.0.1", user_agent \\ nil) do
|
||||
|
@ -55,6 +61,7 @@ defmodule Mobilizon.Service.Akismet do
|
|||
})
|
||||
end
|
||||
|
||||
@impl Provider
|
||||
@spec check_comment(String.t(), String.t(), boolean(), String.t() | nil, String.t(), String.t()) ::
|
||||
:ham | :spam | :discard | {:error, HTTPoison.Response.t()}
|
||||
def check_comment(
|
||||
|
@ -108,6 +115,7 @@ defmodule Mobilizon.Service.Akismet do
|
|||
Application.get_env(:mobilizon, __MODULE__) |> get_in([:key])
|
||||
end
|
||||
|
||||
@impl Provider
|
||||
def ready?, do: !is_nil(api_key())
|
||||
|
||||
@spec report_to_akismet_comment(Report.t()) :: AkismetComment.t() | {:error, atom()}
|
17
lib/service/anti_spam/anti_spam.ex
Normal file
17
lib/service/anti_spam/anti_spam.ex
Normal file
|
@ -0,0 +1,17 @@
|
|||
defmodule Mobilizon.Service.AntiSpam do
|
||||
@moduledoc """
|
||||
Module to load the service adapter defined inside the configuration.
|
||||
|
||||
See `Mobilizon.Service.AntiSpam.Provider`.
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Returns the appropriate service adapter.
|
||||
|
||||
According to the config behind
|
||||
`config :mobilizon, Mobilizon.Service.AntiSpam,
|
||||
service: Mobilizon.Service.AntiSpam.Module`
|
||||
"""
|
||||
@spec service :: module
|
||||
def service, do: get_in(Application.get_env(:mobilizon, __MODULE__), [:service])
|
||||
end
|
58
lib/service/anti_spam/provider.ex
Normal file
58
lib/service/anti_spam/provider.ex
Normal file
|
@ -0,0 +1,58 @@
|
|||
defmodule Mobilizon.Service.AntiSpam.Provider do
|
||||
@moduledoc """
|
||||
Provider Behaviour for anti-spam detection.
|
||||
|
||||
## Supported backends
|
||||
|
||||
* `Mobilizon.Service.AntiSpam.Akismet` [🔗](https://akismet.com/)
|
||||
|
||||
"""
|
||||
|
||||
@type spam_result :: :ham | :spam | :discard
|
||||
@type result :: spam_result() | {:error, any()}
|
||||
|
||||
@doc """
|
||||
Make sure the provider is ready
|
||||
"""
|
||||
@callback ready?() :: boolean()
|
||||
|
||||
@doc """
|
||||
Check an user details
|
||||
"""
|
||||
@callback check_user(email :: String.t(), ip :: String.t(), user_agent :: String.t()) ::
|
||||
result()
|
||||
|
||||
@doc """
|
||||
Check a profile details
|
||||
"""
|
||||
@callback check_profile(
|
||||
username :: String.t(),
|
||||
summary :: String.t(),
|
||||
email :: String.t() | nil,
|
||||
ip :: String.t(),
|
||||
user_agent :: String.t() | nil
|
||||
) :: result()
|
||||
|
||||
@doc """
|
||||
Check an event details
|
||||
"""
|
||||
@callback check_event(
|
||||
event_body :: String.t(),
|
||||
username :: String.t(),
|
||||
email :: String.t() | nil,
|
||||
ip :: String.t(),
|
||||
user_agent :: String.t() | nil
|
||||
) :: result()
|
||||
|
||||
@doc """
|
||||
Check a comment details
|
||||
"""
|
||||
@callback check_comment(
|
||||
comment_body :: String.t(),
|
||||
username :: String.t(),
|
||||
is_reply? :: boolean(),
|
||||
email :: String.t() | nil,
|
||||
ip :: String.t(),
|
||||
user_agent :: String.t() | nil
|
||||
) :: result()
|
||||
end
|
|
@ -52,7 +52,7 @@ defmodule Mobilizon.Service.GlobalSearch.SearchMobilizon do
|
|||
start: (Keyword.get(options, :page, 1) - 1) * Keyword.get(options, :limit, 16),
|
||||
latlon: to_lat_lon(options[:location]),
|
||||
bbox: options[:bbox],
|
||||
sortBy: Map.get(@sort_by_options, options[:sort_by]),
|
||||
sort: Map.get(@sort_by_options, options[:sort_by]),
|
||||
boostLanguages: options[:boost_languages]
|
||||
)
|
||||
|> Keyword.take([
|
||||
|
@ -68,8 +68,7 @@ defmodule Mobilizon.Service.GlobalSearch.SearchMobilizon do
|
|||
:statusOneOf,
|
||||
:bbox,
|
||||
:start,
|
||||
:count,
|
||||
:sortBy
|
||||
:count
|
||||
])
|
||||
|> Keyword.reject(fn {_key, val} -> is_nil(val) or val == "" end)
|
||||
|
||||
|
@ -104,7 +103,7 @@ defmodule Mobilizon.Service.GlobalSearch.SearchMobilizon do
|
|||
start: (options[:page] - 1) * options[:limit],
|
||||
latlon: to_lat_lon(options[:location]),
|
||||
bbox: options[:bbox],
|
||||
sortBy: Map.get(@sort_by_options, options[:sort_by])
|
||||
sort: Map.get(@sort_by_options, options[:sort_by])
|
||||
)
|
||||
|> Keyword.take([
|
||||
:search,
|
||||
|
@ -115,8 +114,7 @@ defmodule Mobilizon.Service.GlobalSearch.SearchMobilizon do
|
|||
:sort,
|
||||
:start,
|
||||
:count,
|
||||
:bbox,
|
||||
:sortBy
|
||||
:bbox
|
||||
])
|
||||
|> Keyword.reject(fn {_key, val} -> is_nil(val) or val == "" end)
|
||||
|
||||
|
|
2
mix.exs
2
mix.exs
|
@ -1,7 +1,7 @@
|
|||
defmodule Mobilizon.Mixfile do
|
||||
use Mix.Project
|
||||
|
||||
@version "3.1.0-rc.2"
|
||||
@version "3.1.0"
|
||||
|
||||
def project do
|
||||
[
|
||||
|
|
26
test/support/mocks/anti_spam_mock.ex
Normal file
26
test/support/mocks/anti_spam_mock.ex
Normal file
|
@ -0,0 +1,26 @@
|
|||
defmodule Mobilizon.Service.AntiSpam.Mock do
|
||||
@moduledoc """
|
||||
Mock for Anti-spam Provider implementations.
|
||||
"""
|
||||
|
||||
alias Mobilizon.Service.AntiSpam.Provider
|
||||
|
||||
@behaviour Provider
|
||||
|
||||
@impl Provider
|
||||
def ready?, do: true
|
||||
|
||||
@impl Provider
|
||||
def check_user(_email, _ip, _user_agent), do: :ham
|
||||
|
||||
@impl Provider
|
||||
def check_profile("spam", _summary, _email, _ip, _user_agent), do: :spam
|
||||
def check_profile(_preferred_username, _summary, _email, _ip, _user_agent), do: :ham
|
||||
|
||||
@impl Provider
|
||||
def check_event("some spam event", _username, _email, _ip, _user_agent), do: :spam
|
||||
def check_event(_event_body, _username, _email, _ip, _user_agent), do: :ham
|
||||
|
||||
@impl Provider
|
||||
def check_comment(_comment_body, _username, _is_reply?, _email, _ip, _user_agent), do: :ham
|
||||
end
|
55
test/tasks/maintenance/detect_spam_test.exs
Normal file
55
test/tasks/maintenance/detect_spam_test.exs
Normal file
|
@ -0,0 +1,55 @@
|
|||
defmodule Mix.Tasks.Mobilizon.Maintenance.DetectSpamTest do
|
||||
use Mobilizon.DataCase
|
||||
|
||||
import Mobilizon.Factory
|
||||
|
||||
alias Mix.Tasks.Mobilizon.Maintenance.DetectSpam
|
||||
|
||||
Mix.shell(Mix.Shell.Process)
|
||||
|
||||
describe "detect spam" do
|
||||
test "on all content" do
|
||||
insert(:actor, preferred_username: "ham")
|
||||
insert(:actor, preferred_username: "spam")
|
||||
insert(:event, description: "some ham event", title: "some ham event")
|
||||
spam_event = insert(:event, description: "some spam event", title: "some spam event")
|
||||
|
||||
DetectSpam.run(["-v"])
|
||||
assert_received {:mix_shell, :info, [output_received]}
|
||||
assert_received {:mix_shell, :info, [output_received2]}
|
||||
assert_received {:mix_shell, :info, [output_received3]}
|
||||
assert_received {:mix_shell, :info, [output_received4]}
|
||||
assert_received {:mix_shell, :info, [output_received5]}
|
||||
assert_received {:mix_shell, :info, [output_received6]}
|
||||
assert_received {:mix_shell, :info, [output_received7]}
|
||||
assert_received {:mix_shell, :info, [output_received8]}
|
||||
assert_received {:mix_shell, :info, [output_received9]}
|
||||
assert_received {:mix_shell, :info, [output_received10]}
|
||||
assert_received {:mix_shell, :info, [output_received11]}
|
||||
assert_received {:mix_shell, :info, [output_received12]}
|
||||
|
||||
output =
|
||||
MapSet.new([
|
||||
output_received,
|
||||
output_received2,
|
||||
output_received3,
|
||||
output_received4,
|
||||
output_received5,
|
||||
output_received6,
|
||||
output_received7,
|
||||
output_received8,
|
||||
output_received9,
|
||||
output_received10,
|
||||
output_received11,
|
||||
output_received12
|
||||
])
|
||||
|
||||
assert MapSet.member?(output, "Starting scanning of profiles")
|
||||
assert MapSet.member?(output, "Starting scanning of events")
|
||||
assert MapSet.member?(output, "Profile ham is fine")
|
||||
assert MapSet.member?(output, "Event some ham event is fine")
|
||||
assert MapSet.member?(output, "Detected profile spam as spam")
|
||||
assert MapSet.member?(output, "Detected event some spam event as spam: #{spam_event.url}")
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue