Commit Graph

873 Commits

Author SHA1 Message Date
Albert Yi
6839249e9d add logic for persisting pixiv sessions in tests 2018-05-10 13:59:57 -07:00
Albert Yi
5bca31bad1 add retry monkey patch for mechanize 2018-05-09 16:45:03 -07:00
Albert Yi
e23814be92 fix pixiv agent shutdown 2018-05-09 16:13:47 -07:00
Albert Yi
d4a2521eec reset connection for pixiv tests 2018-05-09 14:59:18 -07:00
Albert Yi
59dde72924 fix pixiv tests, install ffmpeg 2018-05-09 14:11:34 -07:00
Albert Yi
0f2e6a9a1b fix tests 2018-05-09 12:45:37 -07:00
Albert Yi
99012ff342 fix tests 2018-05-09 11:59:51 -07:00
Albert Yi
79ea6f7e6c Add Docker and Travis config files to enable CI tests
Also fixes some Rails 6.0 deprecation warnings
2018-05-09 09:56:38 -07:00
Albert Yi
3b8a1703ff Merge pull request #3701 from evazion/fix-3579
Fix #3579: Add post approval index
2018-05-07 17:36:41 -07:00
Albert Yi
23bef55632 Merge pull request #3700 from evazion/fix-3659
Fix uploads getting stuck in 'processing' state (fix #3659)
2018-05-07 17:36:03 -07:00
evazion
7c1d5e25fb post approvals: add index page + search options (fix #3579). 2018-05-05 14:00:49 -05:00
evazion
181a906766 Fix #3695: Bookmarklet breaks on pixiv fanbox direct image links. 2018-05-05 12:21:11 -05:00
evazion
c584ca5b19 Fix uploads getting stuck in 'processing' state (fix #3659).
Bug: if an upload timed out while downloading the file, Upload#process!
would catch the error and attempt to retry, but since the upload was
already in the 'processing' state, on the second try `process!` would
bail out immediately and leave the upload stuck in the 'processing' state.

Fix: remove the retry logic from Upload#process!. Let Downloads::File#download!
(which had its own retry logic) handle it instead.
2018-05-05 11:42:40 -05:00
evazion
0836e4b850 tests: fix upload tests.
Fix some uploads tests that got mixed up when merging abce4d2 (see also d089be9).
2018-05-05 11:20:21 -05:00
evazion
59ab9820b0 tests: fix FactoryGirl reference. 2018-05-03 20:37:23 -05:00
evazion
4fd4cbd2a6 twitter: fix tests. 2018-04-28 12:33:05 -05:00
Albert Yi
d4b1782431 allow more forum posts to be voted on (fixes #3677) 2018-04-27 16:18:31 -07:00
Albert Yi
f2b525a6d2 Implement forum topic voting and tag change pruning (#3580) 2018-04-26 15:31:06 -07:00
Albert Yi
8b98e9e009 additional tests to look for causes of incorrect post count on pools (#3667) 2018-04-26 11:14:01 -07:00
Albert Yi
b0a3f574ed fixes #3574 2018-04-25 14:31:11 -07:00
evazion
c4ae2bd2fa Fix #3654: Deviantart commentaries fail fetching. 2018-04-18 18:44:56 -05:00
Albert Yi
2f142ab1aa Merge pull request #3643 from evazion/fix-3642
Fix #3642: Issues with sequential pagination
2018-04-16 16:16:22 -07:00
evazion
e49e6f49bb Fix #3641: Can't add tags via Add Commentary dialog. 2018-04-16 12:12:28 -05:00
evazion
d2e2b3d2b1 pagination: add paginator tests. 2018-04-14 10:56:16 -05:00
evazion
302994e5d9 Fix #3639: Favorite count pixiv tags aren't skipped by translated tags. 2018-04-13 22:39:52 -05:00
Albert Yi
06559c4ae4 fix missing urls in artists (fixes #3632) 2018-04-13 12:25:49 -07:00
evazion
159b0e8a22 tests: add daily & weekly maintenance tests. 2018-04-11 22:33:28 -05:00
Albert Yi
d9d98f05c2 Merge branch 'rails-5.1' 2018-04-11 11:40:36 -07:00
evazion
ab25e73cd7 deviantart: replace html scraper with api client (#3260). 2018-04-09 20:53:14 -05:00
evazion
2cbec785ea Fix #3613: Broken preview images for flash files. 2018-04-08 11:49:30 -05: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
evazion
01eda51020 tests: add webm/mp4 upload tests. 2018-04-06 19:56:17 -05:00
evazion
8fd9d374ca Fix #3583: Copying notes should copy tags to destination. 2018-03-31 12:58:56 -05:00
evazion
80219a0ccf commentaries: replace <img> tags with dtext links (#3586)
Replace <img> tags with dtext links, unless the <img> tag is already
inside an <a> tag.

Also strip Unicode spaces from DeviantArt commentaries.
2018-03-30 21:42:51 -05:00
evazion
b185efbb5f tumblr commentaries: include asker's name in ask posts (#3586). 2018-03-30 21:42:51 -05:00
evazion
c0c41dd369 uploads: add limits on max image dimensions. 2018-03-29 19:24:41 -05:00
evazion
be0c2cfcfa posts: fix incorrect large_file_url for animated_gifs.
For animated_gif posts, large_file_url was returning
"/data/sample-$md5.jpg" instead of "/data/$md5.gif".
2018-03-28 19:17:15 -05:00
evazion
dc9b7e5bda Fix #3582: Switch from ImageMagick to libvips 2018-03-28 17:15:57 -05:00
evazion
619a2055fe tests: add storage manager tests. 2018-03-20 19:49:58 -05:00
evazion
d089be9f8a tests: fix upload tests. 2018-03-20 19:49:58 -05:00
evazion
5ad06a4034 Fix #3552: Upload filesize limits can be bypassed.
* Change `http_get_streaming` to write the output file directly,
  instead of taking a callback.

* Track the filesize as the download progresses and abort when it
  exceeds the limit.

* Don't save the Content-Type (it's not used anywhere).
2018-02-27 18:22:34 -06:00
Albert Yi
7d5ad1bcc4 Merge pull request #3563 from evazion/fix-3528
Fix #3528: Add method to prevent image-hosting CloudFlare sites from altering the image
2018-02-26 17:40:46 -08:00
evazion
78aba1c5b1 Fix #3554: approving BUR with nil forum_post_id doesn't update forum.
Wrap `approve!` and `reject!` in transactions so that if there's an
error in approving or rejecting a BUR, it leaves the BUR's status
unchanged instead of updating the BUR but not updating the forum.
2018-02-24 15:04:57 -06:00
evazion
2b8767d7f4 BulkUpdateRequest#approve!: don't swallow exceptions.
Rescue `AliasAndImplicationImporter::Error` instead of `Exception`.
2018-02-24 14:37:02 -06:00
evazion
c9eee7e4d4 Fix #3528: Prevent CloudFlare from altering images. 2018-02-24 13:42:00 -06:00
evazion
b859a1f714 downloads: add tests for untested sites. 2018-02-24 13:42:00 -06:00
evazion
3fefb73e90 Fix #3561: Tumblr: support answer posts. 2018-02-24 10:31:59 -06:00
Albert Yi
d8340f83db Revert "Fix #3528: Add method to prevent image-hosting CloudFlare sites from altering the image" 2018-02-21 17:20:13 -08:00
evazion
263fd0eef1 Fix #3528: Prevent CloudFlare from altering images. 2018-02-17 11:43:27 -06:00
evazion
100c1d2828 Fix #3523: Feedback notification dmails should include the text of the feedback. 2018-01-28 14:32:38 -06:00