Commit Graph

459 Commits

Author SHA1 Message Date
Kitaiti Makoto a599760891 Use smtp module from plume_models instead of lettre directly 2022-01-03 17:36:11 +09:00
Kitaiti Makoto 00324f668f Add port field to MailConfig 2022-01-03 17:25:46 +09:00
Kitaiti Makoto 0836e3d693 Add Lettre to plume-models' dependencies 2022-01-03 17:09:47 +09:00
Kitaiti Makoto 0058c3053d Move mail config from plume::mail::mailer to plume_models::CONFIG 2022-01-03 15:50:04 +09:00
Kitaiti Makoto 5532b4a4d7 Ensure Post ap_url 2022-01-03 02:21:34 +09:00
Kitaiti Makoto f0e7ea5640 (cargo-release) version {{version}} 2022-01-03 01:17:07 +09:00
Kitaiti Makoto ef628aa498 (cargo-release) version {{version}} 2022-01-02 20:41:28 +09:00
Kitaiti Makoto c67b702425 Cache LOCAL_INSTANCE_USER once 2021-12-05 20:57:10 +09:00
Kitaiti Makoto e01539ef16 Follow Clippy 2021-12-05 20:24:11 +09:00
Kitaiti Makoto 5651e11ba1 Add FIXME comment 2021-12-05 20:22:10 +09:00
Kitaiti Makoto d98132db80 Don't log unnecessary error 2021-12-05 19:32:27 +09:00
Kitaiti Makoto 25fe2ad802 Use request::get() instead of ClientBuilder 2021-12-05 19:32:27 +09:00
Kitaiti Makoto 12a8d00f8e Cache local instance user for test 2021-12-05 19:32:27 +09:00
Kitaiti Makoto b9ea06a01a Don't stop even when caching local instance user 2021-12-05 19:32:27 +09:00
Kitaiti Makoto 1e67b3c13c Create local instance user on caching if it doesn't exist 2021-12-05 19:32:27 +09:00
Kitaiti Makoto f4d7dfb261 Sign GET request to other instances 2021-12-05 19:32:27 +09:00
Kitaiti Makoto af5b0b961b Extract Instance::create_local_instance_user() from get_local_instance_user_uncached() 2021-12-05 19:32:27 +09:00
Kitaiti Makoto 1506802c20 Implement LOCAL_INSTANCE_USER and related methods 2021-12-05 19:32:27 +09:00
Kitaiti Makoto 897ea8e11e Change const name: LOCAL_INSTANCE_USER -> LOCAL_INSTANCE_USERNAME 2021-12-05 19:32:27 +09:00
Kitaiti Makoto 858806149a Use concrete Error for Signer 2021-12-05 19:32:27 +09:00
Kitaiti Makoto 0da9572627 Implement User::get_local_instance_user() 2021-12-05 19:32:27 +09:00
Kitaiti Makoto 94cc260803 Add Instance to users::Role 2021-12-05 19:32:27 +09:00
Kitaiti Makoto ae3344f318 Follow Rust and crates update 2021-11-28 08:06:29 +09:00
Kitaiti Makoto 89c185f819 Specify Rocket and serde_json version loosely 2021-11-28 08:06:29 +09:00
Kitaiti Makoto 811db1be0e Stick serde_json versoin for plume-models 2021-11-26 08:53:55 +09:00
Kitaiti Makoto 0fbefe2cdc Percent-encode Post slug on sending Activity to other instances 2021-09-07 13:31:06 +09:00
Kitaiti Makoto 83dbf2a945 Upgrade bcrypt 2021-08-14 19:20:21 +09:00
Tdxdxoz a946823554 Specify rocket version 2021-07-06 22:36:59 +08:00
Kitaiti Makoto dfcdcc1833 Remove heck from plume and plume-models 2021-04-10 16:39:23 +09:00
Kitaiti Makoto 6345a57498 Don't modify article title for slug 2021-04-10 16:37:26 +09:00
Kitaiti Makoto 87457c0ed1 Define Post::slug() 2021-04-10 16:30:50 +09:00
Kitaiti Makoto 7b2bab0f9d Extract Post::ap_url() 2021-04-09 10:55:09 +09:00
Kitaiti Makoto 4c2cd92f0d Prevent duplicated posts in 'all' timeline 2021-03-29 23:33:57 +09:00
Kitaiti Makoto 9e5ec0c9df Calculate media URI properly even when MEDIA_UPLOAD_DIRECTORY configured 2021-03-29 02:29:15 +09:00
Kitaiti Makoto ebb0b45299 Create blog_authors only when needed 2021-03-28 04:26:17 +09:00
Kitaiti Makoto 702aa11ecf Don't drop path components of image URI 2021-03-28 04:26:17 +09:00
Kitaiti Makoto 33221d386e Upsert Post in from_activity() 2021-03-28 04:26:17 +09:00
Kitaiti Makoto 589c159eb9 Call Post::publish_updated() only for local posts 2021-03-28 04:26:17 +09:00
Kitaiti Makoto ea1f4d48d5 Upsert Media in from_activity() 2021-03-28 04:26:17 +09:00
Kitaiti Makoto 462c5a1d42 Define Media::find_by_file_path() 2021-03-28 04:26:17 +09:00
Kitaiti Makoto 8e50d95a7a Fix code according to clippy 2021-03-28 03:46:37 +09:00
Kitaiti Makoto 77c08845b5 [BUG FIX]Make SearchActor subscribe to channel once 2021-03-27 23:55:26 +09:00
Kitaiti Makoto 2bfc26faf2 [BUG FIX]Make RemoveFetchActor subscribe to channel once 2021-03-27 23:54:09 +09:00
Kitaiti Makoto 451c3b5c88 Add TODO comments 2021-02-18 11:35:39 +09:00
Kitaiti Makoto af5674074d Revert "Save remote post only when it doesn't exist on local"
This reverts commit 37cbf537bb.
2021-02-18 11:34:20 +09:00
Kitaiti Makoto 28380021a7 Determine file path of mirror of remote image using the URI 2021-02-18 01:23:57 +09:00
Kitaiti Makoto 37cbf537bb Save remote post only when it doesn't exist on local 2021-02-16 23:48:09 +09:00
Kitaiti Makoto b2e7664339 Extract User::acct_authority() method 2021-02-14 22:14:44 +09:00
Kitaiti Makoto 5ba823990a Don't panic in loop 2021-02-01 01:36:36 +09:00
Kitaiti Makoto c82c38fe52 Comment on database connections 2021-02-01 01:16:52 +09:00
Kitaiti Makoto 6401cb6fb7 Define User::remote_user_found() and publish_remote_user_found() 2021-02-01 00:48:22 +09:00
Kitaiti Makoto 9d37408535 Define RemoteFetchActor 2021-01-31 22:56:17 +09:00
Kitaiti Makoto ded64e1cf0 Add USER_CHAN 2021-01-31 22:55:52 +09:00
Kitaiti Makoto 3b766fc427 Define UserEvent 2021-01-31 22:55:28 +09:00
Kitaiti Makoto ad285898f6 Replace PlumeRocket.conn with DbConn 2021-01-31 21:58:44 +09:00
Kitaiti Makoto 78be49d57d Make tests follow API changes 2021-01-31 21:58:44 +09:00
Kitaiti Makoto 25e52788c5 Replace PlumeRocket with DbConn where possible 2021-01-31 21:58:09 +09:00
Kitaiti Makoto 5d25a64f13 Remove DbConn from PlumeRocket 2021-01-31 21:58:09 +09:00
Kitaiti Makoto f9e7d2bb23 Remove all instances before testing 2021-01-25 00:06:40 +09:00
Kitaiti Makoto 8b00853e88 Make instance for search actor remote 2021-01-25 00:06:35 +09:00
Kitaiti Makoto b5eb2628f9 Don't remove records after testing 2021-01-24 23:30:20 +09:00
Kitaiti Makoto be99fe5f99 Implement Post::get_blog_fqn() 2021-01-20 10:38:32 +09:00
Kitaiti Makoto c3c8f6804b Remove transaction from test search::tests::search for CI 2021-01-16 16:39:12 +09:00
Kitaiti Makoto 6dd730030d Wrap Post in PostEvent with Arc
See https://github.com/riker-rs/riker/issues/153
2021-01-16 16:39:12 +09:00
Kitaiti Makoto 6c1dd6608d Add test for search actor 2021-01-16 16:39:12 +09:00
Kitaiti Makoto 42fb0cf825 Use pattern match instead of unwrap() 2021-01-16 16:39:12 +09:00
Kitaiti Makoto 2483303138 SearchActor waits for transaction commit 2021-01-16 16:39:12 +09:00
Kitaiti Makoto 47e67d9b64 Add methods to clear data of instances and users table for testing 2021-01-16 16:39:12 +09:00
Kitaiti Makoto 1d042e1bb2 Add methods to clear data of instances and users table for testing 2021-01-16 16:39:12 +09:00
Kitaiti Makoto 31418b1079 Fix search::tests::search to use searcher directly instead of actor 2021-01-16 16:39:12 +09:00
Kitaiti Makoto 68d79bfa9c Publish PostUpdated only when the post is published 2021-01-16 16:39:12 +09:00
Kitaiti Makoto a46b718937 Ignore search::tests::search 2021-01-16 16:39:12 +09:00
Kitaiti Makoto a0cd9dd6bd Fix tests to follow API changes 2021-01-16 16:39:12 +09:00
Kitaiti Makoto fc8ee1c3bc Remove searcher from arguments of Post::delete() and dependented methods 2021-01-16 16:38:18 +09:00
Kitaiti Makoto 2a8cc5f3ba Send event to channel when post deleted 2021-01-16 16:36:14 +09:00
Kitaiti Makoto 864379fb81 Remove searcher from arguments of Post::update() 2021-01-16 16:34:36 +09:00
Kitaiti Makoto aae2073146 Send event to channel when post updated 2021-01-16 16:33:29 +09:00
Kitaiti Makoto 6ad3359609 Remove searcher from arguments of Post::insert() 2021-01-16 16:25:36 +09:00
Kitaiti Makoto 6a2ba2260d Send event to channel when post published 2021-01-16 16:25:36 +09:00
Kitaiti Makoto ccbf2124cb Run cargo fmt 2021-01-16 16:22:39 +09:00
Kitaiti Makoto a733ece26e Suppress clippy 2021-01-16 16:22:39 +09:00
Kitaiti Makoto 16624fd742 Run cargo fmt 2021-01-16 16:22:39 +09:00
Kitaiti Makoto 1bfed0294f Define SearchActor::init() 2021-01-16 16:22:39 +09:00
Kitaiti Makoto d4d32bcc11 Define ACTOR_SYS and POST_CHAN 2021-01-16 16:22:39 +09:00
Kitaiti Makoto 0a148721de Define SearchActor 2021-01-16 16:22:39 +09:00
Kitaiti Makoto cfe097edf4 Define PostEvent 2021-01-16 16:22:39 +09:00
Kitaiti Makoto 578768d7df Remove unnecessary attribute to suppress clippy 2021-01-16 16:22:39 +09:00
Kitaiti Makoto 996dc309f7 Make Searcher::open_or_create() accept path and tokenizers 2021-01-16 16:22:38 +09:00
Kitaiti Makoto 09d9164a1c Extract Searcher::open_or_recreate() from main() 2021-01-16 16:22:38 +09:00
Kitaiti Makoto 43f32d30cb Add once_cell to dependdencies 2021-01-16 16:22:38 +09:00
Kitaiti Makoto b1d7b3969d Add Riker to dependencies 2021-01-16 16:20:49 +09:00
Kitaiti Makoto 7d17b12000 Upgrade lindera-tantivy to 0.7.1 2021-01-16 13:34:15 +09:00
Kitaiti Makoto 26ffde726f Run cargo fmt 2021-01-16 01:13:45 +09:00
Kitaiti Makoto 3fd89e6b48 Remove unnecessary wraps 2021-01-16 01:05:42 +09:00
Kitaiti Makoto 4a15bef34f Impl From<ListType> for i32 instead of Into<i32> for ListType 2021-01-16 00:49:34 +09:00
Kitaiti Makoto 0775c8f3f9 Fix redundant method chains 2021-01-15 23:19:47 +09:00
Kitaiti Makoto 4cdc1a3655 Use char instead of one length &str 2021-01-15 23:01:37 +09:00
Kitaiti Makoto bbd415c392 Use strip_prefix() instead of range access 2021-01-15 23:00:15 +09:00
Kitaiti Makoto a236f33269 Remove unused macro_use 2021-01-15 22:38:40 +09:00
Kitaiti Makoto 9b593c76e4 Remove unused doc comments 2021-01-15 22:36:59 +09:00
Kitaiti Makoto 012c8d2026 Remove redundant imports 2021-01-15 22:35:19 +09:00
Kitaiti Makoto cb05571339 Upgrade tantivy to 0.13.3 2021-01-15 10:19:54 +09:00
Aiden McClelland 24aac22b89
proxy support 2021-01-11 13:27:52 -07:00
KitaitiMakoto 76ec0d2b13 Merge pull request 'Initialize tracing subscriber' (#875) from init-tracing into main
Reviewed-on: https://git.joinplu.me/Plume/Plume/pulls/875
2021-01-11 00:24:54 +00:00
Kitaiti Makoto 4a4534d6f3 Run cargo fmt 2021-01-11 09:05:31 +09:00
Kitaiti Makoto 044a24eac8 Remove SQLite journal files 2021-01-10 10:27:53 +09:00
Kitaiti Makoto becb40544c Replace println!()s with logging macros 2021-01-06 21:40:14 +09:00
Kitaiti Makoto 7f1b33a567 Add tracing crate to dependences 2021-01-06 21:40:07 +09:00
KitaitiMakoto e7d17caf9d Merge pull request 'Update crates' (#858) from update-crates into main
Reviewed-on: https://git.joinplu.me/Plume/Plume/pulls/858
2021-01-02 14:23:45 +00:00
Kitaiti Makoto fe05f9a58e cargo fmt 2021-01-02 22:54:46 +09:00
Kitaiti Makoto f1990b782d Fix tests 2021-01-02 22:15:26 +09:00
Trinity Pointard fdb58215c0 add dir to allowed attributes 2021-01-02 00:26:56 +01:00
Kitaiti Makoto 4025a45d52 Upgrade whatlang 2020-12-30 22:36:47 +09:00
Kitaiti Makoto 8a6d832513 Upgrade rocket 2020-12-30 22:35:24 +09:00
Kitaiti Makoto 0b0b3a158f Upgrade diesel 2020-12-30 22:31:02 +09:00
Kitaiti Makoto eaf63e0b17 start next development iteration 2020-12-29 18:01:18 +09:00
Kitaiti Makoto 7e1abc527f Re-version to v0.6.0 2020-12-29 16:27:20 +09:00
Kitaiti Makoto 2a5a2ec4d2 (cargo-release) start next development iteration {{next_version}} 2020-12-19 11:24:59 +00:00
Kitaiti Makoto 106e9417d3 (cargo-release) version {{version}} 2020-12-19 11:24:59 +00:00
Kitaiti Makoto 1eaa5a6e31 Add pre-release-hook to release.toml of subcrates to prevent running
one of root crate
2020-12-19 11:24:59 +00:00
Kitaiti Makoto 2047355d46 Validate attributedTo in the case it is an object 2020-12-19 11:24:59 +00:00
Kitaiti Makoto beaeaf743a Add test for preventing spoofing 2020-12-19 11:24:59 +00:00
KitaitiMakoto f5b18dffaf cargo release helper (again) (#835)
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
2020-12-06 15:52:27 +00:00
Kitaiti Makoto 4e6d7b70cf Keep tags as-is 2020-11-22 22:24:43 +09:00
Trinity Pointard 3de009713d try fixing clippy and fmt 2020-10-08 20:24:03 +02:00
Trinity Pointard 69bcb01715 fix test following ldap udpate 2020-10-08 19:59:54 +02:00
Trinity Pointard 4da9b24cb1 cargo fmt 2020-10-07 23:40:27 +02:00
Trinity Pointard f40634aa97 address comments 2020-10-07 23:39:38 +02:00
Trinity Pointard 8975b0f9e9 cargo fmt 2020-10-04 12:18:54 +02:00
Trinity Pointard d626f3366d add support for ldap 2020-10-04 12:18:22 +02:00
Trinity Pointard b24f195e10 refactor login
first step toward ldap
should have no functionnal change
2020-10-03 13:21:31 +02:00
Kitaiti Makoto 484659fde2 Run cargo fmt 2020-07-18 22:52:39 +09:00
Kitaiti Makoto c5d03d300b Cause IndexInvalidDataError when search index is invalid 2020-07-18 09:40:47 +09:00
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.
2020-07-17 09:38:55 +02:00
Kitaiti Makoto f9beb2383b Update lindera-tantivy to v0.1.3 2020-07-05 17:59:51 +02:00
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
2020-06-17 16:57:28 +02:00
Gelez 297d9fcf40
Don't show boosts and likes for "all" and "local" in timelines (#781)
Fixes #711
2020-06-15 19:50:28 +02:00
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
2020-05-20 13:31:45 +02:00
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
2020-05-06 19:27:59 +02:00
KITAITI Makoto 73aa301d4a
Fix user subscription URI so that plume::routes:interact accept it (#762) 2020-05-02 12:07:45 +02:00
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
2020-04-12 17:36:00 +02:00
Ana Gelez 5f8d6b8e0e Rust 2018! (#726) 2020-01-21 07:02:03 +01:00
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
2020-01-19 12:52:32 +01:00
Violet White 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'
2020-01-12 19:41:35 +01:00
Violet White 458baf5f78 Syntax highlighting (#691)
* 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)
2019-12-30 14:35:27 +01:00
Ana Gelez 597778fd2f release Alpha 4 (#709)
* Update version numbers

* Update translations again

* Translations?

* This time translations should be here
2019-12-22 15:04:09 +01:00
Wilfried OLLIVIER 3bd2305115 Fix #637 : Markdown footnotes (#700)
* Ensure footnotes classes generated are not filtered

pulldown-cmark add somes classes when footnotes html is generated. This commit ensure they are not filtered by html sanitizer

* Add some footnotes styling
2019-11-20 16:16:38 +01:00
Violet White 52d860d402 Paginate the outbox responses. Fixes #669 (#681)
* Paginate the outbox responses. Fixes #669

* Address Ana's review

* Make outbox_fetch page through instance outboxes

* Fix infinite loop in fetch_outbox

* Fix off by one
2019-10-30 11:22:28 +01:00
Violet White 866465c603 Add environmental variable to control path of media (#683) 2019-10-28 22:28:28 +01:00
fdb-hiroshima 006b44f580 Add support for generic timeline (#525)
* Begin adding support for timeline

* fix some bugs with parser

* fmt

* add error reporting for parser

* add tests for timeline query parser

* add rejection tests for parse

* begin adding support for lists

also run migration before compiling, so schema.rs is up to date

* add sqlite migration

* end adding lists

still miss tests and query integration

* cargo fmt

* try to add some tests

* Add some constraint to db, and fix list test

and refactor other tests to use begin_transaction

* add more tests for lists

* add support for lists in query executor

* add keywords for including/excluding boosts and likes

* cargo fmt

* add function to list lists used by query

will make it easier to warn users when creating timeline with unknown lists

* add lang support

* add timeline creation error message when using unexisting lists

* Update .po files

* WIP: interface for timelines

* don't use diesel for migrations

not sure how it passed the ci on the other branch

* add some tests for timeline

add an int representing the order of timelines (first one will be on
top, second just under...)
use first() instead of limit(1).get().into_iter().nth(0)
remove migrations from build artifacts as they are now compiled in

* cargo fmt

* remove timeline order

* fix tests

* add tests for timeline creation failure

* cargo fmt

* add tests for timelines

* add test for matching direct lists and keywords

* add test for language filtering

* Add a more complex test for Timeline::matches, and fix TQ::matches for TQ::Or

* Make the main crate compile + FMT

* Use the new timeline system

- Replace the old "feed" system with timelines
- Display all timelines someone can access on their home page (either their personal ones, or instance timelines)
- Remove functions that were used to get user/local/federated feed
- Add new posts to timelines
- Create a default timeline called "My feed" for everyone, and "Local feed"/"Federated feed" with timelines

@fdb-hiroshima I don't know if that's how you pictured it? If you imagined it differently I can of course make changes.

I hope I didn't forgot anything…

* Cargo fmt

* Try to fix the migration

* Fix tests

* Fix the test (for real this time ?)

* Fix the tests ? + fmt

* Use Kind::Like and Kind::Reshare when needed

* Forgot to run cargo fmt once again

* revert translations

* fix reviewed stuff

* reduce code duplication by macros

* cargo fmt
2019-10-07 19:08:20 +02:00