Commit Graph

1665 Commits

Author SHA1 Message Date
Earlopain
7dcaf81979
[Uploads] Don't follow redirects to non-whitelisted urls
Also improves the existing tests a bit by being checking the error message
2023-10-20 21:00:32 +02:00
Earlopain
cc6e18797a
[Uploads] Correctly follow redirects
Some sites serve urls that redirect by default. This would append the
"You are being redirected" html to the file being downloaded after that
and subsequently report that text/html is not a valid format
2023-10-15 13:52:38 +02:00
Earlopain
2620ea983e
[Wiki] Better diffing view 2023-10-15 13:08:28 +02:00
Earlopain
3a58ac0938
Switch to OpenSearch (#550)
Run the following commands to import data into OpenSearch:

Post.document_store.create_index!
PostVersion.document_store.create_index!
Post.document_store.import
PostVersion.document_store.import

* Add opensearch client

* Add url param to force use opensearch

* Switch import method over to opensearch

* Index to opensearch as well

* Add option to gradually roll out os

* Index os with separate queue

* Move os post creation to job as well

* Exclusively use the OpenSearch client

* Stop enqueuing OsIndexUpdateJob

* Remove remaining elasticsearch code

Bump faraday since v2 is no longer blocked
2023-10-02 18:57:07 +02:00
Earlopain
a0c56446fa
Merge pull request #548 from e621ng/remove-elasticsearch-model
Remove elasticsearch-model
2023-09-18 20:29:56 +02:00
Earlopain
632b611c4c
[Dmails] Fix senders copy being created when validations fail 2023-09-17 16:40:33 +02:00
Earlopain
9e2c7b2b5b
[Cleanup] Remove ban check when sending dmails
Banned users can't login in the first place
2023-09-17 14:38:43 +02:00
Earlopain
b6dc473a55
[Elasticsearch] Bring back the proxy object 2023-09-16 17:09:33 +02:00
Earlopain
b4e16fa0fd
[Elasticsearch] Implement Response 2023-09-16 15:30:28 +02:00
Earlopain
be71bf7a16
[Elasticsearch] Move implementation to own folder 2023-09-16 14:29:04 +02:00
Earlopain
3285d546f9
[Elasticsearch] Move index creation to DocumentStore 2023-09-14 21:53:26 +02:00
Earlopain
855388b092
[Elasticsearch] Remove a few more easy usages of __elasticsearch__ 2023-09-14 20:56:56 +02:00
Earlopain
a79e25dfbd
[Elasticsearch] Start implementing own elasticsearch-model
This implements create_index!
2023-09-14 20:49:19 +02:00
Earlopain
0f842b9da0
[Tests] Remove wasteful post after_create hook
Not needed anymore.
Tests went from 95 seconds to 82 on my machine.
2023-09-08 21:33:25 +02:00
Earlopain
c53b2eff60
[Tests] More performance improvements
Most of the gained time is because some post tests don't recreate the
elastic index twice now.
Tests go from 107 seconds to 95 on my machine.
2023-09-08 19:51:35 +02:00
Earlopain
de4068ade8
[Tests] Clear elasticsearch before tests run
Previously they were only created if they didn't exist.
Data from previous test runs was still present.
2023-09-08 19:17:47 +02:00
Earlopain
499d447352
[Users] Fix custom css
The constraint applies to all user routes, which includes `custom_style`.
Also fixes a constant redefinition warning in the console when doing `reload!`
2023-09-07 21:08:55 +02:00
Earlopain
4c6f4fe104
[CI] Appease rubocop 2023-09-07 17:32:50 +02:00
Earlopain
d5b64b1712
[Tests] Improve execution time of some of the worst offenders
From 112 seconds to 107 on my machine
Not much all things considered but most of the time is still spend on
elasticsearch, especially when forcefully recreating the index
2023-09-07 17:04:34 +02:00
Earlopain
a5f5543e85
[Tests] Remove unused fixture files 2023-09-07 16:41:20 +02:00
Donovan Daniels
115c140cc2
[Posts] Make comment_disabled not hide comments (#546)
* [Posts] Make comment_disabled not hide comments

* [VoteManager] Disallow voting on locked/disabled comments

* [Comments] Disable editing/hiding disabled & locked comments

* Tweaking

* Allow hiding when comments locked
* Don't allow mods to vote when comments locked
* Change wording from disabled to locked everywhere

---------

Co-authored-by: Earlopain <14981592+Earlopain@users.noreply.github.com>
2023-09-05 17:27:05 +02:00
Earlopain
c51029ea1e
[ModActions] Stop logging name changes
These are not mod actions, anybody can do that. Only log when admins
force change names.
Don't show old/new names, we already don't show that on user profiles.
2023-09-04 23:02:14 +02:00
Earlopain
177558b5d5
[TagQuery] Use consistent naming for tag fields 2023-09-03 15:23:27 +02:00
Earlopain
b2c7b338c0
[TagQuery] Improve description search
These all works:
* description:test
* description:"multiple words followed by each other"
* description:"multiple words followed by each oth*"
2023-09-03 15:12:40 +02:00
Earlopain
be75cf3349
[QueryBuilder] Fix searching by tag counts 2023-08-31 08:57:47 +02:00
Earlopain
8b133570c0
Merge pull request #543 from e621ng/search-improvements
Search improvements
2023-08-29 18:54:42 +02:00
Earlopain
b65741456f
[QueryBuilder] Move count validation into the query class 2023-08-24 13:43:01 +02:00
Earlopain
c8d7bebd72
[QueryBuilder] Move parsing code into own class
Introduces the concept of "free" tags to account for automatically added tags.
Introduce `resolve_aliases` which can be used instead of `raw_tag_match`
2023-08-24 13:16:44 +02:00
Earlopain
9848c18ace
[QueryBuilder] Move value parsing into separate module
Also add some tests
2023-08-23 14:18:51 +02:00
Earlopain
1621e6e110
[QueryBuilder] Rename range parsing methods for clarity
Also replace a bit of the regex matching with more explicit code.
2023-08-22 23:23:08 +02:00
Earlopain
b7b9a8c400
[Users] Remove the contributor rank
We don't use that anymore. Next one up is former staff, so the checks
look a bit goofy now.
2023-08-21 21:24:31 +02:00
Earlopain
f193e159eb
[QueryBuilder] Introduce methods to handle common search actions 2023-08-19 18:37:15 +02:00
Earlopain
d579c845f3
[Cleanup] Remove duplicate tag query scan method 2023-08-19 11:20:00 +02:00
Earlopain
b4a7a5ba3d
[Cleanup] Remove unused tag methods 2023-08-18 23:08:42 +02:00
Earlopain
c9a084e0a3
[Tags] Take category id instead of name for related search
Also have the bulk response return something with more structure to it
2023-08-18 22:40:06 +02:00
Earlopain
36eb87b084
[Cleanup] Move tag data outside of config file
Most of that is not easily configurable and requires db fields, css classes etc.
Everything in TagCategory was also pretty much incomprehensible for me
thanks to the indirection, so I moved it all inline instead.
I'll clean that up in later commits.
2023-08-18 19:08:52 +02:00
Earlopain
3aecc36b3e
[Users] Fix exception when refreshing counts 2023-08-15 14:13:58 +02:00
Earlopain
d6bfa02694
[Replacements] Fix approving when hitting the upload limit
Also improves the error message that was being returned because
just saying 'pending' isn't really helpful
2023-08-11 17:39:33 +02:00
Earlopain
3f03182dfb
[Cleanup] Remove a test-only method 2023-08-11 17:30:43 +02:00
Earlopain
e6d3fabc2a
[Posts] Don't unflag if approving on the show page
My previous commit on the matter says that this was intented behaviour
and always like that but it's just unexpected
2023-08-07 20:23:13 +02:00
Earlopain
2ce42c49e3
[Users] Add replacements to the hourly upload limit 2023-08-05 12:29:38 +02:00
Earlopain
42abd4ca33
[UserRevert] Fix error when user has uploaded a post
Extended version of #530

Co-authored-by: Donovan Daniels <hewwo@yiff.rocks>
2023-08-01 18:20:39 +02:00
Earlopain
52bc715a28
[Posts] Add edit reason when reverting/undoing a version 2023-08-01 17:24:14 +02:00
Earlopain
66c66af58c
[Users] Fix switching names not updating the cache correctly
Regressed in7df64409d6
update_cache was not updated to normalize the username
2023-07-31 23:14:39 +02:00
Earlopain
12e996dc08
[Tags] Fix category for non-existant tags
Regressed in 4cd32c5f87
Caching nil as a category can cause problems in a bunch of places
2023-07-31 21:36:20 +02:00
Earlopain
eb7033dbc2
[Artists] Fix reverting removing urls when validations fail 2023-06-18 16:13:08 +02:00
Earlopain
e154c70e6c
Merge pull request #527 from faucetlol2/e
[Tags] Disallow é in tag names
2023-06-13 22:00:01 +02:00
Earlopain
1dfd0bdbad
[Tests] Fix wiki page revert after previous commit
Yet another CurrentUser issue
2023-06-11 12:48:00 +02:00
faucet
cbe809fed5
[Tags] Disallow é in tag names 2023-06-10 17:46:04 +01:00
Earlopain
d8c0a83fb4
[Tests] Suppress sidekiq redis log message 2023-06-08 20:39:14 +02:00