Commit graph

1059 commits

Author SHA1 Message Date
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
e6bdeb7c4b Fix #699 (#719) 2020-01-12 13:24:41 +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
Violet White
e53574970c Fix issue #705 (#708)
* Fix issue #705

* Add canonical links to blogs too
2019-12-16 22:55:02 +01:00
Marek Ľach
9ede06e7a3 Make the comment syntax consistent across all CSS (#707)
* Update _article.scss

* Update _dark_variables.scss

* Update _forms.scss

* Update _global.scss

* Update _header.scss

* Update _variables.scss
2019-12-16 22:28:48 +01:00
fdb-hiroshima
a9441a8804 Fix lettre (#706)
* Use lettre from crates.io instead of git

* fix previous migration

they were failing on some versions of sqlite and postgres
2019-12-16 20:22:46 +01:00
fdb-hiroshima
6c8944315a remove use of rust in migration (#704)
* remove use of rust in migration

rewrite use_timelines_for_feed in pure sql
delete tantivy related migration. It will require reintroducing tantivy
initialisation in docs

fix #702

* Fill timeline from migrations

should fix #692 , but probably require some testing
2019-12-14 21:06:07 +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
Ana Gelez
7f296b2ef2
Use the "classic" editor by default (#697) 2019-11-16 18:53:27 +01:00
Marek Ľach
c66ef5f85d Fix the navigation menu not opening on touch (#690)
* Fix iOS menu issue

* Fix burger menu iOS trigger

* Modify the menu script to work on iOS too

* Update main.rs

* Update main.rs

* Update main.rs
2019-11-16 18:52:30 +01:00
Christopher James Halse Rogers
df6f398efc Various snap fixes (#698)
* snap: Store media in the proper directory

* snap/set-environment: Exit successfully when not enabled.

This lets us unconditionally run things under `set-environment` and let it
handle the case where the necessary configuration hasn't yet been set.

* snap: Set the version based on git tags

This will make the version something like `0.3.0-alpha-2-65-g29178aa` at the moment,
as that was the most recent tag, but the commit tagged as `0.4.0` will get *that* as
the version

* snap: Force-install cargo-web

This makes building the *second* time work; otherwise there might be
an existing cargo-web install, and cargo will refuse to overwrite it.
2019-11-16 13:19:46 +01:00
fdb-hiroshima
c484ca6afe make search items optional (#693)
* make search items optional

cf https://github.com/Plume-org/Plume/issues/692#issuecomment-550224029

* eindente
2019-11-10 15:37:51 +01:00
Violet White
f0846ff546 Make the search index creation during migration respect SEARCH_INDEX (#689)
* Make the search index creation during migration respect SEARCH_INDEX

* Make the search subcommand respect it too
2019-11-03 17:51:10 +01:00
Violet White
c0469c69c1 Add autosaving to the editor (#688)
* Add autosaving to the editor

* It saves the subtitle, tags, and license now

* Save the cover too

* Fix broken autosave again

* Use set_value instead of a multitude of setters. Implement debouncing

* Remove unsafe code, remove generic getters when possible
2019-11-02 15:14:41 +01:00
Ana Gelez
865f372d5a
Add a sample .env file (#687)
* Add a sample .env file

As requested in https://github.com/Plume-org/docs/pull/60

* Keep domain names consistent
2019-10-30 15:38:39 +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
dd6d39135e re-add empty strings in translation (#682) 2019-10-24 16:44:14 +02:00
Violet white
028c4fdbc6 Fix that bug :D 2019-10-24 12:05:13 +02:00
Ryo Nakano
b4882533f8 Escape href quotation marks (#678) 2019-10-17 09:12:24 +02:00
Ryo Nakano
fc9e69d811 Don't split sentences for translations (#677) 2019-10-16 20:07:58 +02: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
Christopher James Halse Rogers
a0e3fe8c94 snap: Fix build for non-Tier-1 Rust platforms (#672) 2019-10-05 13:28:45 +02:00
Christopher James Halse Rogers
e54fffccdf
snap: *Another* fix for building (#668) 2019-09-20 09:26:04 +02:00
Christopher James Halse Rogers
b36e12b654 snap: Ensure cargo-web doesn't erroneously adopt our workspace. (#667) 2019-09-18 16:24:15 +02:00
Christopher James Halse Rogers
b5eecbf2e7 Add Snapcraft metadata and install/maintenance hooks (#666)
* Add Snapcraft metadata and install/maintenance hooks

* Move set-environment script into snap/local

* snap: Remove diesel-cli part.

This *was* necessary as of 0.3.0, but now `plm migrations run` does the job.

* snap: Add an actual description

* snap: Add an 'enabled' config item.

Don't try to run until enabled is set, and automatically run the
migrations when we are enabled
2019-09-16 12:33:25 +02:00
Ana Gelez
309e1200d0 Make a distinction between moderators and admins (#619)
* Make a distinction between moderators and admins

And rework the user list in the moderation interface, to be able to run the same action on many users,
and to have a huge list of actions whithout loosing space.

* Make user's role an enum + make it impossible for a moderator to escalate privileges

With the help of diesel-derive-enum (maybe it could be used in other places too?)

Also, moderators are still able to grant or revoke moderation rights to other people, but maybe only admins should be able to do it?

* Cargo fmt

* copy/pasting is bad

* Remove diesel-derive-enum and use an integer instead

It was not compatible with both Postgres and SQlite, because for one it generated a schema
with the "User_role" type, but for the other it was "Text"…

* Reset translations

* Use an enum to avoid magic numbers + fix the tests

* Reset translations

* Fix down.sql
2019-09-13 12:28:36 +02:00
fdb-hiroshima
12c80f9981 delete notification on user deletion (#658)
* delete notification on user deletion

fix #651

* use the correct id for deletion

* add regression test

* push helpers too

* revert CI changes
2019-09-13 11:29:52 +02:00
Ana Gelez
d4a1bd6de7 Fix logo URL (#664) 2019-09-06 10:06:16 +02:00
fdb-hiroshima
d46af6fe5b order media so that latest added are top (#660)
* order media so that latest added are top

partial fix for #621

* also order paginated medias
2019-08-28 11:37:03 +02:00
fdb-hiroshima
ddbec3f204 fill entirely user on creation (#657)
fix #635
2019-08-27 22:28:40 +02:00
fdb-hiroshima
83cad55b22 update default license (#659)
fix #595
2019-08-27 21:47:45 +02:00
fdb-hiroshima
bf7603d439
don't index drafts (#656) 2019-08-27 18:40:59 +02:00
Ana Gelez
8ab690001d Replace the input! macro with an Input builder (#646)
* Replace the input! macro with an Input builder

* Use a BTreeMap instead of an HashMap

Followinf @fdb-hiroshima's advice

* Rename Input::to_html to Input::html

To make clippy happy

* Wrap error messages in red paragraphs
2019-08-27 16:50:24 +02:00
Requiem
935d331e97 Fix issue #642, frontend not in english if the user language does not exist (#648)
* syntax and names

* Solve the issue #642, by searching index of english language code in catalog.
2019-08-23 11:02:24 +02:00
Ana Gelez
28fb50438e
Fix theme caching (#647) 2019-08-21 21:41:11 +02:00
Ana Gelez
a6c84daa1a
Theming (#624)
* Theming

- Custom CSS for blogs
- Custom themes for instance
- New dark theme
- UI to choose your instance theme
- Option to disable blog themes if you prefer to only have the instance theme
- UI to choose a blog theme
2019-08-21 00:42:04 +02:00
fdb-hiroshima
fb60236a54
update dependancies (#643)
* 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
2019-08-14 15:04:30 +02:00
fdb-hiroshima
4f7c20fc26 Fix some federation issue (#573)
* send scheme as part of webfinger remote follow template

fix tsileo/microblog.pub#49

* bump webfinger to 0.4.1

* cargo fmt

* revert translations

* Use group: prefix for blog webfinger queries
2019-07-31 11:38:49 +02:00
Mostafa Ahangarha
54c6d21fc5 WIP - initial RTL support #575 (#577)
* initial RTL support

* fix dir in template-util

* fix dir in blogs new

* fix dir in blogs details

* fix dir in posts new

* fix dir in posts details

* fix dir in posts remote

* Fix dir in partials

some parts should be recheck carefully in real usage
2019-07-11 09:34:27 +02:00
Wilfried OLLIVIER
c031804464 Add clap to plume in order to print help and version (#631)
* Add clap in order to print help and version

Related to https://github.com/Plume-org/Plume/issues/594

* Update after_help text message
2019-07-03 19:36:42 +01:00
fdb-hiroshima
5289fe872a
don't ignore dotenv errors (#630) 2019-07-03 09:30:44 +02:00
Baptiste Gelez
7ea4acc289
Use futures and tokio to send activities (#620)
* 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
2019-06-27 17:46:05 +01:00
Baptiste Gelez
6dbc043a7e
Update some documents (#616)
* Redirect to the code of conduct in the docs

To centralize it, and because the version in the docs is more up-to-date

* Remove obsolete issue template

* Rework README
2019-06-15 21:42:24 +01:00
KemoNine
fb1668ede7 Update dependencies which depended on nix -- fixes arm32 builds (#615) 2019-06-14 09:35:09 +02:00
Igor Galić
3d27e283ad
add enum containing all successful route returns (#614)
* add enum containing all successful route returns

This enum derives `Responder`, so it can be used as route result.
We also implement `From`, so it can be converted

* disable clippy warning about this enum

There's no use trying to chase this warning.
The next warning will be about `Redirect`, which itself is 360 byte,
according to @fdb-hiroshima (thanks for the research!)

So, if anything, we can try to get Rocket to work on that!

* refactor routes/posts to only use one level of Result

* admin settings error is not an ErrorPage, so dont use Result<>

* refactor: use early return to remove indent of main logic

This diff is absolutely atrocious.
but the resulting readability is worth it

* refactor routes/post for early returns & RespondOrRedirect

* refactor routes/session for early returns & use RespondOrRedirect

* refactor routes/user -- add another field to enum

* refactor routes/blogs for early returns & RespondOrRedirect

* refactor routes/blogs for early returns & RespondOrRedirect

This is a final refactor of `pub fn update()` for readability.
We're removing at least one indentation level.
2019-06-14 09:33:30 +02:00
Rob Watson
4b205fa995 Store password reset requests in database (#610)
* Store password reset requests in database

Signed-off-by: Rob Watson <rfwatson@users.noreply.github.com>

* Refactor password reset request expiry handling

* Integrate sqlite

* Fix formatting
2019-06-04 19:55:17 +01:00
KemoNine
e7126ae335 Fix arm builds (#612) 2019-06-04 19:18:36 +01:00
Marek Ľach
b2312d7f1b Update textarea overflow to scroll (#609)
* Update textarea overflow to scroll

* Update _forms.scss

* Update _forms.scss
2019-06-02 21:35:09 +01:00