Commit Graph

250 Commits

Author SHA1 Message Date
Diogo Peralta Cordeiro 496701ce73
[PLUGIN][ActivityPub][Inbox] Add event for notifications triggered by AP Inbox 2022-02-20 05:03:40 +00:00
Diogo Peralta Cordeiro 6f3e760c63
[PLUGIN][ActivityPub][Inbox] Separate handler by method 2022-02-20 05:03:40 +00:00
Diogo Peralta Cordeiro 51cccd0155
[PLUGIN][ActivityPub] Simplify DB usage 2022-02-20 05:03:40 +00:00
Diogo Peralta Cordeiro 9523927b8e
[PLUGIN][ActivityPub][Model][Note] There may be no attachments, nor tags, nor to, nor cc 2022-02-19 05:46:48 +00:00
Diogo Peralta Cordeiro ebbd8bf1e4
[PLUGIN][ActivityPub][HTTPSignatures] Fix wrong assumption that sha512 is used in hs2019 2022-02-19 04:49:50 +00:00
Diogo Peralta Cordeiro 7a59d5a002
[PLUGIN][ActivityPub][HTTPSignatures] Validate draft-cavage-http-signatures-11 2022-02-19 04:49:50 +00:00
Diogo Peralta Cordeiro 52ae5fa690
[PLUGIN][ActivityPub][Inbox] Improve logs 2022-02-19 04:49:50 +00:00
Diogo Peralta Cordeiro 99f7e7cd79
[PLUGIN][ActivityPub][Model][Note] Handle group scope properly 2022-02-19 04:49:50 +00:00
Diogo Peralta Cordeiro 27635d8ec2
[PLUGIN][ActivityPub][Model][Note] Add name property as note title 2022-02-19 04:49:49 +00:00
Diogo Peralta Cordeiro 0a741903a1
[PLUGIN][ActivityPub][Model][Note] Federate content out 2022-02-19 04:49:49 +00:00
Diogo Peralta Cordeiro 8f60fc4685
[PLUGIN][ActivityPub][Model][Note] Federate attentions out 2022-02-19 04:49:49 +00:00
Diogo Peralta Cordeiro 8cf60275e6
[PLUGIN][ActivityPub][Model][Note] Add support to Pages 2022-02-19 04:49:49 +00:00
Diogo Peralta Cordeiro b6ed0b4c6c
[CORE][Actor] Fix generic profile route 2022-02-16 18:53:08 +00:00
Eliseu Amaro e70acd5c3b
[UTIL][HTML] HTML abstraction class was extended with a more specialised Heading class
This little abstraction layer made it a bit easier to add a different title to a Note or Actor Feed Collection template, from whichever controller that uses it. Please, bear in mind, that abstract templates such as those found in Components\Collection, may act in a very 'declarative' way upon using them. This makes it difficult to dynamically choose what type of header is used without undergoing a mining operation in the likes of a pyramid of doom. Hence, this _little_ change.
2022-02-16 18:53:08 +00:00
Diogo Peralta Cordeiro bc63c3727a
[COMPONENT][GROUP] Allow to create a group as private and prioritise group scope on Posting in that context 2022-02-14 05:02:09 +00:00
Diogo Peralta Cordeiro 10d1a7ed2a
[PLUGIN][ActivityPub] Implement Group Inbox POST 2022-02-13 23:15:00 +00:00
Diogo Peralta Cordeiro 3ae8f8213f
[GROUP] Notifity group subscribers of new activity concerning the group 2022-02-13 23:15:00 +00:00
Diogo Peralta Cordeiro 66323c5a73
[PLUGIN][ActivityPub] Fix several issues with target and notifications inserted by AP 2022-02-13 23:14:59 +00:00
Diogo Peralta Cordeiro 17733f32d6
[PLUGIN][ActivityPub] Implement Group Outbox
Fix various minor issues
2022-02-11 10:06:01 +00:00
Diogo Peralta Cordeiro fb3e900b28
[CORE] Add CONFIG_ prefix to environment whitelist
Fixed minor issues with Commong:config of env not being included and ported to local social yaml

Fixed some regressions introduced with [CORE] Unset sensitive information from the environment
2022-02-11 10:05:58 +00:00
Diogo Peralta Cordeiro 416451a519
[CORE][Actor] Simplify logic so more is reused between different types of actors
Minor bug fixes
2022-02-11 00:27:03 +00:00
Diogo Peralta Cordeiro 1f1524c2b3
[GROUP] Simplify logic by making Actor::Organisation a type of Actor::Group
Some minor bug fixes
2022-02-11 00:26:43 +00:00
Diogo Peralta Cordeiro 6b1c6f603e
[CORE][ActorLocalRoles] Improve Roles 2022-01-22 18:47:56 +00:00
Diogo Peralta Cordeiro bdeb3bcff5
[PLUGIN][ActivityPub] Federate Actor of types other than Person
Fix some other minor bugs
2022-01-21 22:05:31 +00:00
Diogo Peralta Cordeiro 480f570238
[CORE][SECURITY][HTML] Refactor Security::sanitize to HTML::sanitize
Update composer dependencies, move more general deps from ActivityPub to Core
2022-01-12 17:12:58 +00:00
Diogo Peralta Cordeiro 59b8bdf99b
[PLUGIN][ActivityPub] Provide ActivityStreams 2.0 responses for every Collection
Implemented ActivityPub Outbox
2022-01-11 20:30:25 +00:00
Diogo Peralta Cordeiro 627d92b290
[COMPONENT][Tag] Improve Note Tag Handling and start extracting Circles logic out of the plugin, various bug fixes 2022-01-05 01:30:02 +00:00
Diogo Peralta Cordeiro 9ea230d12b
[COMPONENT][Subscription] Implement subscription handlers 2022-01-03 02:23:06 +00:00
Diogo Peralta Cordeiro fe087b2217
[PLUGIN][ActivityPub] Accept Undo Follow 2022-01-03 02:23:06 +00:00
Diogo Peralta Cordeiro 5fa8056899
[COMPONENT][Collection] Refactoring: Further work in abstracting collections 2022-01-03 02:18:43 +00:00
Diogo Peralta Cordeiro def5f36c25
[PLUGIN][ActivityPub][Inbox] Accept Follow Activity
Improve how Core Activity is handled in general
2022-01-02 23:50:16 +00:00
Diogo Peralta Cordeiro 046731a05a
[COMPONENT][Avatar] Save title if possible, delete correctly, no early flushes
[PLUGIN][ActivityPub] Minor bug fixes in Actor translation
2022-01-02 23:50:14 +00:00
Diogo Peralta Cordeiro 137723e59a
[PLUGIN][ActivityPub][Favourite][Repeat][Delete] Document event handlers 2021-12-28 22:57:49 +00:00
Diogo Peralta Cordeiro 1d1d169a5c
[PLUGIN][ActivityPub] Support federation of Tombstones 2021-12-28 17:10:20 +00:00
Diogo Peralta Cordeiro 9cda64f275
[COMPONENT][Notification] Use _m() in reason 2021-12-28 16:36:52 +00:00
Diogo Peralta Cordeiro 3e83387e98
[PLUGIN][DeleteNote] Support ActivityPub 2021-12-28 16:22:38 +00:00
Diogo Peralta Cordeiro 9585472679
[ENTITY][Actor] Basic check if can admin for remote actors 2021-12-28 15:38:41 +00:00
Diogo Peralta Cordeiro 80afc0fa6c
[TEMPLATES][Cards][Profile] Provide both actor uri and url, as well as full mention guidance 2021-12-27 05:08:27 +00:00
Diogo Peralta Cordeiro c4dacd7626
[COMPONENT][Attachment] Vinculate note information with attachment controllers
Various minor bug fixes
2021-12-27 04:56:00 +00:00
Hugo Sales 93276ce8d0
[AUTOGENERATED] Update autogenerated code 2021-12-27 03:06:30 +00:00
Diogo Peralta Cordeiro a1d9909379
[CORE][VisibilityScope] Use enum type instead of Bitmap 2021-12-26 19:16:56 +00:00
Hugo Sales c79b1e4c94
[AUTOGENERATED] Update auto generated code 2021-12-26 19:16:15 +00:00
Hugo Sales ec28f23025
[TOOLS] Run CS-fixer on all files 2021-12-26 19:16:15 +00:00
Diogo Peralta Cordeiro 5e42723624
[ENTITY][Note] Include reply_to's targets in child's 2021-12-26 19:16:14 +00:00
Diogo Peralta Cordeiro 91f8c86efa
[PLUGIN][ActivityPub] Support and federate scopes 2021-12-26 19:16:12 +00:00
Diogo Peralta Cordeiro d4bc1d097d
[ENTITY][NoteTag][COMPONENT][Language] Add language to NoteTag and minor corrections 2021-12-26 06:22:30 +00:00
Diogo Peralta Cordeiro 78fddaf86a
[PLUGIN][ActivityPub] Notify mentions in tags 2021-12-26 06:22:28 +00:00
Diogo Peralta Cordeiro 9d0b39e680
[PLUGIN][ActivityPub] Support tags in notes 2021-12-25 18:04:31 +00:00
Diogo Peralta Cordeiro 36483a6ecd
[COMPONENT][Link] Ignore html anchors that include mention class 2021-12-25 18:04:30 +00:00
Diogo Peralta Cordeiro e3efd25b43
[PLUGIN][ActivityPub] Fix typo in getObjectByUri 2021-12-24 02:46:45 +00:00
Diogo Peralta Cordeiro 3c79d82b80
[PLUGIN][ActivityPub][Note] Support inReplyTo 2021-12-24 02:46:39 +00:00
Diogo Peralta Cordeiro 1865d2b41e
[ActivityPub][Postman] Fill To and CC with mentions 2021-12-24 00:42:02 +00:00
Diogo Peralta Cordeiro e2c0505620
[ActivityPub][Inbox] Add request to debug logs 2021-12-21 15:52:41 +00:00
Diogo Peralta Cordeiro 1832397363
[ActivityPub] Include recent actor type attribute in its creation
Improve debug logs
2021-12-20 13:32:49 +00:00
Diogo Peralta Cordeiro a9c73a8f33
[PLUGIN][ActivityPub] Add mention tags 2021-12-20 13:32:48 +00:00
Diogo Peralta Cordeiro a005a7bcea
[PLUGIN][ActivityPub] Add getUriByObject, so that we can construct activities referring to other known objects (local or foreign) 2021-12-20 13:32:46 +00:00
Diogo Peralta Cordeiro 1d09a02ad6
[FreeNetwork][ActivityPub] Sometimes remote Actors report empty full names in not very explicit manners 2021-12-19 19:04:05 +00:00
Hugo Sales a81ac673ac
[CORE][ENTITY] Rename 'Entity::getWithPK' to 'Entity::getByPK' 2021-12-19 19:04:01 +00:00
Diogo Peralta Cordeiro 480a42cca5
[PLUGIN][ActivityPub] Introduce ActivitypubObject. Beware, inside the plugin, an Object can never be an Activity.
Many bug fixes and other major changes (interface changed, see EVENTS.md)
2021-12-08 23:24:23 +00:00
Diogo Peralta Cordeiro 330e09f2d3
[PLUGIN][ActivityPub] Only store a new object if there were no previous activities with it before 2021-12-05 21:09:30 +00:00
Diogo Peralta Cordeiro 5196b669b9
[PLUGIN][ActivityPub] Add attachment support to Notes 2021-12-05 21:04:20 +00:00
Diogo Peralta Cordeiro 19b8a7648e
[PLUGIN][ActivityPub] Implement Avatar support 2021-12-05 20:08:14 +00:00
Hugo Sales e29e1cc87c
[ENTITY] Rename 'getFrom' to 'getBy' 2021-12-05 17:55:46 +00:00
Diogo Peralta Cordeiro 9512890264
[PLUGIN][ActivityPub] Implement Actor Update
Diverse minor bug fixes
2021-12-05 03:11:08 +00:00
Diogo Peralta Cordeiro 778cb57d83
[PLUGIN][ActivityPub] Finish base ActivityStreams 2.0 interface
Instructions below

To extend an Activity properties do:

public function onActivityPubValidateActivityStreamsTwoData(string $type_name, array &$validators): bool {
    if ($type_name === '{Type}') {
        $validators['attribute'] = myValidator::class;
    }
    return Event::next;
}

The Validator should be of the form:

use ActivityPhp\Type;
use ActivityPhp\Type\Util;
use Plugin\ActivityPub\Util\ModelValidator;

class myValidator extends ModelValidator
{
    /**
     * Validate Attribute's value
     *
     * @param mixed $value from JSON's attribute
     * @param mixed $container A {Type}
     * @return bool
     * @throws Exception
     */
    public function validate($value, $container): bool
    {
        // Validate that container is a {Type}
        Util::subclassOf($container, Type\Extended\Object\{Type}::class, true);

        return {Validation Result};

To act on received activities do:

public function onActivityPubNew{Type}(&$obj): bool {

To add information to Activities being federated by ActivityPub do:

public function ActivityPubAddActivityStreamsTwoData(string $type_name, &$type): bool {

To implement an ActivityStreams 2.0 representation do:

public function onActivityPubActivityStreamsTwoResponse(string $route, arrray $vars, ?TypeResponse &$response = null): bool {
        if ($route === '{Object route}') {
                $response = ModelResponse::handle($vars[{Object}]);
                return Event::stop;
        }
        return Event::next;
}
2021-12-04 21:05:07 +00:00
Diogo Peralta Cordeiro eeaad19754
[Attachment] Move Controller and Entities to a Component
There's no problem in having the templates in the core
2021-12-02 15:14:07 +00:00
Diogo Peralta Cordeiro d044039272
[FreeNetwork] Initial multi-protocol support 2021-12-02 14:23:21 +00:00
Diogo Peralta Cordeiro dbaee08038
[FreeNetwork] Move mentions logic from AP to FN and handle local webfinger mentions properly 2021-12-02 11:12:04 +00:00
Diogo Peralta Cordeiro 53c46127c1
[ActivityPub][Explorer] Store remote's url properly 2021-12-02 11:12:03 +00:00
Diogo Peralta Cordeiro 6f543ccc06
[ActivityPub][Model][Activity] Translate including objects 2021-12-01 20:53:51 +00:00
Diogo Peralta Cordeiro 424df54a1b
[ActivityPub] Add HTTP Signatures 2021-12-01 19:47:41 +00:00
Diogo Peralta Cordeiro 123544fa50
[ActivityPub] Port Postman 2021-12-01 19:47:40 +00:00
Diogo Peralta Cordeiro df3fbbc9e7
[ActivityPub] Add ActivityToType
Minor bug fixes
2021-12-01 19:47:39 +00:00
Diogo Peralta Cordeiro 56526c9ba6
[ActivityPub][Inbox] Restore Create Note Functionality
Minor bug fixes
2021-11-29 22:42:46 +00:00
Diogo Peralta Cordeiro 89d36a68e5
[ENTITY][Actor] Add is_local, it's common to depend, and this makes it much faster, with a low space cost 2021-11-16 23:26:20 +00:00
Diogo Peralta Cordeiro c862c9bf18
[ActivityPub] Make remote mentions great again 2021-11-01 12:16:46 +00:00
Hugo Sales 4d9a5aae5a
[ActivityPub] Always explicitly compare the results of `Event::handle` to the constants `next` or `stop` 2021-10-28 17:28:02 +01:00
Eliseu Amaro d47f125894
[PLUGINS][Favourite] Refactored redirection to previous url. User is now unable to do invalid actions (ex. favour an already favourited note).
[PLUGINS][ActivityPub] Fixed favour route id to be more consistent.
2021-10-27 20:44:50 +01:00
Diogo Peralta Cordeiro 51c984849f
[ActivityPub] Port Explorer 2021-10-27 04:22:19 +01:00
Diogo Peralta Cordeiro 028ea79fff
[CORE][Router] Properly act on Accept headers 2021-10-27 04:19:30 +01:00
Diogo Peralta Cordeiro 8fdc52636f
[ActivityPub] Port RSA 2021-10-27 04:19:29 +01:00
Diogo Peralta Cordeiro 8544fe157b
[FreeNetwork] First steps porting webfinger/lrdd to v3, GET webfinger requests already have a basic result 2021-10-27 04:19:29 +01:00
Hugo Sales 9109c61af5
[TOOLS][CS-FIXER] Run new PHP CS Fixer config. Notably, adds strict_types 2021-10-27 04:19:28 +01:00
Diogo Peralta Cordeiro 517ed953f2
[FreeNetwork] First step towards de-duplication mechanism for federation
Refactored AS2 inside AP; [ENTITY][Activity] went from core to AP
Webfinger plugin will be part of FreeNetwork component
2021-10-06 11:48:22 +01:00
Diogo Peralta Cordeiro 7813723ca1
[ActivityPub] Inbox must work without actor, specify source for AS2 2021-09-20 17:03:23 +01:00
Diogo Peralta Cordeiro d6f31d102a
[CORE][ActivityStreamsTwo][ActivityPub] Set all routes
Allow global routes to act for every actor
Fix Favoured stream query
2021-09-18 05:12:15 +01:00
Diogo Peralta Cordeiro 365edbaff0
[ActivityStreamsTwo] Initial Actor support
Various bug fixes
2021-09-15 10:26:53 +01:00
Hugo Sales 4e30e5aad9
[TOOLS] Fix all issues found by PHPStan level 2 2021-09-14 13:13:44 +01:00
Diogo Peralta Cordeiro 8880af8197
[ActivityStreamsTwo] Introduce a structure for data representation in ActivityStreams 2.0
Type factory borrowed from landrok/activitypub
2021-09-14 13:13:37 +01:00
Hugo Sales ad67358c3b
[ActivityPub] Remove ActivityPub plugin until we're ready to work on it, as it needs significant work 2021-09-14 13:10:51 +01:00
Daniel 95f95d2dd8
[TESTS] Added unit tests 2021-09-14 13:10:08 +01:00
Hugo Sales e2e53d9a2a
[AUTOGENERATED] Update auto generated code in entities 2021-09-14 13:06:56 +01:00
Hugo Sales 460712e15e
[GIT] Change my email to the new one in all files and bump copyright year 2021-09-14 13:06:56 +01:00
Hugo Sales f95f69c778
Add some missing documentation to ActivityPub 2021-09-14 13:06:56 +01:00
Hugo Sales cc758f6a8e
[AUTOGENERATED] Update autogenerated code in module entities 2021-09-14 13:06:51 +01:00
Hugo Sales f60bdaa2f0
[DB][MODULES][ActivityPub] Cleanup table definitions 2021-09-14 13:06:45 +01:00
Hugo Sales b624359b9a
[ActivityPub] Initial cleanup, removing 'die' statements, and ignoring the subfolders 2021-09-14 13:06:39 +01:00
Hugo Sales 11154a0d8c
[V3] Big Crunch
And so, just as it begins, so too must it end
One should not dwell and stall, for more is to come
2021-09-14 13:01:23 +01:00
Diogo Peralta Cordeiro 7d8988d50c [VersionBump] 2.0.0beta0
Updated composer and translations

composer install --no-dev
composer dump-autoload --optimize
git add vendor/ --force
make updatepo
2021-07-18 12:51:07 +01:00
Diogo Peralta Cordeiro 31433db539 [ActivityPub][POSTMAN] Do not die on network errors 2021-07-16 18:03:12 +01:00