Go to file
Baptiste Gelez 12efe721cc
Big refactoring of the Inbox (#443)
* Big refactoring of the Inbox

We now have a type that routes an activity through the registered handlers
until one of them matches.

Each Actor/Activity/Object combination is represented by an implementation of AsObject

These combinations are then registered on the Inbox type, which will try to deserialize
the incoming activity in the requested types.

Advantages:
- nicer syntax: the final API is clearer and more idiomatic
- more generic: only two traits (`AsActor` and `AsObject`) instead of one for each kind of activity
- it is easier to see which activities we handle and which one we don't

* Small fixes

- Avoid panics
- Don't search for AP ID infinitely
- Code style issues

* Fix tests

* Introduce a new trait: FromId

It should be implemented for any AP object.

It allows to look for an object in database using its AP ID, or to dereference it if it was not present in database

Also moves the inbox code to plume-models to test it (and write a basic test for each activity type we handle)

* Use if let instead of match

* Don't require PlumeRocket::intl for tests

* Return early and remove a forgotten dbg!

* Add more tests to try to understand where the issues come from

* Also add a test for comment federation

* Don't check creation_date is the same for blogs

* Make user and blog federation more tolerant to errors/missing fields

* Make clippy happy

* Use the correct Accept header when dereferencing

* Fix follow approval with Mastodon

* Add spaces to characters that should not be in usernames

And validate blog names too

* Smarter dereferencing: only do it once for each actor/object

* Forgot some files

* Cargo fmt

* Delete plume_test

* Delete plume_tests

* Update get_id docs + Remove useless : Sized

* Appease cargo fmt

* Remove dbg! + Use as_ref instead of clone when possible + Use and_then instead of map when possible

* Remove .po~

* send unfollow to local instance

* read cover from update activity

* Make sure "cc" and "to" are never empty

and fix a typo in a constant name

* Cargo fmt
2019-04-17 18:31:47 +01:00
.circleci Add tests for plume webserver (#513) 2019-04-06 17:41:57 +02:00
.github/ISSUE_TEMPLATE Update issue templates (#471) 2019-03-12 17:20:53 +01:00
migrations Fix issue with sqlite migrations for comment_seers (#503) 2019-03-26 08:57:46 +01:00
plume-api Run 'cargo fmt' to format code (#489) 2019-03-20 17:56:17 +01:00
plume-cli Edit blogs, and add blog icons and banners (#460) 2019-03-22 19:51:36 +01:00
plume-common Big refactoring of the Inbox (#443) 2019-04-17 18:31:47 +01:00
plume-front Run cargo fmt on plume-front (#515) 2019-04-06 18:57:25 +01:00
plume-models Big refactoring of the Inbox (#443) 2019-04-17 18:31:47 +01:00
po Big refactoring of the Inbox (#443) 2019-04-17 18:31:47 +01:00
script Add tests for plume webserver (#513) 2019-04-06 17:41:57 +02:00
src Big refactoring of the Inbox (#443) 2019-04-17 18:31:47 +01:00
static Standard smallest screen is 600px (#520) 2019-04-08 21:48:15 +01:00
templates add diverse links and meta to head (#522) 2019-04-09 15:33:34 +02:00
.codecov.yml Make Plume compile on release (#365) 2018-12-22 18:27:21 +01:00
.dockerignore Sample compose file and Dockerfile for deployment 2018-09-04 00:32:47 +02:00
.editorconfig Slightly improve the media experience (#452) 2019-03-06 14:11:36 +01:00
.gitignore Add tests for plume webserver (#513) 2019-04-06 17:41:57 +02:00
build.rs Run 'cargo fmt' to format code (#489) 2019-03-20 17:56:17 +01:00
Cargo.lock Big refactoring of the Inbox (#443) 2019-04-17 18:31:47 +01:00
Cargo.toml Big refactoring of the Inbox (#443) 2019-04-17 18:31:47 +01:00
CODE_OF_CONDUCT.md Add a CoC 2018-09-18 13:59:43 +01:00
crowdin.yml Update Crowdin configuration file 2019-03-15 16:45:17 +01:00
diesel.toml add sqlite migrations 2018-09-30 14:13:52 +02:00
Dockerfile Use multi step build to limit the docker image size (#416) 2019-01-09 17:48:18 +01:00
Dockerfile.dev Use multi step build to limit the docker image size (#416) 2019-01-09 17:48:18 +01:00
ISSUE_TEMPLATE.md Create ISSUE_TEMPLATE.md 2018-09-18 15:40:17 +01:00
LICENSE Add a license (AGPLv3) 2018-05-01 13:01:38 +01:00
plume_test Big refactoring of the Inbox (#443) 2019-04-17 18:31:47 +01:00
plume_tests Big refactoring of the Inbox (#443) 2019-04-17 18:31:47 +01:00
README.md Update README.md 2018-12-21 19:53:09 +01:00
rust-toolchain use circleci instead of travis (#511) 2019-04-01 20:28:23 +02:00

Plume's logo Plume

Build status Code coverage

WebsiteDocumentationContributeInstances list

Plume is a federated blogging engine, based on ActivityPub. It uses the Rocket framework, and Diesel to interact with the database.

It is not yet ready for production use, but we have all the basic features (account management, blogs, articles, comments, etc) and a basic federation.

Feel free to join our Matrix room: #plume:disroot.org to discuss about the project!

We also have a Loomio group to debate and vote and features. Feel free to join it to take part in Plume's decision process.

For more informations on the different ways to contribute, check out our contribution page. We are welcoming any kind of contribution, and you can probably find a way to help.

As we want the various spaces related to the project (GitHub, Matrix, Loomio, etc) to be as safe as possible for everyone, we adopted a code of conduct. Please read it and make sure you accept it before contributing.