Commit Graph

6770 Commits

Author SHA1 Message Date
evazion
dc9b7e5bda Fix #3582: Switch from ImageMagick to libvips 2018-03-28 17:15:57 -05:00
Albert Yi
6c790c61d3 replace uploader information post previews and comment listing, rename tagger to top tagger 2018-03-27 10:49:41 -07:00
Albert Yi
ce7e31325c Merge pull request #3577 from evazion/feat-storage-manager
Introduce storage manager concept
2018-03-27 09:28:17 -07: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
41a4ff15cd posts: remove unused file path / url methods.
* Remove file_path_for, cropped_file_url (dead code)
* Remove complete_preview_file_url (preview_file_url now returns absolute links)
* Remove `file_name` (only used for Download link in sidebar)
2018-03-20 19:49:55 -05:00
evazion
b7f7187f63 posts: use storage manager to delete files. 2018-03-20 19:49:06 -05:00
evazion
f0bf1bc66e posts: use storage manager to backup files.
* Perform backups synchronously inside `distribute_files` instead of
  asynchronously in `queue_backup`. Asynchronous backups assumed that
  files are stored on the local filesystem, which isn't true in general.

* Remove obsolete backup service classes.
2018-03-20 19:49:06 -05:00
evazion
6d0d1a3ce9 posts: use storage manager to build file urls. 2018-03-20 19:49:06 -05:00
evazion
c76463f34d uploads: use storage manager to distribute files.
Refactors the upload process to pass around temp files, rather than
passing around file paths and directly writing output to the local
filesystem. This way we can pass the storage manager the preview /
sample / original temp files, so it can deal with storage itself.

* Change Download::File#download! to return a temp file.

* Change DanbooruImageResizer and PixivUgoiraConverter to accept/return
  temp files instead of file paths.

* Change Upload#generate_resizes to return temp files for previews and samples.

* Change Upload#generate_resizes to generate ugoira .webm samples
  synchronously instead of asynchronously.
2018-03-20 19:49:06 -05:00
evazion
60dcfbfbdd uploads: autotag animated_gif/png during upload.
Move animated_gif / animated_png autotagging to take place during
uploading, instead of during tag editing. We can't generally assume the
file will be present on the local filesystem after uploading.
2018-03-20 19:49:06 -05:00
evazion
2286ccfca8 uploads: clean up process_upload.
* Remove `initialize_status` (status already defaults to pending in database)
* Remove `has_dimensions?` (always returns true)
* Remove `async_conversion?` (dead code)
* Remove `validate_file_exists` (unneeded checks)
* Simplify `calculate_dimensions`
* Merge `file_header_to_content_type` with `content_type_to_file_ext` (content type isn't used elsewhere)
2018-03-20 19:49:06 -05:00
evazion
b0c7d9c185 Add storage managers (local, sftp, s3, hybrid). 2018-03-20 19:49:06 -05:00
evazion
8a012d4c91 Remove unused mobile mode code (#3206).
Mobile mode was removed in 31e36cf.
2018-03-20 02:29:06 -05:00
evazion
44c604521e Fix #3572: Install script installs wrong ruby version. 2018-03-20 02:21:43 -05:00
Albert Yi
448ec81e97 Merge pull request #3541 from evazion/fix-3539
Fix #3539: Open redirect vulnerabilities
2018-03-08 16:02:02 -08:00
Albert Yi
418b2beae5 Merge pull request #3566 from r888888888/most-valued
Post taggers
2018-03-08 16:01:40 -08: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
r888888888
0c5dcbbf68 Revert "Revert "implement post keepers""
This reverts commit b9fcfe0442.
2018-03-06 18:04:31 -08:00
evazion
5113aec937 artist finder: fix bogus matches for nijie. 2018-03-03 11:26:15 -06:00
Albert Yi
159d807026 Merge pull request #3568 from evazion/fix-3552
Fix #3552: Upload filesize limits can be bypassed
2018-02-28 10:44:50 -08:00
evazion
feaad0bbd0 nginx.conf: fix inconsistent client_max_body_size. 2018-02-27 18:22:37 -06: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
77e7a6553c Merge pull request #3567 from evazion/fix-3518
Fix #3518: Don't prune mod actions.
2018-02-27 16:17:39 -08:00
evazion
9b89f0f54c Fix #3518: Don't prune mod actions. 2018-02-27 18:15:53 -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
Albert Yi
f6716f3df5 Merge pull request #3564 from evazion/fix-3554
Fix #3554: BUR approval bugs
2018-02-26 17:40:00 -08:00
Albert Yi
e6d96a7f28 Merge pull request #3562 from evazion/fix-3548
#3548: Upgrade to jquery-2.2.4
2018-02-26 15:43:52 -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
e48b75c261 downloads: rewrite url in download!, not http_get_streaming.
Refactor Downloads::File#http_get_streaming to just download the given
url, not rewrite it.

Don't clobber @source or @data in `#size` either.
2018-02-24 11:23:27 -06:00
evazion
7157251657 Upgrade to jquery-2.2.4 (#3548). 2018-02-24 10:43:12 -06:00
evazion
3fefb73e90 Fix #3561: Tumblr: support answer posts. 2018-02-24 10:31:59 -06:00
r888888888
916a57b2fd update deprecated jquery 2018-02-22 11:46:11 -08:00
r888888888
689b5690bf fixes #3560 2018-02-22 11:15:42 -08:00
Albert Yi
f38960092d Merge pull request #3559 from r888888888/revert-3551-fix-3528
Revert "Fix #3528: Add method to prevent image-hosting CloudFlare sites from altering the image"
2018-02-21 17:20:30 -08: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
Albert Yi
18871b60ba Merge pull request #3551 from evazion/fix-3528
Fix #3528: Add method to prevent image-hosting CloudFlare sites from altering the image
2018-02-21 14:52:43 -08:00
Albert Yi
1938319504 Merge pull request #3555 from evazion/fix-3554
#3554: Allow admins to edit BUR forum topic/post ids
2018-02-21 14:52:11 -08:00
Albert Yi
ceecc62aa8 Merge pull request #3557 from evazion/fix-autocomplete-consistency
Fix inconsistencies in autocomplete behavior
2018-02-21 14:51:50 -08:00
evazion
c482175050 Fix #3558: Autocomplete: negated metatags aren't completed.
Fix Danbooru.Autocomplete.parse_query to strip prefixes off of
metatags.
2018-02-19 23:57:46 -06:00
evazion
d8e195d168 autocomplete: unify autocomplete options.
Use a single set of default options so that autocomplete behaves
the same way everywhere.
2018-02-18 19:22:46 -06:00
evazion
4754daf594 autocomplete: unify menu item rendering.
* Use `Danbooru.Autocomplete.render_item` for all menu item rendering.
  Fixes usernames not being colorized when completing mentions, and post
  counts not being shown when completing pools on the /pools page.

* Make the /pools page autocomplete pool names the same way that the
  pool:<name> metatag does. Previously autocomplete on the /pools page
  listed most recently updated pools first; now it lists largest pools first.
2018-02-18 19:22:46 -06:00
evazion
962842815d autocomplete: move artist/pool/wiki autocompletion to autocomplete.js.
* Move all autocomplete code to autocomplete.js.

* Mark autocompleted fields with `data-autocomplete="<type>"` attributes,
  instead of hardcoding input field IDs in the javascript.
2018-02-18 19:22:17 -06:00
evazion
a058a77c07 ApplicationHelper#search_field: accept html attributes on <input> field.
Rewrite `search_field` to allow setting `data-*` attributes on the <input> field.
2018-02-18 18:34:18 -06:00
evazion
4bc5cc8ccd bulk update requests: allow admins to edit forum topic/post ids (#3554). 2018-02-18 13:08:53 -06:00
evazion
f07aa1b170 bulk update requests: convert to strong params. 2018-02-18 12:12:12 -06:00
evazion
263fd0eef1 Fix #3528: Prevent CloudFlare from altering images. 2018-02-17 11:43:27 -06:00