Commit Graph
100 Commits
Author SHA1 Message Date
Baptiste GelezandGitHub 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 GelezandGitHub 3fce5d6a14 Use Rust for the front-end too (#374)
Rust can compile to WASM, so let's use it for front-end code as well.

To compile the front-end:

```
cargo install cargo-web
cargo web deploy -p plume-front
```
2018-12-25 11:51:40 +01:00
Baptiste GelezandGitHub 4ec2480f50 Post creation API (#307) 2018-12-24 16:42:40 +01:00
Baptiste GelezandGitHub 8ff6332784 I'm not the only one who made Plume è_é (#373) 2018-12-23 17:29:08 +01:00
Baptiste GelezandGitHub 04625b3fea Use Route159 for comment deletion button (#372)
For some reason it was not what was used.
2018-12-23 15:58:25 +01:00
Baptiste GelezandGitHub 5a682419cb Remove the docs folder (#371)
Since documentation now has its own repo.

I also modified a bit the dockerfile to make the image lighter.
2018-12-23 15:24:55 +01:00
Baptiste GelezandGitHub 718e23ac85 Update README.md
Links to joinplu.me

Say that we have a CoC

Remove link to baptiste.gelez.xyz
2018-12-21 19:53:09 +01:00
Baptiste GelezandGitHub 9e799f2cf2 Use SCSS (#355)
- Use variables
- Split everything in various files

The SCSS is compiled with `cargo build`/`run`

I also fixed a few visual issues.
2018-12-15 22:06:27 +01:00
Baptiste GelezandGitHub 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 GelezandGitHub b0089e59b7 Remove useless pagination routes (#351)
Rocket 0.4 let us have routes with optional query parameter
2018-12-13 22:20:19 +01:00
Baptiste Gelez e139008d35 Fix reshare button style 2018-12-13 21:56:26 +01:00
Baptiste GelezandGitHub 61b6ceed92 Add some constraint at database level (#342)
* Add some constraint at database level

Fixes #79 and should fix #201 and #113 as well

* Fix tests

Delete duplicated data before adding constraints (only with Postgres, there is no way to do it with Sqlite with complex constraints like the one we are using)

Remove the constraint on media path

* We don't need to drop the media unique constraint anymore

Because we deleted it
2018-12-09 18:44:26 +01:00
Baptiste GelezandGitHub b73fbd3768 License federation (#343)
* Federate license

* Make it possible to use no license
2018-12-09 18:43:34 +01:00
Baptiste GelezandGitHub 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
Baptiste GelezandGitHub 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 GelezandGitHub 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
Baptiste GelezandGitHub 8d5eaaec6a Add Codecov badge 2018-11-02 10:02:31 +01:00
Baptiste GelezandGitHub 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
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 GelezandGitHub 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
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
Baptiste Gelez 9a13d804c5 impl FromRequest for ApiToken
and use it for the posts API
2018-10-30 18:13:49 +01:00
Baptiste Gelez 663ec52fea Disable CSRF for the whole API 2018-10-30 18:13:49 +01:00
Baptiste Gelez 2394ff424b Add an ApiToken model, and an endpoint to get one 2018-10-30 18:13:49 +01:00
Baptiste Gelez f2190adfc2 Add an API endpoint to register apps 2018-10-30 18:13:49 +01:00
Baptiste Gelez 4c8a727e9e Add a model for external apps
Stores their name, website, and credentials
2018-10-30 18:13:49 +01:00
Baptiste Gelez 1a2de6c88f Fix the NodeInfo example
Forgot to change that when I copy/pasted it from the source
code.
2018-10-29 20:31:25 +01:00
Baptiste Gelez 175a9edb77 Add documentation for our ActivityPub implementation
Fixes #262
2018-10-29 20:31:25 +01:00
Baptiste GelezandGitHub 6efcba46ad Merge pull request #297 from maximesrd/patch-8
Added startup script for openrc
2018-10-29 19:35:57 +01:00
Baptiste GelezandGitHub 8c2e0e680a Merge pull request #294 from silkevicious/master
Added Italian translation
2018-10-29 19:28:38 +01:00
Baptiste GelezandGitHub b28c1a7568 Merge pull request #288 from maximesrd/patch-7
Adding MIGRATION_DIRECTORY
2018-10-22 19:24:20 +01:00
Baptiste GelezandGitHub 9000f2ba62 Merge pull request #287 from maximesrd/patch-6
Variable name error
2018-10-22 19:23:53 +01:00
Baptiste Gelez fcf911fac9 ActivityPub: don't delete anything if the actor is not authorized 2018-10-22 16:29:25 +01:00
Baptiste GelezandGitHub fc5acac861 Merge pull request #283 from Plume-org/hashtags
Support hashtags
2018-10-21 13:53:15 +01:00
Baptiste GelezandGitHub 9187aefda0 Merge pull request #282 from Plume-org/blog-deletion
Add support for blog deletion
2018-10-21 13:39:41 +01:00
Baptiste GelezandGitHub 879fde81ba Merge pull request #281 from Plume-org/panic-refactor
Panic less and with better messages
2018-10-20 10:56:29 +01:00
Baptiste GelezandGitHub 630ad0920d Merge pull request #279 from PhieF/patch-1
Apache config wasn't working
2018-10-18 19:21:09 +01:00
Baptiste GelezandGitHub 370dafc2dc Merge pull request #280 from anoadragon453/anoa/welcome
Fix Welcome banner grammar
2018-10-18 19:20:45 +01:00
Bat 9d70eeae61 Don't register the media serving route (they are now served with other static files)
And remove some unused imports
2018-10-12 20:48:11 +01:00
Bat dde4583fd3 Database setup in Docker install instructions 2018-10-12 20:41:05 +01:00
Bat ab20fec147 Fix MIGRATION_DIR for Docker 2018-10-12 20:38:54 +01:00
Bat 14969d489c Save medias in static/media
Fixes #272
2018-10-12 20:32:34 +01:00
Baptiste GelezandGitHub f7c37ca6ca Merge pull request #277 from oliof/patch-1
Add caddyserver example configuration
2018-10-12 19:57:14 +01:00
Baptiste GelezandGitHub 8fdb55a501 Merge pull request #256 from Plume-org/verify-signature
Verify activity's signature
2018-10-10 21:31:11 +01:00
Baptiste Gelez 09e7226c23 Don't lowercase URL for requests signatures 2018-10-10 20:23:39 +00:00
Baptiste GelezandGitHub ce09ca14c4 Merge pull request #276 from midzer/patch-1
Update de.po
2018-10-10 17:55:44 +01:00
Bat d77d064a85 Add links to API.md and CLI.md on the docs homepage 2018-10-09 21:39:30 +01:00
Baptiste GelezandGitHub 3901ae835f Merge pull request #274 from Plume-org/logo
New logo!
2018-10-09 20:03:29 +01:00
Bat 1b9c3f69bf Add icons to Web Manifest 2018-10-09 19:38:01 +01:00
Bat 25f47a7951 Add a favicon 2018-10-09 19:23:36 +01:00
Bat 45c31b1c8a Add the new logo the header 2018-10-09 15:37:40 +01:00
Bat d5ba8864c3 Import @trwnh's logos
I would have liked to merge their commits in Plume's repository, but I have no idea how it could be done.

For reference, here is the repository they come from: https://github.com/trwnh/plumeLogos
2018-10-09 15:22:07 +01:00
Bat 3f18cdd38b Add .swp to .gitignore 2018-10-08 20:42:40 +01:00
Baptiste GelezandGitHub da7bfd50d0 Merge pull request #271 from yannicka/master
Update French translation
2018-10-08 20:11:35 +01:00
Bat 3b7842d040 Rocket should manage DbConn, not Option<DbConn>
Otherwise it fails when using DbConn as a request guard
2018-10-08 20:02:17 +01:00
Bat 4f84b2a3ed Impl SQL traits for SafeString only for the selected backend
Fixes #269
2018-10-08 18:58:15 +01:00
Baptiste GelezandGitHub 0469b8dae2 Merge pull request #266 from Plume-org/cc-by-sa
Change default license to CC-BY-SA
2018-10-07 21:28:43 +01:00
Baptiste GelezandGitHub 3a13d80dc6 Merge pull request #267 from Plume-org/db-url
Replace DB_URL with DATABASE_URL
2018-10-07 21:28:28 +01:00
Bat fe3df74986 Fix Docker build (forgot --features)
And update diesel_cli in Docker too
2018-10-07 19:12:10 +01:00
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
2018-10-07 11:00:50 +01:00
Bat 915b9bb0e5 Use env!("CARGO_PKG_VERSION") instead of hardcoding version when possible
See https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates
2018-10-06 18:55:30 +01:00
Baptiste GelezandGitHub 7a64005ca9 Merge pull request #265 from Plume-org/sqlite-docs
Update docs for SQlite
2018-10-06 18:25:23 +01:00
Bat 387efbf3e9 Change default license to CC-BY-SA
Fixes #258
2018-10-06 18:19:45 +01:00
Bat f60f427358 Document --features 2018-10-06 16:39:33 +01:00
Bat a0920eb6cf Rephrase Mac OS dependencies installation 2018-10-06 16:35:39 +01:00
Bat b09360b270 Docs: correct dependencies for SQlite 2018-10-06 16:34:09 +01:00
Baptiste GelezandGitHub 046c9a011e Merge pull request #264 from maximesrd/patch-5
Missing dependencies
2018-10-06 16:29:10 +01:00
Bat f84fb47fe7 Update docs for SQlite 2018-10-06 16:06:50 +01:00
Baptiste GelezandGitHub 00fe11fcbb Merge pull request #261 from Plume-org/setup-tools
CLI tools
2018-10-06 14:28:13 +01:00
Bat 478e9dcac9 Show your own posts in your feed
Fixes #213
2018-10-06 13:42:57 +01:00
Baptiste GelezandGitHub 4b8c090def Merge pull request #249 from Plume-org/delete-posts
Delete posts when deleting account
2018-10-06 13:05:22 +01:00
Bat 4d382d8014 Fix compatibility with SQlite
Also fixes a bug in plume-models
2018-10-06 12:59:08 +01:00
Bat d08c21d58d Delete posts when deleting account 2018-10-06 12:37:28 +01:00
Bat 5fa7a2a742 Remove legacy setup script 2018-10-06 12:31:00 +01:00
Bat caa4c38948 Update installation and update docs with the new plm tool
Also updates the Docker files
2018-10-06 12:19:48 +01:00
Bat d0d1210e21 Document new command-line tools 2018-10-06 12:19:48 +01:00
Bat d48a7796f1 User creation CLI tool 2018-10-06 12:19:48 +01:00