Commit Graph

114 Commits

Author SHA1 Message Date
Tarrgon
9a9f175da4
[DText] Add newline normalization (#699) 2024-11-10 20:22:40 -08:00
Tarrgon
9453a82644 [DMails] Allow janitors to bypass rate limits (#696) 2024-08-03 02:25:42 -07:00
Earlopain
fc7d84affd
[RuboCop] Enable Style/FrozenStringLiteralComment
This reduces allocations on the posts page by about 5%, from basic testing
2024-02-25 18:15:55 +01:00
Earlopain
6c623496a2
[Users] Stop using has_mail bitflag 2024-02-23 17:18:22 +01:00
Earlopain
56e849695b
[Cleanup] Remove readonly only
Since its introduction 3 years ago, it got used once I believe
I can't even say if this properly works anymore.

If something like that is actually desired in the future, it should just be a whitelist instead
2024-02-23 16:48:56 +01:00
Donovan Daniels
6b2b2cfc14
[DMails] Add marking as unread (#620)
* [DMails] Add marking as unread

* Tweak wording to be same as "Mark all as read", dmail capitalization
2024-02-23 16:39:59 +01:00
Earlopain
16014a438f
[Dmails] Partially enable api
Basically everything except sending
2023-12-17 19:55:13 +01:00
Earlopain
26ed6928ba
[Dmails] Tweak rate limit
* Lower hourly limit
* Add daily limit
2023-09-17 17:57:17 +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
79bada3392
[Search] Unify user lookup
There was lots of duplication between id/name searching, with a plethora
of different approaches. Now it's all in one place.
A few places that didn't have name/id search previously now do.
2023-08-04 20:46:59 +02:00
Earlopain
300866fe94
[Dmails] Add option to not send email notifications 2023-06-02 16:04:49 +02:00
Earlopain
ba0f9872c3
[DB] Drop dedicated index columns and their triggers
Their usage was removed in 5215876862
2023-02-22 19:37:13 +01:00
Earlopain
5215876862
[DB] Remove usage of dedicated index columns
The index for posts is also getting added, but will get used at a later date
If this turns out to work fine the materialized index colums can be dropped

This contains a semantic change where dmail and wiki page searches for the body
no longer includes matches for the title
2023-02-19 20:01:54 +01:00
Earlopain
f6b53dd0d3
Merge branch 'moderator-role' 2023-01-11 17:05:37 +01:00
Earlopain
b0be3b1946
[Cleanup] Remove unnecessary requires 2022-12-17 17:42:09 +01:00
Earlopain
665f432e17
[Users] Allow moderators to handle tickets 2022-11-28 16:21:40 +01:00
Earlopain
0e60ac29f9
[Cleanup] Remove mb_chars usage
Ruby 2.4 supports this natively
2022-04-09 14:23:12 +02:00
Earlopain
5a88be7d2d
[Cleanup] Remove spam detection
Checked for is_gold, which doesn't work anyways
2022-03-05 16:05:53 +01:00
bitWolfy
21ed3764ce Merge branch 'master' into formatting-helper 2021-11-17 01:54:29 -08:00
Earlopain
061176e095
[Setup] Ignore limits when seeding
This makes the environment config understand booleans. If something
ends with "?" it tries to interpret it as a boolean. A bunch of
existing configs where changed to reflect this change.
2021-11-14 22:16:36 +01:00
bitWolfy
db8cf6cb74 [UI] Add formatting buttons to DText inputs 2021-10-31 20:30:37 -07:00
Earlopain
bd93c61e77
[ReadOnly] Add basic read-only mode 2021-07-18 17:50:57 +02:00
Kira
931e25e627 [Dmails] Fix send limit without memoization 2021-06-19 10:20:30 -07:00
Kira
9bbc5afe28 [Rails] More deprecation warnings 2021-02-25 12:08:09 -08:00
Kira
80c72e9ca6 [Admin] Allow admins to see auto_moderator dmails as needed 2020-10-29 16:40:46 -07:00
Kira
e9cf9111da [DMail] Pinhole admin dmail limits 2020-09-06 10:14:27 -07:00
Kira
d90765278e [Dmail] Dmail debugging 2020-09-06 07:28:30 -07:00
Kira
6b5afe0192 [DMail] Fix exception if recipient not found 2020-05-05 19:58:15 -07:00
Kira
409ece688f Allow bypassing dmail limits from internal functions 2020-03-12 19:36:08 -07:00
Kira
3d06c741e4 Fix dmail sorting order 2020-03-07 12:13:12 -08:00
Kira
d078acab8a Allow blocking dmails 2019-10-03 07:33:48 -07:00
Kira
b64d223b46 Update validations to use new syntax 2019-09-05 05:59:51 -07:00
Kira
62829370d7 Length limits on most things 2019-09-05 00:26:18 -07:00
evazion
30ee20a570 dmails: factor out spam detector service. 2019-08-28 20:48:31 -07:00
evazion
9b3919fef4 dmails: drop unneeded methods. 2019-08-18 13:59:34 -07:00
Kira
03de07a2a1 Bunch of dumb little fixes related to user level changes 2019-06-30 11:16:05 -07:00
Kira
9fa294ba31 Convert gold -> privileged for user level 2019-06-29 08:45:58 -07:00
Kira
c819a34443 Add user based action throttles 2019-06-29 05:29:21 -07:00
Kira
b5db278311 Test and bring tickets closer to completion
Add links to report items to all of the reportable areas of the
site.

Fix a lot of errors surrounding views and bad expectations from
the old codebase.

Change how dmails can be viewed to match the old logic. This prevents
users from creating links to their own dmails that can be shared with
moderators, and instead forces them to be reported.

Sets are still not implemented, so the reporting area for them has
not been tested or revised. That will happen at a later phase when
sets go in.
2019-03-14 19:10:33 -07:00
evazion
03abbd0683 Fix #2894: Use [[:space:]] instead of \s in regexes. 2018-09-20 19:24:38 -05:00
evazion
0eff095a3e Refactor searching text attributes.
* Allow using ApplicationRecord#attribute_matches to search text attributes,
and standardize models on using this instead of duplicating code.

* Remove restrictions that limited wildcard searches to Builders only in various places.
2018-08-31 19:50:46 -05:00
Albert Yi
a0aa2f3f4a fixes #3276 2018-05-15 14:30:28 -07:00
Albert Yi
99012ff342 fix tests 2018-05-09 11:59:51 -07:00
evazion
216d735f24 Fix #3696: API: handle boolean params consistently
* Use ApplicationRecord#attribute_matches to handle boolean attributes
  consistently in search methods.

* Add support for searching various boolean attributes that previously
  weren't supported.
2018-05-03 19:57:14 -05:00
evazion
c7492343ce String: add truthy? & falsy? core extensions.
* Add `truthy?` and `falsy?` core extensions to String.

* Use `truthy?` and `falsy?` to replace ad-hoc parsing of boolean
  parameters in various places.
2018-05-03 19:57:14 -05:00
Albert Yi
72e7f706df fix scoping bug in dmail 2018-04-27 15:04:27 -07:00
Albert Yi
664a3f02e2 fixes for failed cron maintenance tasks
* update rails scripts for 5.2
* system dmails should be scoped to system
* fix broken url generator in forum notices
2018-04-27 15:01:40 -07:00
Albert Yi
b0a3f574ed fixes #3574 2018-04-25 14:31:11 -07:00
r888888888
abce4d2551 Raise error on unpermitted params.
Fail loudly if we forget to whitelist a param instead of silently
ignoring it.

misc models: convert to strong params.

artist commentaries: convert to strong params.

* Disallow changing or setting post_id to a nonexistent post.

artists: convert to strong params.

* Disallow setting `is_banned` in create/update actions. Changing it
  this way instead of with the ban/unban actions would leave the artist in
  a partially banned state.

bans: convert to strong params.

* Disallow changing the user_id after the ban has been created.

comments: convert to strong params.

favorite groups: convert to strong params.

news updates: convert to strong params.

post appeals: convert to strong params.

post flags: convert to strong params.

* Disallow users from setting the `is_deleted` / `is_resolved` flags.

ip bans: convert to strong params.

user feedbacks: convert to strong params.

* Disallow users from setting `disable_dmail_notification` when creating feedbacks.
* Disallow changing the user_id after the feedback has been created.

notes: convert to strong params.

wiki pages: convert to strong params.

* Also fix non-Builders being able to delete wiki pages.

saved searches: convert to strong params.

pools: convert to strong params.

* Disallow setting `post_count` or `is_deleted` in create/update actions.

janitor trials: convert to strong params.

post disapprovals: convert to strong params.

* Factor out quick-mod bar to shared partial.
* Fix quick-mod bar to use `Post#is_approvable?` to determine visibility
  of Approve button.

dmail filters: convert to strong params.

password resets: convert to strong params.

user name change requests: convert to strong params.

posts: convert to strong params.

users: convert to strong params.

* Disallow setting password_hash, last_logged_in_at, last_forum_read_at,
  has_mail, and dmail_filter_attributes[user_id].

* Remove initialize_default_image_size (dead code).

uploads: convert to strong params.

* Remove `initialize_status` because status already defaults to pending
  in the database.

tag aliases/implications: convert to strong params.

tags: convert to strong params.

forum posts: convert to strong params.

* Disallow changing the topic_id after creating the post.
* Disallow setting is_deleted (destroy/undelete actions should be used instead).
* Remove is_sticky / is_locked (nonexistent attributes).

forum topics: convert to strong params.

* merges https://github.com/evazion/danbooru/tree/wip-rails-5.1
* lock pg gem to 0.21 (1.0.0 is incompatible with rails 5.1.4)
* switch to factorybot and change all references

Co-authored-by: r888888888 <r888888888@gmail.com>
Co-authored-by: evazion <noizave@gmail.com>

add diffs
2018-04-06 18:09:57 -07:00