Commit Graph

263 Commits

Author SHA1 Message Date
Kira
bc1218044c Blips 2019-03-01 08:44:29 -08:00
Kira
118459af1b Takedowns 2019-02-23 08:45:10 -08:00
Kira
8126c9ef52 Remove post disapprovals table
Also fix a dumb mistake with approvals.
2019-02-19 20:44:45 -08:00
Liam P. White
47d1e4fc20 Coalesce favorites tables 2019-02-19 22:39:57 -05:00
Kira
43cad3f5e7 Remove post banning functionality
The distinction between file deletion and banning is pretty weird
and there are a bunch of edge cases that make this not worth
trying to maintain a distinction.

Left in the automatic implication code on banned artists because
it looked useful for automating some of the basic tasks that are
done surrounding DNP artists.
2019-02-14 01:44:54 -08:00
Kira
e42cf5ec1e Update SQL structure 2019-02-13 20:08:20 -08:00
Albert Yi
a15b13567d db structure update 2019-01-28 17:28:11 -08:00
evazion
80f43f9a7c Fix #4038: Attempting to create an IP-ban bans the creator.
* Rename comments.ip_addr to comments.creator_ip_addr.
* Fix belongs_to_creator to not clobber ip_addr field.
2019-01-09 16:20:34 -06:00
evazion
f00641b3ac Fix #3998: Some artist histories throw exceptions. 2018-12-02 11:45:57 -06:00
Albert Yi
fe612908cd add creator_ip_addr field to user feedback 2018-11-29 16:51:46 -08:00
Albert Yi
60cee5f452
Merge pull request #3989 from evazion/fix-3987
Wiki pages: convert other_names column to array (#3987)
2018-11-19 16:23:32 -08:00
evazion
41ff05c121 artists: convert other_names to array (#3987). 2018-11-15 14:31:16 -06:00
Albert Yi
0508b127fd continue refactoring savedsearch 2018-11-15 12:06:13 -08:00
evazion
741462ae68 artist versions: convert other_names, url_string to arrays (#3987). 2018-11-14 14:25:02 -06:00
evazion
fe2698a011 tag implications: convert descendant_names to array (#3987). 2018-11-14 12:51:18 -06:00
evazion
308a5021b4 wiki pages: convert other_names to array (#3987). 2018-11-13 19:18:11 -06:00
evazion
fb7d83c54f pools: drop post_count column (fix #3667) 2018-11-08 15:35:41 -06:00
evazion
115ed16a96 pools: store post_ids as array instead of string (fix #3979) 2018-11-08 15:09:31 -06:00
r888888888
192ac128cd add additional meta tags for seo 2018-10-20 17:15:29 -07:00
evazion
4a84ec9e26 artist urls: add trigram indexes on urls. 2018-09-15 19:58:55 -05:00
Albert Yi
7c6ef9f22c Revert "Revert "add prefix index on tags (#3858)""
This reverts commit 6210c1554c.
2018-09-13 11:44:07 -07:00
Albert Yi
6210c1554c Revert "add prefix index on tags (#3858)"
This reverts commit 8c564f055f.
2018-09-12 16:41:52 -07:00
Albert Yi
8c564f055f add prefix index on tags (#3858) 2018-09-12 14:01:21 -07:00
Albert Yi
762dc3da24 Refactor sources 2018-08-24 12:10:51 -07:00
r888888888
334d8b7c6f Add alt_source field on uploads to deal with twitter galleries 2018-08-04 16:32:15 -07:00
Albert Yi
fcd80b6043 Artist urls can be prepended with a '-' to mark is inactive (#3388) 2018-05-16 16:04:05 -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
r888888888
3657cacd17 * post keeper is calculated synchronously
* add fallback mechanism in case archive service is not up
* pass along most recently added tags to any keeper calculation
2018-03-08 16:00:44 -08:00
BrokenEagle
3c45273694
Add category for mod actions 2018-01-13 20:55:52 -08:00
evazion
89b523bdae Fix #3480: NoMethodError error when adding artist tag to post. 2017-12-30 16:07:52 -06:00
Albert Yi
7af5b133c4
Merge branch 'master' into feat-public-favgroups 2017-12-19 15:42:56 -08:00
BrokenEagle
5a602c60eb
Added option to make favorite groups public 2017-12-18 17:30:02 -08:00
evazion
eede2f0752 Fix #3324: Incorporate replacement comment info in the replacement history. 2017-12-18 18:02:43 -06:00
evazion
dd8e3bbb94 tags: add trigram index on tag names. 2017-11-27 15:21:19 -06:00
BrokenEagle
7cb45fc8d3 Added fifth tag category meta 2017-11-07 10:58:42 -08:00
r888888888
c2029b62b5 delayedjob fixes 2017-10-10 15:49:34 -07:00
r888888888
b944b642b8 akismet integration 2017-09-14 13:37:36 -07:00
evazion
f3b0a0a9e9 Remove unused KeyValue model (#3206). 2017-07-09 14:30:44 -05:00
evazion
1aafdc3928 commentaries: migrate columns to non-null. 2017-06-13 16:42:29 -05:00
Type-kun
6947f39136 Synchronize db/structure.sql with migrations (missed in #3006) 2017-06-11 19:17:51 +05:00
evazion
ec9a3e5c17 posts: add partial indexes on is_pending, is_flagged. 2017-06-08 00:00:38 -05:00
evazion
8f98e8e03c posts: redefine source column to be non-NULL (fixes #3090). 2017-05-26 13:54:17 -05:00
evazion
fad4d48b1c search: fix order:note, order:comment_bumped to use indexes. 2017-05-19 18:19:05 -05:00
evazion
a8c1b0bc62 structure.sql: add forum topics (is_sticky, updated_at) index. 2017-05-19 18:19:04 -05:00
r888888888
78b08d8394 add new model for post replacements, add undo functionality 2017-05-12 17:11:40 -07:00
evazion
b48671f59f saved searches: drop unused name and category columns. 2017-04-28 17:22:25 -05:00
r888888888
b053a2d783 add source + rewrite strategy for pawoo 2017-04-20 15:50:22 -07:00
evazion
9816676bfd structure.sql: remove bank_balances, bank_transactions. 2017-04-19 17:08:28 -05:00
evazion
fb0a8e8600 db: add reason index on post_flags, post_appeals. 2017-04-16 21:15:23 -05:00
evazion
cf9b67efb7 db/structure.sql: add index_pools_on_name_trgm migration. 2017-04-16 21:15:23 -05:00
r888888888
76b5031bbf add uniqueness constraint on user names 2017-04-13 18:04:06 -07:00
r888888888
db4fa8c7da support dynamic updates of forum for bulk update requests 2017-04-12 17:09:09 -07:00
r888888888
19b8d41d09 refactor forum notifications for tag changes 2017-04-12 16:43:15 -07:00
evazion
fcc5521f63 db: add updated_at index on wiki pages.
The wiki pages sidebar is ordered by updated_at. The sidebar is present
on all wiki pages, so this improves load times for all wikis.
2017-04-07 18:10:26 -05:00
r888888888
7e40f9363d fixes #2939: <code> Blocks Need CSS Styling 2017-03-27 16:00:43 -07:00
evazion
246eb1e8ab db: add created_at indexes on post_appeals, artist/note/wiki_page versions,
This optimizes queries on /moderator/dashboard that filter by creation date.
2017-03-23 04:05:06 -05:00
r888888888
998a6494ed drop post versions table 2017-03-16 15:56:42 -07:00
r888888888
da06bee0ab revamp saved search implementation 2017-03-15 15:36:48 -07:00
evazion
02122343c3 dmails: don't default IP addr to 127.0.0.1 in database (fixes #2908).
Bug introduced in 1400f64; that commit changed dmails so that
creator_ip_addr defaulted to CurrentUser.ip_addr like this:

    after_initialize :initialize_attributes, if: :new_record?

    def initialize_attributes
      self.from_id ||= CurrentUser.id
      self.creator_ip_addr ||= CurrentUser.ip_addr
    end

...but creator_ip_addr already defaulted to 127.0.0.1 from the database,
so the ||= assignment didn't work. Remove the database default so we
always default to CurrentUser.ip_addr.
2017-03-01 19:51:48 -06:00
evazion
d9349704c7 dmails: add indexes on is_read and is_deleted (fix #2886). 2017-02-18 05:54:40 -06:00
r888888888
bfa56a860c fixes #2415: "Random post" causes RecordNotFound exceptions 2017-01-18 14:12:12 -08:00
evazion
26c193dfb3 Change post_appeals.creator_ip_addr from integer to inet.
The existing values are garbage, rails stored e.g. "87.126.98.245" as
"87.126.98.245".to_i => 87. The column is nulled to indicate these IPs
are unknown.
2017-01-12 09:28:21 +00:00
evazion
3ca638bc92 Add IP addr indexes on comments & artist/artcomm/wikipage versions. 2017-01-12 09:28:21 +00:00
Albert Yi
f2a5d45db0 implement token bucket rate limiting 2017-01-09 17:31:14 -08:00
Albert Yi
c0ae6e8631 drop pool versions table 2016-12-28 16:12:24 -08:00
r888888888
2584646017 add additional formatting for delayed job listing 2016-12-24 18:00:40 -08:00
Albert Yi
5a1ac41450 eliminate transaction log items table 2016-12-21 15:00:59 -08:00
Albert Yi
2dbb869188 keep track of post approvals to prevent approval cycles 2016-10-31 17:51:44 -07:00
Albert Yi
589df5f301 implements #2658: private forum topics 2016-10-24 16:56:18 -07:00
Albert Yi
e78b7d2a8c fixes #2716: Wiki pages should be undeletable 2016-10-18 15:45:50 -07:00
Albert Yi
d5f02abf8c fix saved search test 2016-10-10 17:29:49 -07:00
r888888888
486f59e945 add antivoter resource 2016-09-19 17:07:22 -07:00
r888888888
0a65302f12 remove uniqueness constraint on postupdates 2016-08-22 16:09:20 -07:00
r888888888
3c42df51c9 add framework for post update pushes to pubsub 2016-08-19 17:51:47 -07:00
r888888888
e1c7fbc373 Revert "move post desc to header at top"
This reverts commit 0ab51f3a83.
2016-05-31 11:15:44 -07:00
r888888888
0ab51f3a83 move post desc to header at top 2016-05-28 14:14:32 -07:00
r888888888
30415d9e1e add approver field to aliases/implications 2016-05-26 13:01:44 -07:00
r888888888
2deb3cc3b4 fix for unicorn 2016-02-23 19:22:52 -08:00
r888888888
4b24a5cb7e update to rails 4.2.5.1, add debugging info for tracking slow queries 2016-02-23 16:34:33 -08:00
r888888888
2a87aad34e implement super voters 2016-02-22 14:11:25 -08:00
r888888888
b165fec66a add index on artist group_name 2016-02-19 09:29:03 -08:00
r888888888
b98226fab2 add trigram indexes for artists and pools 2016-02-18 17:30:26 -08:00
r888888888
5eba09f308 improved logic for post fast count 2016-01-03 00:14:04 -08:00
r888888888
5b3a4b768c fixes #2557 2015-12-17 14:29:17 -08:00
r888888888
f66d5c3f02 fixes #2461: Mod queue comments 2015-08-05 13:11:32 -07:00
r888888888
a39e390e24 fixes #2446 2015-07-21 15:26:07 -07:00
r888888888
8ef7462b6b fix tests 2015-07-06 18:32:54 -07:00
r888888888
1d9596d7f2 fixes #2417 2015-06-29 18:17:59 -07:00
r888888888
5dbbc12fe1 add status field to janitor trials #2408 2015-06-12 18:11:39 -07:00
r888888888
b9d8e15ca3 fix safebooru link 2015-05-06 22:47:44 -07:00
r888888888
182b794c8e fixes #2345 2015-02-15 13:01:45 -08:00
r888888888
9e505a0b84 * add new bit_flags column to posts
* conditionally enable embedded notes on a per post basis
2015-01-27 17:11:51 -08:00
r888888888
a07410aece fixes #2337 2015-01-24 12:11:56 -08:00
r888888888
5063e326e3 Revert "remove mpixel search, remove some unused indexes on posts"
This reverts commit 11e550c385.
2015-01-18 22:56:02 -08:00
r888888888
11e550c385 remove mpixel search, remove some unused indexes on posts 2015-01-15 17:43:10 -08:00
r888888888
2b5ce48d5c fixes #2230 2014-11-19 21:28:26 -08:00
r888888888
38d48081a0 log any ffmpeg/mkvmerge errors 2014-10-28 13:38:47 -07:00
r888888888
c9ee4f242f restyle ugoira controls 2014-10-23 16:00:58 -07:00
r888888888
69564c4bff fix async processing for ugoira 2014-10-22 22:48:20 -07:00
evazion
6ca01334af Fix frame data records being created for non-ugoira posts.
* Prevent non-ugoira posts from getting dummy frame data records with
  all the columns set to null.
* Make `data` and `content_type` columns NOT NULL, since they should
  always be present.
* Remove the timestamps while we're at it, since they don't seem
  necessary for anything.
2014-10-19 10:23:28 -05:00
r888888888
4c73fb9f79 add ugoira support in view 2014-10-19 02:30:02 -07:00
r888888888
3bb06c2be4 integrate ugoiras into zip+webm+preview 2014-10-19 02:30:02 -07:00
r888888888
74e1355728 fix tests 2014-09-30 17:24:54 -07:00
r888888888
2b96040a30 fixes #2191 2014-08-12 17:03:16 -07:00
r888888888
6772566665 fixes #2166 2014-07-23 15:15:47 -07:00
r888888888
bb402f5a27 fixes #2197 2014-07-17 16:34:54 -07:00
r888888888
a6d69e63be fixes #2197 2014-07-17 16:24:03 -07:00
r888888888
1253592dc9 fixes #1210 2014-06-22 20:12:06 -07:00
r888888888
f02f72fac1 implement saved searches, move user boolean settings to bitprefs 2014-06-18 16:16:27 -07:00
r888888888
87ef2b8e0f fixes #2190 2014-06-16 17:29:35 -07:00
r888888888
7b97ca192c fixes #2190 2014-06-12 21:16:21 -07:00
r888888888
606f0e002a updated schema 2014-06-02 13:26:50 -07:00
r888888888
a89c57cee0 Fix Rails 4.1 migration issues 2014-04-24 17:01:03 -07:00
r888888888
7edcbf33dd fixes #2108, upgrade to postgresql 9.3, fix tests 2014-04-11 14:15:14 -07:00
r888888888
fa72a16741 upgrade to rails 3.2.17 2014-02-21 16:32:16 -08:00
r888888888
10516c9834 fixes #2100 2014-02-21 13:46:45 -08:00
r888888888
cc9b5a0c61 Create new transaction log table to track user conversions 2014-02-10 13:35:39 -08:00
r888888888
74aecae694 fix dmail test 2014-02-03 12:56:55 -08:00
r888888888
327b52c2d3 add performance test for dtext, fixes #2051 2013-12-03 15:50:58 -08:00
r888888888
016fccbf0a refactor 2013-11-20 16:56:59 -08:00
r888888888
e74dd4613a fix Cache.delete 2013-10-21 11:07:15 -07:00
r888888888
9e45158423 fixes #1099 2013-09-26 17:21:59 -07:00
r888888888
49d2df80f6 add basic support for safe mode 2013-07-17 13:59:44 -07:00
r888888888
774dadf7a5 fixes #1728 2013-06-20 15:10:39 -07:00
r888888888
97a1550d2e potential fix for #1745 2013-06-18 16:10:30 -07:00
r888888888
f16178623b add categories to forum topics 2013-06-06 16:18:04 -07:00
r888888888
9df5952778 typo fix 2013-05-29 13:21:24 -07:00
r888888888
e861425315 stopgap measure for #1210 2013-04-26 17:54:46 -07:00
r888888888
36bbda3d45 fixes #1085 2013-04-18 00:04:51 -07:00
r888888888
6caa0f0436 fix tests 2013-04-14 22:24:55 -07:00
albert
c17ab321be fixes #1224 2013-04-09 15:20:34 -04:00
albert
e305f8e501 fixes #1154 2013-03-31 22:16:31 -04:00
albert
e2c2a8309d add pixiv id search 2013-03-31 14:43:54 -04:00
albert
fc32a0023c add weekly maintenance script 2013-03-31 14:11:48 -04:00
albert
4f8cd6006c fixes for source pattern search, fixed tests 2013-03-29 11:28:01 -04:00
albert
520e97485b add support for user name changes 2013-03-26 01:03:42 -04:00
albert
2378e91006 fixes #841 2013-03-23 12:06:49 -04:00
albert
a4b67fa072 fix tests and typo bugs 2013-03-22 18:54:37 -04:00
albert
4dcc21a97a fixes #948 2013-03-22 10:47:24 -07:00
albert
3e4d149d28 fixes #959 2013-03-22 10:38:37 -07:00
albert
6c54d89a36 * All users can now view deleted posts.
* Posts now have an is_banned flag for artist removal requests.  Basic users can not view banned posts but gold and higher can.
* Banning an artist both deletes the post and bans it.
* By default deleted posts are not filtered out of post searches at the sql level.
2013-03-22 09:38:53 -07:00
albert
8d02918618 remove up/down score from posts 2013-03-21 07:57:32 -07:00
albert
ed70b09e5e fixes #989 2013-03-20 00:13:35 -07:00
albert
0d6ecf25c0 fixes #889 2013-03-18 16:19:09 -07:00
albert
d21c4500d2 fixed tests 2013-03-18 03:26:02 -04:00
albert
a52eb3ddc2 fixes #848 2013-03-17 23:13:47 -04:00
albert
34d7e337ac fixes #911 2013-03-17 21:27:17 -04:00
albert
28a40aeee4 fixes #925 2013-03-17 20:33:25 -04:00
albert
1a03f49adc fixes #775 2013-03-08 15:56:24 -05:00