Wykres commitów

1124 Commity (577be40042b288c3495f717799ed9c21fd3a7071)

Autor SHA1 Wiadomość Data
Marnanel Thurman 577be40042 16x16 icon for the-federation.info 2020-10-03 01:11:31 +01:00
Marnanel Thurman 85c40b4971 pngcrush 2020-10-03 01:11:20 +01:00
Marnanel Thurman 895646740f rm old icon 2020-10-03 01:05:23 +01:00
Marnanel Thurman 8833f3a5f5 note about the magazine 2020-10-02 22:55:00 +01:00
Marnanel Thurman ef35989525 hat-person is a jpg 2020-10-02 22:53:53 +01:00
Marnanel Thurman 048eacde36 docs/name.md 2020-10-02 22:52:32 +01:00
Marnanel Thurman 6a69a22bde update installation documentation, and note about bowler-heavy 2020-10-02 22:29:20 +01:00
Marnanel Thurman fec31acb4c updated README.md 2020-10-02 22:01:24 +01:00
Marnanel Thurman 57e780e4c8 Hat person 2020-10-02 21:37:00 +01:00
Marnanel Thurman 3d8a55f485 Roadmap, such as it is 2020-10-02 21:34:48 +01:00
Marnanel Thurman 651d9bb363 fix markdown header syntax 2020-10-02 21:25:01 +01:00
Marnanel Thurman 9344b54f59 modules.md 2020-10-02 21:23:06 +01:00
Marnanel Thurman 7f1c93c431 Update kepi.[pn|sv]g to the new hat-and-heart logo.
Add a slightly tweaked version of the original snake picture.
2020-10-02 21:06:04 +01:00
Marnanel Thurman 4dcb6a4e61 rm a lot of Sphinx stuff 2020-10-02 20:59:00 +01:00
Marnanel Thurman 13ff6ba639 SHARED_INBOX_LINK set to '/sharedInbox' because that's what urls.py is expecting 2020-09-30 16:26:21 +01:00
Marnanel Thurman c9ad177220 Added top-level exception handler to InboxView, since it seems to be experiencing difficulties.
Really this needs to be a more general solution.
2020-09-30 16:20:22 +01:00
Marnanel Thurman ceed10b278 DEBUG=False by default! 2020-09-30 16:14:48 +01:00
Marnanel Thurman b5a7f7114d Attempts to fetch(None) get None.
It sometimes happens in the wild that someone submits "inReplyTo: null" or similar.
2020-09-30 16:13:02 +01:00
Marnanel Thurman 3d38c6618a Replaced the "requested" flag in Follow with an "offer" field which holds the ID of the follow request. 2020-09-30 15:44:16 +01:00
Marnanel Thurman 9d8f4613d4 When trilby_api hears about a follow request, and the person being
followed has "auto_follow" turned on, the request is automatically
granted. If the follower is remote, they automatically get sent an
Accept activity. This fixes a regression.

As part of this, bowler_pub.create() now sends the ID of the Follow
activity through the signal.

Also, trilby_api.receivers now uses sensible renames for the
"sender" parameters-- they're really the activities which caused
the signal.
2020-09-28 17:08:15 +01:00
Marnanel Thurman 3a1a5f6db2 Remote users following local users causes the "followed" signal 2020-09-28 16:30:58 +01:00
Marnanel Thurman dbc5e47b4b Messages posted to user inboxes, and to the shared inbox, will be acted upon.
Closes issue #37.
2020-09-21 18:10:34 +01:00
Marnanel Thurman 4982c4daed Two tests in test_create were attempting to resolve "somewhere.example.com"
(and failing, obviously). This should have been mocked but wasn't.
This need some deeper investigation so I've @skip()ped them for now.
(One of the tests was previously @expected_failure.)
2020-09-21 18:09:10 +01:00
Marnanel Thurman 0eb479129f extra debug logging 2020-09-21 18:08:48 +01:00
Marnanel Thurman 9afc7dd220 If you pass a bytestring to validate(), and it doesn't decode cleanly, log this and exit gracefully.
There's still a remaining issue: we always decode the bytestring as UTF-8, but it might not be. Marked with XXX.

Hence also: log.info() the incoming message before attempting to decode the bytestring.

Also: don't bother logging when we've launched the validation task, since that always succeeds.
2020-09-21 17:55:46 +01:00
Marnanel Thurman 0679cb12ae log_one_message allows the "body" parameter to be a bytestring as well as a dict.
This is because incoming messages are no longer parsed straight away (see commit 83b69f2f).
2020-09-21 17:50:19 +01:00
Marnanel Thurman 293191a1f6 The bowler_pub functions which create test messages require extra fields to be supplied as a "fields" parameter.
Previously we allowed callers to specify them as arguments, if the argument name was preceded by "f_".
This caused ambiguities and was too much faff to be useful.

Tests updated accordingly.

Also, one test message copied from the ActivityPub spec was slightly in breach of actual usage conventions. Fixed.
2020-09-21 17:48:51 +01:00
Marnanel Thurman 83b69f2fcb ActivityParser doesn't parse the JSON of incoming messages.
This is because when we validate the message, a little further
down the line, we need access to the exact content of the message.
Parsing it here would destroy the exact content, because Django
doesn't let you read request bodies twice.
2020-09-21 17:43:57 +01:00
Marnanel Thurman f95163dc04 Drop incoming messages with no type 2020-09-21 17:43:32 +01:00
Marnanel Thurman 2043ca8eaf When we create a Status from a Create message, catch exceptions and treat as failure. 2020-09-21 17:08:20 +01:00
Marnanel Thurman 482f3132e0 rm unused field "is_local_user" in IncomingMessage 2020-09-20 23:53:54 +01:00
Marnanel Thurman c4c5555c8b Modernised the "send to inbox" tests which were taken from bowler_heavy.
Previously they were all marked @skip. They are no longer skipped, but they don't pass.

Clearly there's work to be done there. More work will probably also be needed in modernising the tests.
2020-09-19 20:32:27 +01:00
Marnanel Thurman 82d8c55701 Added a django-rest-framework parser so we accept uploads of type
"application/activity+json".
2020-09-19 20:29:12 +01:00
Marnanel Thurman 6023aa9c36 Inbox stub status should be 403, not 410!! 2020-09-19 18:33:24 +01:00
Marnanel Thurman 513c2d52e5 logger.warn is now logger.warning (pylint W1505) 2020-09-19 16:25:31 +01:00
Marnanel Thurman 1ce2d41e1e Updated all copyright dates to 2020 2020-09-19 16:18:32 +01:00
Marnanel Thurman 48fbb745de removed trailing whitespace throughout (pylint C0303) 2020-09-19 15:58:35 +01:00
Marnanel Thurman ebe785bda4 rm trailing newlines (pylint C0304) 2020-09-19 15:16:47 +01:00
Marnanel Thurman f4889f4def LocalPerson: inbox -> inbox_url, and inbox_collection -> inbox.
This fixes a regression.
2020-09-19 15:07:57 +01:00
Marnanel Thurman 4b513fb817 Several view fixes in bowler:
CollectionView.get() correctly passes username and listname through to activity_get().
This fixes a regression.

CollectionView.get() dereferences the result of activity_get() if it's an ActivityResponse.
This should have been part of commit d02042f2 but I missed it.
This fixes a regression.

CollectionView.get() uses len() to get the length of the result of activity_get(), and
not the result's count() method. This allows the result to be a list as well as a queryset.

CollectionView.activity_get()'s logging is slightly tidier.
2020-09-19 15:00:48 +01:00
Marnanel Thurman 197362b2c3 ActivityResponse's constructor actually stores its parameter.
I don't know how it even could have worked before.
2020-09-19 15:00:00 +01:00
Marnanel Thurman 0a9d266305 test_send_to_followers_of_remote_user() implemented and passing. 2020-09-19 14:42:57 +01:00
Marnanel Thurman c22f8d7c0e If fetch() rejects a message because the JSON was malformed, show the JSON parsing error in the log. 2020-09-19 14:42:31 +01:00
Marnanel Thurman 193faf061b Sombrero's test_delivery gains test_send_to_remote_user().
Thanks to Patrick Gosling for pointing out that lambdas in a loop need their own copies of a closure variable!
https://docs.python.org/3/faq/programming.html#why-do-lambdas-defined-in-a-loop-with-different-values-all-return-the-same-result
2020-09-19 12:52:00 +01:00
Marnanel Thurman 1f57997802 Several small fixes related to code moved out of a previous version
which hadn't yet been tested.
2020-09-19 12:51:25 +01:00
Marnanel Thurman 1ae4abdf37 docstring for create_remote_person() 2020-09-19 12:50:57 +01:00
Marnanel Thurman c1368cd128 sombrero's test_delivery has assertions in. (The previous stub version didn't.)
The tests for remote delivery are still unimplemented. Soon.
2020-09-16 23:18:25 +01:00
Marnanel Thurman d02042f247 bowler's Collection views refactored. It feels a bit like being the redactor of the book of Genesis.
The refactoring is more complicated than it sounds. The file activitypub.py
was created by merging two sets of views from the old bowler_heavy
branch. This resulted in two classes called InboxView, and of course
the second one in the file won out. I have merged them and fixed
the errors therein.

As part of this, I have discovered that d-r-f adds the requirement
that view methods return HttpResponse objects. Therefore we've had
to add a new class, ActivityResponse, whose only purpose is to
get around this requirement.

fetch() has been updated as appropriate.
2020-09-16 23:14:38 +01:00
Marnanel Thurman c586eecfcb The *_url methods of LocalPerson should always have been properties
(as they are for RemotePerson).
2020-09-16 20:32:26 +01:00
Marnanel Thurman cf94c4ba0a Test utilities involving local users have moved to trilby_api.
This is a bit complicated. We used to have two functions called
create_local_person(): one of them was in bowler_pub and the other
was in trilby_api. The bowler_pub one worked better because it
defaulted to using test keys rather than expecting the system
to make new ones, which is slow and wasteful.

Therefore, we have moved the c_l_p() from bowler into trilby,
and thrown the trilby one out.

While we're at it, we have also moved create_local_status and
create_local_like from bowler into trilby, and deleted trilby's
create_local_note.

This makes everything faster and easier.
2020-09-16 01:10:23 +01:00