Commit Graph

4912 Commits

Author SHA1 Message Date
Diogo Cordeiro
3cac110148 [ActivityPub] Move models from 'classes' to 'lib/models' 2021-07-16 19:44:33 +01:00
tenma
ec749aa350 [ActivityPub] Fix WebFinger event subscription
ActivityPubPlugin:
- remove reference to the first argument of onEndWebFingerProfileLinks, no need
as it is an object
2021-07-16 19:44:33 +01:00
tenma
b4b5d3e009 [ActivityPub] Fix handling of Delete Activity
inbox_handler:
- Call stronger validation method for Delete Activity objects
- Take into account mixed object in handle_delete

Activitypub_delete:
- Add validation method for Delete Activity objects
2021-07-16 19:44:33 +01:00
Diogo Cordeiro
489cab0f87 [ActivityPub] This is the first release of the plugin 2021-07-16 19:44:33 +01:00
tenma
130c839adf [ActivityPub] Use queues for notice distribution
ActivityPubPlugin:
- Change event-based notice distribution to queues logic

ActivityPub/lib:
- Add queue handler class activitypubqueuehandler.php

Misc:
- Add documentation for the (Start/End)InitializeQueueManager events
2021-07-16 19:44:33 +01:00
tenma
081eec3608 [OStatus] Fix notice enqueue
OStatusPlugin:
- Enqueue in the last position, as it should be. No need to worry about
the OMB comment, this protocol no longer have queue handlers that could
cause a conflict.
2021-07-16 19:44:33 +01:00
tenma
20d101e1f2 [ActivityPub] Ensuring federation with other software
ActivityPubPlugin:
- Prevent sending a Delete for an Announce

Activitypub_announce:
- Update announce_to_array to add id, to and cc information to the retrieved object

Activitypub_follow:
- Add id to the arguments of follow_to_array, useful for Accept-Follow activities

Activitypub_notice:
- Fix notice validation, url isn't a MUST

Activitypub_inbox_handler:
- Make handle_follow use the received activity id for the later Accept-Follow

Activitypub_postman:
- Fix call to the updated announce_to_array
- Fix successive unnecessary calls to ActivityPubPlugin::actor_uri()
2021-07-16 19:44:33 +01:00
brunoccast
3472eca45b [ActivityPub] Fix notice creation
Activitypub_notice:
- Perform url test, use id when missing.
2021-07-16 19:44:33 +01:00
brunoccast
37936d101e [ActivityPub] Routes
ActivityPubPlugin:
- Update routes to properly use the updated URLMapper
2021-07-16 19:44:33 +01:00
brunoccast
9de1c34bc0 [ActivityPub] Ensuring notice deletion
ActivityPubPlugin:
- Minor onDeleteOwnNotice rewrite

Activitypub_inbox_handler:
- Add deletion check to incoming notice

Activitypub_postman:
- Call the correct getUrl function
2021-07-16 19:44:33 +01:00
brunoccast
87423a0191 [ActivityPub] Ensuring Notice Favor/Disfavor
ActivityPubPlugin:
- Minor re-write of favor/disfavor event handlers

Activitypub_postman:
like/undo-like:
- fix proper getUrl() call
misc:
- make all activities accumulate errors (may be needed later) and log some information about it
2021-07-16 19:44:33 +01:00
brunoccast
233bdf57ac [ActivityPub] Ensuring notice distribution
ActivityPubPlugin:
- Fix of accepted activity verbs to include SHARES
- Add attention profiles to delivery when announcing

Activitypub_notice:
- New local function to retrieve original URL
- Removal of unnecessary 'Atom*' attributes
- Small fix to the ensuring of actor profile

Activitypub_profile:
- New local function to fetch AP profiles from a collection

Activitypub_postman:
- Fix url passed in the announce activity
2021-07-16 19:44:33 +01:00
brunoccast
25390bf96f [ActivityPub] Caching of Following/Followers interactions and collections
Follow interaction:
- Fixed mini-bug where the subscriber profile was being used as the subscribed
- Updated cache subscription-related values in both instances
- Tested and working with local GS instances

Unfollow interaction:
- Updated cache subscription-related values in both instances
- Tested and working with local GS instances

Followers/Following collections:
- Now returning ActivityPub profiles only
- Stored collections in cache

Misc:
- Fix bug concerning the retrieval of public/private-key after in-function generation
2021-07-16 19:44:33 +01:00
brunoccast
90cb222af5 [ActivityPub] Routes
ActivityPubPlugin:
- Update routes to properly use URLMapper
- Minor updates
2021-07-16 19:44:33 +01:00
Diogo Cordeiro
2f1ddd8280 [CORE] Add ActivityPub plugin
This is not the same as the one in https://notabug.org/diogo/gnu-social-activitypub-plugin
Differences to the first "release"
-> Doesn't use guzzle nor has any composer dependencies
-> Supports HTTP Signatures
-> Has basic l10n/i18n
-> Some minor bug fixes
2021-07-16 19:44:33 +01:00
Miguel Dantas
6bf888b520 [PLUGINS] Dropped Memcache in favor of Memcached. The difference between these is that they use a similarly php library to interact with memcache, but memcached is more modern 2021-07-16 19:44:33 +01:00
Miguel Dantas
be1654237d [Memcached] Merged useful features from Memcache 2021-07-16 19:44:33 +01:00
Miguel Dantas
ac97efbf21 [PLUGINS] Updated and reviewed the Memcached plugin 2021-07-16 19:44:33 +01:00
Miguel Dantas
f689df3e68 [RedisCache] Added README with configuration instructions 2021-07-16 19:44:33 +01:00
Miguel Dantas
df468f9605 [RedisCache] Fix use of undefined variable 2021-07-16 19:44:33 +01:00
Miguel Dantas
d7c2c98a02 [PLUGINS] Removed direct call of EndCache events on all plugins, as it is now handled by the library 2021-07-16 19:44:33 +01:00
Miguel Dantas
d8d7abee9f [CACHING] Imported Chimo's RedisCache plugin and fixed some small parts 2021-07-16 19:44:33 +01:00
Miguel Dantas
19d68c9f8e [COMPOSER] Added predis/predis and updated packages 2021-07-16 19:44:33 +01:00
Miguel Dantas
0bb35d7e7f [LinkPreview] Fix 'no candidate for action "embedproxy"' 2019-08-14 15:32:34 +01:00
Diogo Cordeiro
e4bdb21a54 [NodeInfo] New endpoint and formula for computing active users
Seriously improved documentation
Now NodeInfo 2.0 is available at /api/nodeinfo/2.0.json
For active users we now also consider favourites and recently created accounts
Some further minor bug fixes and full review of the implementation
2019-08-12 05:35:27 +01:00
Miguel Dantas
0030fe3aeb [REFACTOR] Added explicit return type to all instances of QueueHandler::handle 2019-08-11 01:11:41 +01:00
Miguel Dantas
aaabf82eff [CORE][QUEUE] Error checking and type declaration on handling notice queue events
Patch submitted by XRevan86
2019-08-08 02:44:14 +01:00
Miguel Dantas
52310a8ad8 [Embed] Fixed error related to oembed action 2019-08-07 23:57:40 +01:00
Miguel Dantas
dbde8383c9 [Embed] Fixed use of undefined variable in fixup_files script 2019-08-03 17:49:36 +01:00
Miguel Dantas
6d552f15b6 [Embed] Resize thumbnails fetched by Embed to avoid keeping original images when we need only 128x128. Size configurable in config.php 2019-08-03 17:49:36 +01:00
Miguel Dantas
ba15724a62 [FORMAT][Embed] Ran php-cs-fixer on Embed's files and small style fixes 2019-08-03 17:49:33 +01:00
Miguel Dantas
5be705ca2a [Embed] Updated fixup_files.php script to be able to fix broken oEmbedinfo using the --broken-oembed flag 2019-08-03 17:49:10 +01:00
Miguel Dantas
07b4cfaeae [Embed] Hide error from the UI and just don't display an image if the remote image is not valid 2019-08-03 17:49:10 +01:00
Miguel Dantas
c9379b3608 [Embed] Fix bug where we we're losing track of a file, in case the image needed to be reencoded 2019-08-03 17:49:10 +01:00
Miguel Dantas
22c8c96249 [Embed] Fixed Embed tests 2019-08-03 17:49:10 +01:00
Miguel Dantas
d66828c2bf [Embed] Fixed bug where sometimes images were written outside the site root 2019-08-03 17:49:09 +01:00
Miguel Dantas
a244f3ba4d [Embed] Removed old oEmbed and OpenGraph implementation 2019-08-03 17:49:09 +01:00
Miguel Dantas
0c20d35206 [Embed] Refactoring and bug fixing 2019-08-03 17:49:09 +01:00
Miguel Dantas
462ea26303 [Embed] Using oscarotero/Embed as first attempt to get oEmbed/OpenGraph data, fallback
to previous implementation otherwise.
2019-08-03 17:49:09 +01:00
Miguel Dantas
b25632ebc4 [PLUGINS] Fixed oEmbed dependents to use Embed 2019-08-03 17:49:06 +01:00
Miguel Dantas
2a2b3f72fb [Embed][DB] Renaming the 'file_oembed' table to 'file_embed' on upgrade 2019-08-03 17:48:28 +01:00
Miguel Dantas
52819d39d9 [OEmbed][Embed] Renamed OEmbed plugin to Embed 2019-08-03 17:48:26 +01:00
Diogo Cordeiro
39845444cc [DOCUMENTATION] Update description of extlib and vendor directories 2019-08-03 17:47:27 +01:00
Daniel Supernault
9c0354bbf1 [CORE] Remove function_exists() calls and add up default bcrypt cost to 12. 2019-08-03 17:47:26 +01:00
Daniel Supernault
c09f1c2443 [CORE] Add Argon2I support
Add Argon2I support, disabled by default.
2019-08-03 17:47:25 +01:00
Daniel Supernault
912f2c3567 [CORE] Update AuthCryptPlugin
Added password_hash() (bcrypt) support with fallback to crypt() for older PHP versions.
2019-08-03 17:47:25 +01:00
Daniel Supernault
ad51998d67 [CORE] Add timing safe backwards compatible password_verify 2019-08-03 17:47:25 +01:00
Diogo Cordeiro
1049080df5 [CORE] Move public resources to a /public directory
Advantages:
* Increases security by preventing direct access to file/
* We are careful and have a defined('GNUSOCIAL') || die() to prevent
  direct access to GS files, but we may miss one or a vendor/extlib may
  not be as careful
* Improves directory structure - It's more natural to physically
  separate what is public from what are GNU social resources
2019-08-03 17:47:25 +01:00
Diogo Cordeiro
a1edc2c6a9 [CORE][COMPOSER] Move plugins extlibs to composer (where appropriate) 2019-08-03 17:47:24 +01:00
Diogo Cordeiro
2a06261f75 [CORE][COMPOSER] Move extlib packages with immediate composer correspondent to composer dependencies
This adds a composer.json for all dependencies that are available
2019-08-03 17:47:24 +01:00