Commit Graph

1019 Commits

Author SHA1 Message Date
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
Trinity Pointard
d6e220cc8d Actually index post_id in tantivy
Otherwise you can't remove/edit a document
2018-12-04 06:43:32 +01:00
Trinity Pointard
39deede935 Verify signature date
Fix #286
Remove indexed from post_id search field as it was added by mistake
2018-12-04 00:08:55 +01:00
Ryo Nakano
5ff3b65cc5 i18n: Add Japanese translation (#333)
Browsing the Demo instance, I sometimes found Japanese articles. So I decided to translate Plume into Japanese.
2018-12-03 19:06:10 +01:00
Trinity Pointard
24071a6229 Make plm search use cwd if no directory is given and update doc 2018-12-02 20:01:48 +01:00
Trinity Pointard
ed71d24fe9 Verify remote user name and media url 2018-12-02 19:09:17 +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
Trinity Pointard
9714bafded Verify username for special characters on signup 2018-12-02 12:43:03 +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
KokaKiwi
0b9727ed28 Generate valid follow Accept activity URI (#317)
For now it only generate a "fake" URI for accept follow activities, but it should be possible to get the URI dereferencable later.

Also I don't know if this URI looks ok, I tried to get something kind of future-proof, but I don't really know about the actual URIs conventions.

Closes #313
2018-11-23 13:23:46 +01:00
KokaKiwi
100f6307a7 Set Content-Type for ActivityPub request to correct value. (#315) 2018-11-23 13:18:33 +01:00
KokaKiwi
67fe28177e Decode unfollow activities in inbox properly (#316) 2018-11-23 13:17:37 +01:00
Trinity Pointard
00a205a882 Update debian installation doc
fix #305
Update debian installation doc
Remove need for libpq when compiling with sqlite backend
Remove some unneaded features of multipart to speed up compilation
2018-11-21 10:09:23 +01:00
Aaron W. Swenson
3ecd0e3c34 Correct Gentoo emerge instructions (#311)
Emerge doesn't care what order the packages are given; it'll figure out the correct build order and pull in the proper dependencies. Adding the -u switch will only perform the emerge if the package is not yet installed or needs to be updated. This avoids wasting time performing an emerge on something that has already been emerged.

While harmless, it is unnecessary to explicitly include eselect-postgresql in the list as the dev-db/postgresql ebuilds declare it as a dependency. There is no "sqlite3" or "libsqlite3-dev" ebuilds, so that command would fail.
2018-11-10 12:30:12 +01:00
Baptiste Gelez
a64c4912cf
Add support for CW in comments (#308)
All the backend/federation code was already, I just added the UI 🤷‍♀️ 

Fixes #253
2018-11-07 15:57:31 +01:00
Baptiste Gelez
b28411da99
Test with PostgreSQL too (#309)
* Test with PostgreSQL too

* Add 'test' to Travis build stages

* Add test coverage for postgresql
2018-11-07 15:50:24 +01:00
Baptiste Gelez
3690e4cfb9 Fix the path of the media directory for Docker setups 2018-11-06 10:56:42 +01:00
Baptiste Gelez
94904fa3d5 Escape titles in RSS feeds 2018-11-06 10:49:46 +01:00
Baptiste Gelez
f0b911a328 Fix RSS feed link on blog pages 2018-11-06 10:41:17 +01:00
Alexander
d724eba772 i18n: Add Russian translation (#306) 2018-11-05 19:18:46 +01:00
Trinity Pointard
dca91945af Try to take advantage of travis cache and build stages 2018-11-04 20:27:27 +01:00
Baptiste Gelez
8d5eaaec6a
Add Codecov badge 2018-11-02 10:02:31 +01:00
Baptiste Gelez
6b2d9d4221
Tests infrastructure for plume-models (#302)
First step for testing `plume-models`. I only added one test for the moment, but we should add more in future PRs.
2018-11-01 22:23:38 +01:00
Marcin Mikołajczak
1bcde7fb86 i18n: Update Polish translation 2018-11-01 12:47:28 +01:00
Baptiste Gelez
57cf55fecc Fix RSS feed icon
Closes #289
2018-10-31 18:17:13 +01:00
Baptiste Gelez
67077267cf Add OpenGraph metadata 2018-10-31 16:14:26 +01:00
Baptiste Gelez
68a30cc80e Fix spacing for the delete article button 2018-10-31 15:22:49 +01:00
Baptiste Gelez
185cb5142a Better style for subtitles 2018-10-31 15:19:42 +01:00
Baptiste Gelez
25b7399e7f Only list images for possible covers 2018-10-31 15:07:40 +01:00
Baptiste Gelez
f593ce40af Remove some debug messages 2018-10-31 15:07:40 +01:00
Baptiste Gelez
464832bb31 Avoid template errors when form.cover is not defined 2018-10-31 15:07:40 +01:00
Baptiste Gelez
1a49569bf2 Better style for <select> 2018-10-31 15:07:40 +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
9f1b37648e Fix error in de.po 2018-10-31 15:06:00 +01:00
Baptiste Gelez
f6227e7a42 Nicer default avatar 2018-10-31 15:03:21 +01:00
Baptiste Gelez
8e8aae17b1 Nginx docs: add 'unsafe-inline' to CSP header (to allow avatars to be loaded) 2018-10-31 14:56:17 +01:00
Baptiste Gelez
2e072affb5
Fix editor auto-expansion (#293) 2018-10-30 18:16:24 +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
Baptiste Gelez
c341179150 ApiToken: rename what to scope 2018-10-30 18:13:49 +01:00
Baptiste Gelez
28fbf35779 Use PhantomData intead of two Options useless for Authorization
And remove some warnings about unused parameters
2018-10-30 18:13:49 +01:00
fdb-hiroshima
9784d754b2 Use the full URL to refer to the Apps API
Co-Authored-By: BaptisteGelez <baptiste@gelez.xyz>
2018-10-30 18:13:49 +01:00
Baptiste Gelez
647a5af070 Make it impossible to know if an username is used or not with the API 2018-10-30 18:13:49 +01:00
Baptiste Gelez
0dbf9f519e AppEndpoint.name is required for both the client and server 2018-10-30 18:13:49 +01:00
Baptiste Gelez
31641b1ea1 New request guard: Authorization<Action, Scope>
Filter requests that don't have an API token authorized to read or write
a specific scope;
2018-10-30 18:13:49 +01:00
Baptiste Gelez
cd4ae5b7f5 Document API authentication and apps API 2018-10-30 18:13:49 +01:00