Commit Graph

115 Commits (42dca3daaee3e647337ceb7e18ab97b8a133a95e)

Author SHA1 Message Date
Baptiste Gelez 42dca3daae
Remove some unused #[derive] (#473)
We used to need them, probably when we were using Tera.
5 years ago
Baptiste Gelez fe6e69d7c4
Add a fqn field to blogs and users (#457)
Fixes #319
5 years ago
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
5 years ago
Baptiste Gelez 7eef4643c8
Update rocket_i18n and add gettext_macros (#431)
Internationalization now uses proc-macros that generate the .pot file
automatically.
5 years ago
fdb-hiroshima e77e4d86e8
Better big form handling (#430)
* Allow customizing max form size from env vars

* Add error page for unprocessable entities

And change default http port to 7878

* Improve char counter: under the editor, more discrete, and give it a default value
5 years ago
fdb-hiroshima c4a4ea5b6c Support blind key rotation (#399)
* Allow receiving objects with new unknown key

* Rotate key after sending Delete activity

* Do the right check
6 years ago
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)
6 years ago
fdb-hiroshima fdfeeed6d9 Comment visibility (#364)
Add some support for comment visibility, fix #217 

This add a new column to comment, denoting if they are public or not, and a new table linking private comments to those allowed to read them. There is currently no way to write a private comment from Plume.
Git is having a hard time what happened in Comment::from_activity, but most of it is just re-indentation because a new block was needed to please the borrow checker. I've marked with comments where things actually changed.
At this point only mentioned users can see private comments, even when posted as "follower only" or equivalent.

What should we do when someone isn't allowed to see a comment? Hide the whole thread, or just the comment? If hiding just the comment, should we mark there is a comment one can't see, but answers they can, or put other comments like if they answered to the same comment the hidden one do?
6 years ago
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
6 years ago
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
6 years ago
Baptiste Gelez b0089e59b7
Remove useless pagination routes (#351)
Rocket 0.4 let us have routes with optional query parameter
6 years ago
Baptiste Gelez b73fbd3768
License federation (#343)
* Federate license

* Make it possible to use no license
6 years ago
fdb-hiroshima e1ecc7289f
Upgrade plume dependencies (#332)
* Bump base64 from 0.9.3 to 0.10.0
* Bump bcrypt from 0.2.0 to 0.2.1
* Bump canapi from 0.1.0 to 0.2.0
* Bump failure from 0.1.2 to 0.1.3
* Bump hyper from 0.11.27 to 0.12.11
* Bump hyper from 0.11.27 to 0.12.16
* Bump lazy_static from 1.1.0 to 1.2.0
* Bump multipart from 0.15.3 to 0.15.4
* Bump openssl from 0.10.12 to 0.10.15
* Bump pulldown-cmark from 0.1.2 to 0.2.0
* Bump reqwest from 0.9.2 to 0.9.5
* Bump rocket from 0.4.0-rc.1 to 0.4.0
* Bump rpassword from 2.0.0 to 2.1.0
* Bump ructe from 0.5.2 to 0.5.4
* Bump serde_derive from 1.0.79 to 1.0.80
* Bump serde from 1.0.79 to 1.0.80
* Bump serde_json from 1.0.32 to 1.0.33
* Bump tera from 0.11.17 to 0.11.20
* Bump url from 1.7.1 to 1.7.2
* Bump validator to from 0.7.2 to 0.8.0
* Bump validator_derive from 0.7.2 to 0.8.0
* Bump whatlang from 0.5.0 to 0.6.0
* Remove hyper from plume-common dependencies
* Remove rpassword from Plume dependancies
* Upgrade compiler to nightly-2018-12-06
6 years ago
Trinity Pointard b4e4b497ee Works on template
Use uri! to generate links instead of hardcoded urls
Fix #110
Fix invalid links needing to be POST forms
Translate login message for boost and like directly from template
Put js for search in its own file
6 years ago
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
6 years ago
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
6 years ago
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
6 years ago
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
6 years ago
Baptiste Gelez a64c4912cf
Add support for CW in comments (#308)
All the backend/federation code was already, I just added the UI 🤷‍♀️ 

Fixes #253
6 years ago
Baptiste Gelez f593ce40af Remove some debug messages 6 years ago
Baptiste Gelez 485aac2e20 Add an interface to select an article illustration 6 years ago
Baptiste Gelez ab5edbc6a5 Add a cover field to posts
Referencing the media to use to illustrate the article
6 years ago
Trinity Pointard 76ca76f068 Update tags and hashtags on remote post edition 6 years ago
Trinity Pointard c4fc656809 Update mentions on remote post edition 6 years ago
Trinity Pointard 2523f3b523 Prevent duplication of mention on post update
and delete mentions and notifications of user no longer mentioned
6 years ago
Trinity Pointard 1689813df4 Deduplicate tags and mentions
Use set to work on tags and mentions, allowing deduplication of them,
and clearer code
May also help with distinguishing tags and hashtags latter
6 years ago
Trinity Pointard 0bb2e6293a Send Create activity when undrafting post
Send a Create activity when a post get undrafted, instead of sending an
	Update activity for a non federated post
Fix #221
6 years ago
Trinity Pointard 95ea248518 Add support for hashtag on user interface
Add migration to fix typo
Add support for linking hashtags with posts
Rework tag search page so it says a nicer message than page not found
when no post use that tag
Add new string to translation
6 years ago
Trinity Pointard 4fa3a0f6ee Add support for hashtags in md parser 6 years ago
Trinity Pointard a6e73f4667 Allow tag deletion
Fix #232
6 years ago
Trinity Pointard fd92383f87 Normalize panic message and return 400 or 404 when suitable 6 years ago
Trinity Pointard f9498828c4 Modify post slug only when it's still drafted
Fix #207
6 years ago
Bat 387efbf3e9 Change default license to CC-BY-SA
Fixes #258
6 years ago
Bat d8ca1d70b7 Fix CSRF issues
GET routes are not protected against CSRF. This commit changes the needed URLs to
POST and replace simple links with forms.

Thanks @fdb-hiroshima for noticing it!
6 years ago
Bat 0200a7b223 Only send notifications for mentions if the post is not a draft 6 years ago
Bat b01212f4a6 Make it impossible to view drafts if you are not the author
Even if you got the URL
6 years ago
Bat 8879935925 Add the possibility to save an article as draft 6 years ago
Bat 08cb337df6 Broadcast activities to all known instances
We consider everything posted with Plume public (for the moment at least)
6 years ago
Baptiste Gelez fe7f87c47f
Merge pull request #205 from lthms/recent_rocket
Update to a more recent rocket and rust toolchain
6 years ago
Thomas Letan 0ef4717a7f deps: Update to a more recent rocket and rust toolchain
With this patch, Plume will be use a more up-to-date revision of
Rocket, that works with nightly-2018-07-17. It may have been able to
make it work with a more recent revision, but it turns out rocket has
introduced several breaking changes so I’d rather fix those.

Besides updating rocket_i18n and rocket_csrf to use the same revision
than Plume, this patch deals with the new implementation of the
Uri<'_> type. It silents a class of warnings, to deal with a change in
rustc which affects diesel. This latter change should be reverted as
soon as diesel releases a new version of its crate.
6 years ago
Bat 0f5f9101b6 Only notify for mention if it is not in a comment
To avoid two similar notifications
6 years ago
Bat b53a078b49 Edit HTML for old articles without source 6 years ago
Bat 3918bd4501 Edit posts 6 years ago
Bat 413e34ac0e Federate article updating 6 years ago
Bat 7152d714ae Add a source property to posts
To store the Markdown
6 years ago
Bat 5b3eca63e0 Make it possible to tag articles and display them 6 years ago
Bat bba9a56329 Add author biography at the bottom of the post 6 years ago
Bat 94a386ea2c Add subtitles to articles
Fix #152
6 years ago
Bat 3013eec579 Redesign menu items 6 years ago
Bat b66e8942a9 Fix the deletion route 6 years ago