remove tag-prefix deletion
as discussed here: https://github.com/igalic/Plume/pull/1
Update all versions numbers
Update Crowdin config to v3 + Pull translations with cargo release
Follow a more standard CHANGELOG format
add release.toml configuration file for cargo-release
and also add overrides in all other crates, since we only have one
CHANGELOG.md: https://github.com/sunng87/cargo-release/issues/205
we might wanna have that looked at or fixed
ignore .vscode/
add / backfill Changelog.md
Co-authored-by: Mina Galić <me+git@igalic.co>
Co-authored-by: Ana Gelez <ana@gelez.xyz>
Reviewed-on: https://git.joinplu.me/Plume/Plume/pulls/835
before we embark on upgrading to async, and all the refactoring that
this will bring on us (see #797 & #799), we should keep our `main`
branch as stable and current as possible.
Let's start by upgrading rocket and its dependencies.
* [REFACTORING]Use DocumentContext during parsing Markdown
* Add test case for hash in link
* Make DocumentContext derive Debug
* Add in_link field in DocumentContext
* Don't make hash words tags in link
* Add test for atmark in link
* Don't make atmark words in link mentions
* Add test for Persian language hashtags
See https://github.com/Plume-org/Plume/issues/757
* Add regex-syntax with unicode-perl feature to dependencies
* Install regex-syntax
* Allow hashtag to use Unicode word characters
* Run cargo fmt
* update compiler to recent nightly
* cargo fmt
* fix clippy
but ructe code is still complaining
* update circleci and rocket_csrf
* fix last clippy problems
* cargo fmt
* fix build issue
was caused be improper handling of recursive template (comment) by old ructe, which is fixed on newer version
* Syntax highlighting mostly... Exists.
* Add dependency to dockerfile
* Handle non-existent languages better
* Make the default a bit nicer
* Improve highlighting. Clean up function
* Add dark theme, add the comment scope to the allowed classes
* update build env
* Address review comments
* Use find_syntax_by_token which produces the desired behavior
* Change flat_map into flatten
(commit cargo.lock)
* Bump activitystreams-derive from 0.1.0 to 0.1.1
* Bump tantivy from 0.9.1 to 0.10.1
* Bump rpassword from 3.0.2 to 4.0.1
* Bump num_cpus from 1.10.0 to 1.10.1
* Bump serde_qs from 0.4.6 to 0.5.0
* Bump stdweb-internal-runtime from 0.1.3 to 0.1.4
* [Security] Bump smallvec from 0.6.9 to 0.6.10
* Bump chrono from 0.4.6 to 0.4.7
* Bump bcrypt from 0.4.0 to 0.5.0
* Bump serde_json from 1.0.39 to 1.0.40
* Bump tokio from 0.1.21 to 0.1.22
* Bump scheduled-thread-pool from 0.2.0 to 0.2.2
* Bump stdweb from 0.4.14 to 0.4.18
* Bump hyper from 0.12.29 to 0.12.33
* Bump reqwest from 0.9.17 to 0.9.19
* Bump url from 1.7.2 to 2.1.0
* Use futures and tokio to send activities
* Reset .po files
* Cargo fmt + small enhancements
- better error messages
- removed a TODO
* Log all messages at the same time when federation succeeds
* add shrinkwraprs and implement Id thru it
This also means we can automatically convert Id to String without using
.into()!
* cleanup with the help of clippy!
* cleanup with the help of cargo fmt!
* remove extra block
* Shrinkwrap Page, ContentLen and RemoteForm
* translations
[Security] Bump ammonia from 2.0.0 to 2.1.1
Bump bcrypt from 0.2.2 to 0.4.0
Bump clap from 2.32.0 to 2.33.0
Bump colored from 1.7.0 to 1.8.0
Bump ctrlc from 3.1.1 to 3.1.2
Bump diesel from 1.4.1 to 1.4.2
Bump dotenv from 0.13.0 to 0.14.0
Bump hyper from 0.12.25 to 0.12.28
Bump openssl from 0.10.19 to 0.10.22
Bump proc-macro2 from 0.4.27 to 0.4.30
Bump reqwest from 0.9.11 to 0.9.16
Bump rpassword from 2.1.0 to 3.0.2
Bump serde_derive from 1.0.80 to 1.0.82
Bump serde_derive from 1.0.89 to 1.0.91
Bump serde from 1.0.89 to 1.0.91
Bump serde_qs from 0.4.5 to 0.4.6
Bump stdweb from 0.4.14 to 0.4.17
Bump syn from 0.11.11 to 0.15.27
Bump whatlang from 0.7.0 to 0.7.1
* Big refactoring of the Inbox
We now have a type that routes an activity through the registered handlers
until one of them matches.
Each Actor/Activity/Object combination is represented by an implementation of AsObject
These combinations are then registered on the Inbox type, which will try to deserialize
the incoming activity in the requested types.
Advantages:
- nicer syntax: the final API is clearer and more idiomatic
- more generic: only two traits (`AsActor` and `AsObject`) instead of one for each kind of activity
- it is easier to see which activities we handle and which one we don't
* Small fixes
- Avoid panics
- Don't search for AP ID infinitely
- Code style issues
* Fix tests
* Introduce a new trait: FromId
It should be implemented for any AP object.
It allows to look for an object in database using its AP ID, or to dereference it if it was not present in database
Also moves the inbox code to plume-models to test it (and write a basic test for each activity type we handle)
* Use if let instead of match
* Don't require PlumeRocket::intl for tests
* Return early and remove a forgotten dbg!
* Add more tests to try to understand where the issues come from
* Also add a test for comment federation
* Don't check creation_date is the same for blogs
* Make user and blog federation more tolerant to errors/missing fields
* Make clippy happy
* Use the correct Accept header when dereferencing
* Fix follow approval with Mastodon
* Add spaces to characters that should not be in usernames
And validate blog names too
* Smarter dereferencing: only do it once for each actor/object
* Forgot some files
* Cargo fmt
* Delete plume_test
* Delete plume_tests
* Update get_id docs + Remove useless : Sized
* Appease cargo fmt
* Remove dbg! + Use as_ref instead of clone when possible + Use and_then instead of map when possible
* Remove .po~
* send unfollow to local instance
* read cover from update activity
* Make sure "cc" and "to" are never empty
and fix a typo in a constant name
* Cargo fmt
Upgrade rust-toolchain
Upgrade Tantivy
Warning: tantivy now use a different file format, search index may need to be deleted and recreated to work as intended
try to run compile twice in a row because sometime oomk is evil
Also adds a parameter to `md_to_html` to only render inline elements (so that we don't have titles or images in blog descriptions). And moves the delete button for the blog on the edition page.
I still have to update the SQLite migration once others PRs with migrations will be merged.
Also, there will be a problem when you edit a blog while not owning its banner or icon: when validating they will be reset to their default values… I don't see a good solution to this until we have a better way to handle uploads with Rocket (the same is probably happening for articles btw).
And the icon/banner are not federated yet, I don't know if I should add it to this PR or if it can come after?
![image](https://user-images.githubusercontent.com/16254623/53894510-7d853300-4030-11e9-8a2c-f5c0b0c7f512.png)
![image](https://user-images.githubusercontent.com/16254623/53894539-8b3ab880-4030-11e9-8113-685a27be8d7c.png)
Fixes#453Fixes#454
* Bump serde from 1.0.82 to 1.0.84
* Bump ructe from 0.5.4 to 0.5.6
* Bump colored from 1.6.1 to 1.7.0
* Bump itertools from 0.7.11 to 0.8.0
* Bump ammonia from 1.2.0 to 2.0.0
* Bump hyper from 0.12.19 to 0.12.20
* Bump serde_derive from 1.0.80 to 1.0.84
* Bump stdweb from 0.4.12 to 0.4.13
* Bump rsass from 0.9.4 to 0.9.6
* Bump failure from 0.1.3 to 0.1.5
* Bump reqwest from 0.9.5 to 0.9.8
* Bump serde_derive from 0.7.1 to 0.8.0
- 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)
* 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
* Remove use of String for body parameters
Create SignedJson and implement FromData for it
* Make Travis test on release
* Remove warning when installing and fix coverage
* 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
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
* 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
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
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.
The code is divided in three crates:
- plume-common, for the ActivityPub module, and some common utils
- plume-models, for the models and database-related code
- plume, the app itself
This new organization will allow to test it more easily, but also to create other tools that only reuse a little part of
the code (for instance a Wordpress import tool, that would just use the plume-models crate)