Commit graph

54 commits

Author SHA1 Message Date
Baptiste Gelez 2a188abfa1
Fix follow IDs (#455)
* Generate valid IDs for Follow

Fixes #449

* Use the new post-insert hook for all the models

* Fix plume-cli build
2019-03-04 21:35:03 +01:00
Baptiste Gelez 80a4dae8bd
Avoid panics (#392)
- Use `Result` as much as possible
- Display errors instead of panicking

TODO (maybe in another PR? this one is already quite big):
- Find a way to merge Ructe/ErrorPage types, so that we can have routes returning `Result<X, ErrorPage>` instead of panicking when we have an `Error`
- Display more details about the error, to make it easier to debug

(sorry, this isn't going to be fun to review, the diff is huge, but it is always the same changes)
2018-12-29 09:36:07 +01:00
Baptiste Gelez 4ec2480f50
Post creation API (#307) 2018-12-24 16:42:40 +01:00
fdb-hiroshima 0ea1d57e48
Fix some federation issues (#357)
* Fix some follow issues

Fix not receiving notifications when followed by remote users
Fix imposibility to be unfollowed by Mastodon/Pleroma users (tested only against Pleroma)

* Fix notification on every post

* Fix issues with federation

Send Link instead of Object when emiting Follow request
Receive both Link and Object for Follow request
Don't panic when fetching user with no followers or posts from Pleroma
Reorder follower routes so Activity Pub one is reachable

* Generate absolute urls for mentions and tags

* Verify author when undoing activity by Link
2018-12-23 11:12:15 +01:00
Baptiste Gelez 38302203f4
Count items in database as much as possible (#344)
* Count items in database as much as possible

* Fix the tests

* Remove two useless queries

* Run pragma directive before each sqlite connection

* Pragma for tests too

* Remove debug messages
2018-12-14 23:16:18 +01:00
Baptiste Gelez b73fbd3768
License federation (#343)
* Federate license

* Make it possible to use no license
2018-12-09 18:43:34 +01:00
Baptiste Gelez 70af57c6e1
Use Ructe (#327)
All the template are now compiled at compile-time with the `ructe` crate.

I preferred to use it instead of askama because it allows more complex Rust expressions, where askama only supports a small subset of expressions and doesn't allow them everywhere (for instance, `{{ macro!() | filter }}` would result in a parsing error).

The diff is quite huge, but there is normally no changes in functionality.

Fixes #161 and unblocks #110 and #273
2018-12-06 18:54:16 +01:00
Trinity Pointard 5f059c3e98 Fix issues with tags and mentions
Fix issue where leading @ or # of a mention/hashtag get duplicated
Fix issue where normal tags were being overwritten by hashtags
2018-12-06 15:10:07 +01:00
fdb-hiroshima 449641d158
Add a search engine into Plume (#324)
* Add search engine to the model

Add a Tantivy based search engine to the model
Implement most required functions for it

* Implement indexing and plm subcommands

Implement indexation on insert, update and delete
Modify func args to get the indexer where required
Add subcommand to initialize, refill and unlock search db

* Move to a new threadpool engine allowing scheduling

* Autocommit search index every half an hour

* Implement front part of search

Add default fields for search
Add new routes and templates for search and result
Implement FromFormValue for Page to reuse it on search result pagination
Add optional query parameters to paginate template's macro
Update to newer rocket_csrf, don't get csrf token on GET forms

* Handle process termination to release lock

Handle process termination
Add tests to search

* Add proper support for advanced search

Add an advanced search form to /search, in template and route
Modify Tantivy schema, add new tokenizer for some properties
Create new String query parser
Create Tantivy query AST from our own

* Split search.rs, add comment and tests

Split search.rs into multiple submodules
Add comments and tests for Query
Make user@domain be treated as one could assume
2018-12-02 17:37:51 +01:00
fdb-hiroshima 74c398d60c
Run cargo clippy on whole project (#322)
* Run cargo clippy on plume-common

Run clippy on plume-common and adjuste code accordingly

* Run cargo clippy on plume-model

Run clippy on plume-model and adjuste code accordingly

* Reduce need for allocation in plume-common

* Reduce need for allocation in plume-model

add a quick compilation failure if no database backend is enabled

* Run cargo clippy on plume-cli

* Run cargo clippy on plume
2018-11-26 10:21:52 +01:00
fdb-hiroshima 8a4702df92 Add unit tests for main model parts (#310)
Add tests for following models:
- Blog
- Instance
- Media
- User
2018-11-24 12:44:17 +01:00
Baptiste Gelez 4a2f5aeeeb Display article covers 2018-10-31 15:07:40 +01:00
Baptiste Gelez 95326c09e0 Federate article covers 2018-10-31 15:07:40 +01:00
Baptiste Gelez 485aac2e20 Add an interface to select an article illustration 2018-10-31 15:07:40 +01:00
Baptiste Gelez ab5edbc6a5 Add a cover field to posts
Referencing the media to use to illustrate the article
2018-10-31 15:07:40 +01:00
Baptiste Gelez e26a150164 Make Authorization optional for read routes
Only require it when reading draft articles.
2018-10-30 18:13:49 +01:00
Trinity Pointard 76ca76f068 Update tags and hashtags on remote post edition 2018-10-29 20:54:27 +01:00
Trinity Pointard c4fc656809 Update mentions on remote post edition 2018-10-29 20:54:27 +01:00
Trinity Pointard f147885f08 Detect if tags are hashtags when receiving new posts 2018-10-29 20:54:27 +01:00
Trinity Pointard 9d7ae694a8 Delete notification on post deletion 2018-10-29 20:54:27 +01:00
Baptiste Gelez fcf911fac9 ActivityPub: don't delete anything if the actor is not authorized 2018-10-22 16:29:25 +01:00
Trinity Pointard 4e6f3209d5 Normalize panic message
Change all unwrap to expect
Normalize expect's messages
Don't panic where it could be avoided easily
2018-10-20 08:44:33 +02:00
Bat 387efbf3e9 Change default license to CC-BY-SA
Fixes #258
2018-10-06 18:19:45 +01:00
Bat 07f2c979ec Make the REST API compatible with SQlite 2018-09-30 14:21:07 +01:00
Bat 743620eb6a
Fix the SQlite build 2018-09-30 14:13:56 +02:00
Bat 38d737ed0c
Introduce features to choose between SQlite or Postgres 2018-09-30 14:13:54 +02:00
Bat 472da486e9 Fix the canapi::Provider impl for Post 2018-09-25 20:10:18 +01:00
Bat 1500267125 Add canapi and try to use for the API 2018-09-19 15:49:34 +01:00
Bat 10da8f31b6 Hide articles on public pages
Only show them in the dashboard
2018-09-10 20:06:00 +01:00
Bat 0f5f9101b6 Only notify for mention if it is not in a comment
To avoid two similar notifications
2018-09-08 12:53:17 +01:00
Bat 47be1541a7 Fix tag and mentions federation
Vec::append is not returning a value, but modifying the Vec
2018-09-07 21:38:22 +01:00
Bat 3918bd4501 Edit posts 2018-09-07 18:51:53 +01:00
Bat 413e34ac0e Federate article updating 2018-09-06 22:39:22 +01:00
Bat 7152d714ae Add a source property to posts
To store the Markdown
2018-09-06 20:00:55 +01:00
Bat dd9c4a6a73 Add a page to list articles by tag 2018-09-06 13:06:04 +01:00
Bat a54d2e9d71 Federate tags 2018-09-06 09:21:08 +01:00
Bat 5b3eca63e0 Make it possible to tag articles and display them 2018-09-05 21:18:27 +01:00
Bat 1496598a45 User feed 2018-09-05 15:21:50 +01:00
Bat babb3a81f5 Local timeline 2018-09-04 20:56:27 +01:00
Bat 94a386ea2c Add subtitles to articles
Fix #152
2018-09-04 12:26:13 +01:00
Bat cea548b821 Add a way to delete articles
Fixes #116
2018-09-01 16:28:47 +01:00
Bat 812b76b0de Use the creation date from ActivityPub when fetching remote articles 2018-07-27 00:29:21 +02:00
Bat 0314629d99 Improve the background article fetching code 2018-07-26 22:59:41 +02:00
Bat bd259891f3 Try to fetch remote articles 2018-07-26 22:23:53 +02:00
Bat 15477875da Fix links for post from remote blogs 2018-07-26 16:19:21 +02:00
Baptiste Gelez 16fb439ce9
Merge pull request #159 from Ilphrin/master
Add a link to the blog on article cards
2018-07-25 21:40:27 +02:00
Kevin "Ilphrin" Pellet aaae786fb7 Implement new function to Blog for the view
Added Blog::to_json and Blog::get_fqn
2018-07-25 21:22:42 +02:00
Bat 18125ab398 Paginate the homepage 2018-07-25 15:20:09 +02:00
Bat 5549e4d0e5 Merge branch 'master' of github.com:Plume-org/Plume 2018-07-24 14:32:11 +02:00
Kevin "Ilphrin" Pellet 89713526e2 Add a link to the blog on article cards
Fixes #134
2018-07-22 01:42:27 +02:00