Commit Graph

135 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 a2b9d7ec44
Password reset (#448)
* Password reset

* Various improvements and fixes for password reset

- Reorganize src/mail.rs to make it  cleaner
- add a build_mail function
- only make the requests invalid after 2 hours
- avoid infintely-growing list of requests by deleting them once completed, or after 24 hours
- avoid sending many requests for the same user
- validate the password reset form

* Avoid locking so many times

Fix durations

* Remove old requests even if the current one is not valid

* Remove unused feature

* Also remove the custom_derive and plugin features while we are at it

* Forgot a 0 è_é

* Avoid panicking while owning a request lock

* Use master branch of lettre so that we can build with the latest OpenSSL

* Fix the debug mailer
5 years ago
Baptiste Gelez e28371bbe4
Add a page listing people someone follows (#444)
Nothing exceptional, the layout is the same as the followers page.

Fixes #325
5 years ago
Baptiste Gelez 576a4ed499
Pull i18n from Funkwhale's weblate (#439)
* Added translation using Weblate (Arabic)

* Translated using Weblate (Arabic)

Currently translated at 66.7% (124 of 186 strings)

Translation: Plume/Plume
Translate-URL: https://translate.funkwhale.audio/projects/plume/Plume/ar/

* Translated using Weblate (English)

Currently translated at 100.0% (186 of 186 strings)

Translation: Plume/Plume
Translate-URL: https://translate.funkwhale.audio/projects/plume/Plume/en/

* Translated using Weblate (Japanese)

Currently translated at 100.0% (186 of 186 strings)

Translation: Plume/Plume
Translate-URL: https://translate.funkwhale.audio/projects/plume/Plume/ja/

* Translated using Weblate (Arabic)

Currently translated at 68.8% (128 of 186 strings)

Translation: Plume/Plume
Translate-URL: https://translate.funkwhale.audio/projects/plume/Plume/ar/

* Translated using Weblate (Norwegian Bokmål)

Currently translated at 96.8% (180 of 186 strings)

Translation: Plume/Plume
Translate-URL: https://translate.funkwhale.audio/projects/plume/Plume/nb/

* Translated using Weblate (Arabic)

Currently translated at 95.7% (178 of 186 strings)

Translation: Plume/Plume
Translate-URL: https://translate.funkwhale.audio/projects/plume/Plume/ar/

* Added translation using Weblate (Spanish)

* Translated using Weblate (Spanish)

Currently translated at 3.8% (7 of 186 strings)

Translation: Plume/Plume
Translate-URL: https://translate.funkwhale.audio/projects/plume/Plume/es/

* Added translation using Weblate (Portuguese (Portugal))

* Translated using Weblate (Arabic)

Currently translated at 99.5% (185 of 186 strings)

Translation: Plume/Plume
Translate-URL: https://translate.funkwhale.audio/projects/plume/Plume/ar/

* Translated using Weblate (Portuguese (Portugal))

Currently translated at 95.7% (178 of 186 strings)

Translation: Plume/Plume
Translate-URL: https://translate.funkwhale.audio/projects/plume/Plume/pt_PT/

* Translated using Weblate (Spanish)

Currently translated at 26.9% (50 of 186 strings)

Translation: Plume/Plume
Translate-URL: https://translate.funkwhale.audio/projects/plume/Plume/es/

* Translated using Weblate (Spanish)

Currently translated at 34.9% (65 of 186 strings)

Translation: Plume/Plume
Translate-URL: https://translate.funkwhale.audio/projects/plume/Plume/es/

* Translated using Weblate (Spanish)

Currently translated at 34.9% (65 of 186 strings)

Translation: Plume/Plume
Translate-URL: https://translate.funkwhale.audio/projects/plume/Plume/es/
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
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
Baptiste Gelez 4ec2480f50
Post creation API (#307) 6 years ago
fdb-hiroshima 5c5cf36b0d
Allow for comment deletion (#363)
* Allow for comment deletion

Receive and emit deletion activity
Add button to delete comment

* Remove debug print and fix copy-past typo

* Improve style of comment deletion button
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
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
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
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
Baptiste Gelez 663ec52fea Disable CSRF for the whole API 6 years ago
Baptiste Gelez 2394ff424b Add an ApiToken model, and an endpoint to get one 6 years ago
Baptiste Gelez f2190adfc2 Add an API endpoint to register apps 6 years ago
Trinity Pointard eca458b0e5 Add support for blog deletion
fix #181
6 years ago
Trinity Pointard fd92383f87 Normalize panic message and return 400 or 404 when suitable 6 years ago
Bat 9d70eeae61 Don't register the media serving route (they are now served with other static files)
And remove some unused imports
6 years ago
Bat 3b7842d040 Rocket should manage DbConn, not Option<DbConn>
Otherwise it fails when using DbConn as a request guard
6 years ago
Bat 9cc795d8be Replace DB_URL with DATABASE_URL
This way it is shared with diesel, which simplifies a lot the setup

Also fixes a few issues in the documentation, that are not directly related
6 years ago
Bat 4d382d8014 Fix compatibility with SQlite
Also fixes a bug in plume-models
6 years ago
Bat 5fa7a2a742 Remove legacy setup script 6 years ago
Trinity Pointard d3ed2d8af5 Fix regression and update rocket_csrf
Fix account creation, introduced by fceb9ab
Update to latest rocket_csrf
6 years ago
Trinity Pointard fceb9ab0cd Update cookie management a bit
Update to latest rocket_csrf
Make user_id a samesite lax cookie (see https://github.com/Plume-org/Plume/issues/233#issuecomment-422660275)
6 years ago
Bat 72fd9eb610 API: Filter posts in the list 6 years ago
Bat f893056d6d Mount the API endpoints 6 years ago
Bat 1500267125 Add canapi and try to use for the API 6 years ago
Baptiste Gelez 13ef50bb78
Merge pull request #212 from zcdunn/add_webapp_manifest
Add webapp manifest
6 years ago
Bat 8879935925 Add the possibility to save an article as draft 6 years ago
Zachary Dunn 3a81dd7089 Add webapp manifest 6 years ago
Bat de3707983a Account deletion
Fixes #182
6 years ago
Bat 54f6e7dfc6 Use a more classical flow for creating comments
Don't locally federate them anymore

It allows us to have them fetched later too
6 years ago
Bat 1f2bd105b6 Implement user ban 6 years ago
Bat c0d0f98d1f Update rocket_csrf and enable protection again 6 years ago
Bat 995c173146 Downgrade Tera + Temporary disable CSRF protection
Bugs in these crates prevented articles from displaying correctly.
6 years ago
Bat 0a70ff2594 Merge branch 'master' of github.com:Plume-org/Plume 6 years ago
Bat f1d5865a16 Instance (un)block endpoint
And hide the block button for the local instance
6 years ago
Bat c1e0b6c306 Add admin interface to manage interface 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 3918bd4501 Edit posts 6 years ago
Bat dd9c4a6a73 Add a page to list articles by tag 6 years ago
Bat b66d4f73ce Reorganize the homepage 6 years ago
Bat 79348e06ff Add a dedicated page for the federated feed 6 years ago
Bat 1496598a45 User feed 6 years ago
Bat babb3a81f5 Local timeline 6 years ago
Bat 32a4949f25 Update user information if needed
When a remote is displayed, if it has not been updated since at least 24 hours, newer informations are fetched.

Fixes #135
6 years ago
Bat e2e7d10929 Make it possible to choose an avatar 6 years ago
Bat 772bb350ac Update rocket_csrf to support multipart forms 6 years ago