Commit Graph

1107 Commits (refactor/extract-searcher-with-dbpool)
 

Author SHA1 Message Date
Mina Galić 8f0fe5aaf9
remove Searcher from PlumeRocket and add a FromRequest to retrieve it
this will not compile, so now it's time to fix the rest
4 years ago
Mina Galić a5c81498b2
plume-models: fix test compilation 4 years ago
Ana Gelez fefd7ef9b6
Wrap Searcher in an Arc only in main 4 years ago
Ana Gelez a52b8393a2
Introduce Searcher::new
This function does what was previously done in main:
create a search index, and try to recover for errors
if possible.

This commit also fixes plume-cli to use the new Searcher
API (that depends on a DbPool, not on a single Connection).
4 years ago
Ana Gelez b9514d5711
Avoid unwrapping, return an Error instead 4 years ago
Mina Galić 56689af1ba
plume-model: refactor Searcher to have its own DbPool
this way, we don't need to pass along a conn into the function.
This should make splitting PlumeRocket up into its components a little
easier. This PR is another attempt at fixing #799.
4 years ago
kiwii fc474bf8d1 Merge pull request '[BUG FIX]Make it possible to switch to rich text editor' (#808) from KitaitiMakoto/Plume:richtexteditor into main
Reviewed-on: Plume/Plume#808
Reviewed-by: kiwii <kiwii@noreply@joinplu.me>
4 years ago
Kitaiti Makoto a050deb557 [BUG FIX]Make it possible to switch to rich text editor 4 years ago
kiwii 6de9a1f1c8 Merge pull request 'Recreate search index if its format is outdated' (#802) from KitaitiMakoto/Plume:invalid-index into main
Reviewed-on: Plume/Plume#802
Reviewed-by: Mina Galić <me+git@igalic.co>
4 years ago
Kitaiti Makoto 5e30bede40 Don't care about needless return value of closures 4 years ago
Kitaiti Makoto 5cca66b346 Add action user can take to error message 4 years ago
Kitaiti Makoto 484659fde2 Run cargo fmt 4 years ago
Kitaiti Makoto 5fc827c1c9 Re-initialize search index when recreating is failed 4 years ago
Kitaiti Makoto 50753b3a65 Recreate search index if its format is outdated 4 years ago
Kitaiti Makoto c5d03d300b Cause IndexInvalidDataError when search index is invalid 4 years ago
kiwii 010eac6c4a Merge pull request 'upgrade rocket* to the latest stable' (#800) from igalic/Plume:update/rocket into main
Reviewed-on: Plume/Plume#800
Reviewed-by: kiwii <kiwii@noreply@joinplu.me>
4 years ago
Mina Galić a107d35492
upgrade rocket* to the latest stable
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.
4 years ago
Kitaiti Makoto f9beb2383b Update lindera-tantivy to v0.1.3 4 years ago
Chosto 7e78cffcaa
Bump Docker base images to buster flavor (#797) 4 years ago
TheMasix 28576c1fa3
Add Vazir Font (#787)
* Add Vazir Font

* Add Vazir Font License

* fix prettier problem

* Shabnam added
4 years ago
Gelez d99b42582d
Add Persian to the list of languages (#782) 4 years ago
KITAITI Makoto 92a386277b
Switchable tokenizer (#776)
* [REFACTORING]Rename whitespace_tokenizer to tag_tokenizer for
registration

Name representing its purpose is preferred.

* Add lindera-tantivy to plume-model's dependencies

* Install lindera-tantivy

* Add SearchTokenizerConfig struct

* Add search tokenizers to config option

* Use CONFIG for tokenizers

* Use enum to hold tokenizer config instead of initializing on config phase

* Use guard instead of duplicate default values

* Use as_deref() instead of guard

* Move SearchTokenizer from plume-models to plume-models::search::tokenizer

* Rename SearchTokenizer to TokenizerKind

* Define SearchTokenierConfig::determine_tokenizer()

* Use determine_tokenizer in SearchTokenizerConfig::init()

* Pass tokenizer config to Searcher methods

* Add LowerCase filter to Lindera tokenizer

* Add test for Lindera tokenizer

* Define SEARCH_LANG env to specify tokenizers set

* Run cargo fmt

* Make Lindera tokenizer optional

* Fix typos
4 years ago
Gelez 297d9fcf40
Don't show boosts and likes for "all" and "local" in timelines (#781)
Fixes #711
4 years ago
KITAITI Makoto ef70cb93e6
Upgrade Tantivy to v0.12.0 (#771)
* Upgrade Tantivy to 0.12.0

* Follow Tantivy Tokenizer's new type definition

* Wrap tokenizers with TextAnalyzer to use filter methods

* Replace async IndexWriter::garbage_collect_files with sync functions

* Update Cargo.toml
4 years ago
Daniel Watkins efb76a3c17
remove dependency on runtime-fmt (#773)
Per the issue, "runtime-fmt uses perma-unstable rust APIs and is
therefore susceptible to breakage".

This replaces the two calls to rt_format! with .replace() and drops the
dependency.

Fixes #769
4 years ago
KITAITI Makoto 197f0d7ecd
Add test for hash including ZWSP (#772)
* Add test for hash including ZWSP

* Run cargo fmt
4 years ago
KITAITI Makoto 3be842c653
Make database connections configurable by environment variables (#768)
* Make env DB_MAX_SIZE and DB_MIN_IDLE recognizable

* Make database max size and minimum idle configurable

* Restore file permission

* Fail fast
4 years ago
KITAITI Makoto dabe904642
Escape expressions in @Html (#767) 4 years ago
KITAITI Makoto 180e34b07c
Fix Atom feed datetime format (#766) 4 years ago
KITAITI Makoto 847d6f7fac
Fix Atom feed (#764)
* Percent-encode URI segments in ap_url

* Fix invalid Atoms

* Remove redundant clone according to cargo clippy

* Revert "Percent-encode URI segments in ap_url"

This reverts commit 8253aa79bd6efd120c1f2d3c2872deda9609ff3a.
ActivityPub(JSON-LD) accepts URI.
See https://github.com/Plume-org/Plume/pull/764#issuecomment-623105734

* Use absolute IRI for IDs in Atom

* Reuse formatted string

* Use parent element's creation date for Atom updated if there's no post

* Remove uncecessary UTC conversion

* Extract routes::build_atom_feed function
4 years ago
KITAITI Makoto 6a3f210dfc
Keep atmarks and hashes in link (#765)
* [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
4 years ago
KITAITI Makoto 73aa301d4a
Fix user subscription URI so that plume::routes:interact accept it (#762) 4 years ago
KITAITI Makoto b3d367b174
Use plural form for 0 in French (#760)
See https://github.com/Plume-org/Plume/issues/745
4 years ago
KITAITI Makoto edaccd1a31
Fixes #757 Allow Unicode hashtags (#758)
* 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
4 years ago
Floréal Toumikian e1bd2eab75
Updated: Cargo.lock (#753) 4 years ago
KITAITI Makoto ac7a05b09a
Make blocklist deletion possible (#750) 4 years ago
KITAITI Makoto 71e0a35e06
Use LenientForm instead Form for CSRF protected pages (#751) 4 years ago
KITAITI Makoto c217e5e9b3
Move stylesheets for header from _global.sccss to _header.scss (#749) 4 years ago
KITAITI Makoto 8ba0c17db5
Build app and po files before upload pos to Crowdin (#748) 4 years ago
Floréal Toumikian 4e43c676b4
Fixed: #713: Disply likes and boosts on post cards (#744)
This is a basic and simple way to display them. No interaction possible.

Alos, this patch is not optimised. as everytime a partial post_card is
called, `Post::count_likes()` and `Post::count_reshares()` are called
which means quite a few more quesies are sent to database unless diesel
uses some cache mechanisem.

A way to enhance this this would be to keep a count of likes and reshares
are kept in Post model / table.
4 years ago
KITAITI Makoto b834d1c282
Fix #701 Preferable default theme (#746)
* Make it possible to update users.preferred_theme to NULL

* Make preferred them null when 'Default theme' is selected

* Run cargo fmt
4 years ago
Kenneth Steimel 506fe9955d
Fixed #734 , passowrds are now hidden on the remote_interact pages (#741)
* Fixed #734 , passowrds are now hidden on the remote_interact pages

* Update templates/remote_interact_base.rs.html

Co-Authored-By: Floréal Toumikian <floreal+github@nimukaito.net>

Co-authored-by: Floréal Toumikian <floreal+github@nimukaito.net>
4 years ago
KemoNine 02c528cae4
Bump llvm -> 9.0.0 (fixes arm builds) (#737) 4 years ago
Christopher James Halse Rogers 2a58835f92
Snapcraft updates (#731)
* snap: Update rust compiler

* snap: Fix the build.

We now need libclang

* snap: Fix the non-x86 builds.

The goddamned environment variable is SNAPCRAFT_ARCH_TRIPLE*T*

* snap: Mark as stable.

The snap works fine; we don't need to warn people away
4 years ago
Ana Gelez 5f8d6b8e0e Rust 2018! (#726) 4 years ago
fdb-hiroshima 3663bffe5c Update compiler (#725)
* 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
4 years ago
KemoNine 72464fb428 Add missing dep on clang needed for crate builds (#724) 4 years ago
Wilfried OLLIVIER 23049b638c WIP: Fix RSS issues (#720)
* Add id field to RSS feed

* Add published field to RSS feed
4 years ago
Violet Myers f3c05dae62 Email blocklisting (#718)
* Interface complete for the email blacklisting

* Everything seems to work

* Neutralize language

* fix clippy warnings

* Add missing spaces

* Added matching test

* Correct primary key datatype for postgresql

* Address review comments

* Add placeholder when empty. Fix missing 'i'
4 years ago
Violet Myers e6bdeb7c4b Fix #699 (#719) 4 years ago