Commit Graph
7828 Commits
Author SHA1 Message Date
Albert Yi 9e1e73ec4c migrate blacklists during mass updates (#2251) 2018-09-19 16:25:06 -07:00
Albert Yi ed5b2ad443 throw error on counts/posts endpoint during a timeout (#2170) 2018-09-19 13:34:50 -07:00
evazion 2f17082e73 Downloads::File: fix SSRF when following redirects (#2498).
Fixes the banned IP check not being applied when following redirects:

  http://danbooru.donmai.us/uploads/new?url=http://httpbin.org/redirect-to%3Furl=http://127.0.0.1/test.jpg
2018-09-18 16:00:03 -05:00
evazion 99221e4028 Downloads::File: fix SSRF attack when fetching remote size (#2498).
Fixes the banned IP check not being applied when fetching the remote
file size. This allowed one to trick Danbooru into sending HEAD requests
to private IPs:

  http://danbooru.donmai.us/uploads/new?url=http://127.0.0.1/test.jpg
2018-09-18 12:16:27 -05:00
evazion 488b1fd994 Downloads::File: memoize strategy.
Also remove unused options param from constructor
2018-09-18 10:22:15 -05:00
evazion 9cdfbba6c2 Fix #3910: Corrupted images during upload.
Use a fresh tempfile for each download attempt instead of reusing the same
file (and having to rewind/truncate it after each failed attempt).
2018-09-18 10:01:44 -05:00
evazion d3c135ec72 Downloads::File#http_get_streaming: clean up retry logic.
Replace handrolled retry logic with retriable gem (already pulled in by another gem).
2018-09-18 09:44:15 -05:00
evazion 96e89cecfb tests: move twitter canonical url test. 2018-09-17 23:27:53 -05:00
evazion 5f328c842a /artist_urls: fix timestamp formatting. 2018-09-17 21:01:42 -05:00
Albert Yi 1a1d74d1ca add diff link on wiki page versions (#1622) 2018-09-17 17:36:46 -07:00
Albert Yi 79f53c25ea skip tests that throw net::opentimeout 2018-09-17 17:00:46 -07:00
evazion 823f78af49 autocomplete.js: add data attrs on autocomplete results (#3902). 2018-09-17 18:18:33 -05:00
evazion 2d5f6b8a35 Fix #3902: Add source of tag autocomplete to the results. 2018-09-17 18:07:48 -05:00
Albert Yi 5958b3f5da disable statement timeout in migration 2018-09-17 13:23:10 -07:00
Albert Yi aea2d77c3a Merge pull request #3907 from evazion/fix-3900
#3900: Allow to search for urls associated with artists using wildcards
2018-09-17 12:03:15 -07:00
evazion 4a99cb098f moebooru: use the image url as the canonical url. 2018-09-16 21:00:11 -05:00
evazion d9ce953752 Fix #3906: Moebooru strategy raises NotImplementedError. 2018-09-16 21:00:11 -05:00
evazion cae78fa8ee moebooru: move tests from unit/downloads to unit/sources. 2018-09-16 21:00:11 -05:00
evazion f135a7c064 twitter: normalize canonical urls.
Normalize http://mobile.twitter.com to http://twitter.com in canonical urls.
2018-09-16 15:03:47 -05:00
evazion bd47641601 twitter: don't fail when api key isn't configured. 2018-09-16 15:03:47 -05:00
evazion 325120ee51 twitter: fix parsing of the artist name from the url.
Fixes URLs like https://twitter.com/intent/user?user_id=123 being
incorrectly normalized to http://twitter.com/intent/ in artist entries.

Also fixes the artist name to be taken from the url when it can't be
obtained from the api (when the tweet is deleted).
2018-09-16 15:03:23 -05:00
evazion 4a84ec9e26 artist urls: add trigram indexes on urls. 2018-09-15 19:58:55 -05:00
evazion c9b3c8d217 artist urls: add tests for controller + artist url search. 2018-09-15 19:58:55 -05:00
evazion 3afc0b3a78 artist urls: add more url search params for /artist_urls.
Adds these search params:

* /artist_urls?search[url]=...
* /artist_urls?search[url_eq]=...
* /artist_urls?search[url_not_eq]=...
* /artist_urls?search[url_like]=...
* /artist_urls?search[url_ilike]=...
* /artist_urls?search[url_not_like]=...
* /artist_urls?search[url_not_ilike]=...
* /artist_urls?search[url_regex]=...
* /artist_urls?search[url_not_regex]=...

and likewise for normalized_url.
2018-09-15 19:58:54 -05:00
evazion c06af060f9 artist urls: add artist, url_matches search params to /artist_urls. 2018-09-15 19:58:31 -05:00
evazion 1fce794b99 artist urls: add /artist_urls index page. 2018-09-15 19:58:05 -05:00
evazion 761f2649af artists: add more invalid name tests (#3901). 2018-09-14 13:32:45 -05:00
evazion bbb233b93f css: remove unused or redundant rules. 2018-09-14 13:31:59 -05:00
evazion 0aecc9d34c css: fix 020_base.scss getting imported twice.
This import caused all in the rules in 020_base.scss to be included
twice in the final stylesheet.
2018-09-14 10:31:30 -05:00
evazion a5ef97a608 css: remove obsolete/unused mixins. 2018-09-14 00:34:34 -05:00
evazion 42f97bf3e5 Fix external link icons (#3890). 2018-09-14 00:21:08 -05:00
evazion 26674ec88a font awesome: switch from js+svg to css+webfont version (fix #3890). 2018-09-14 00:18:30 -05:00
evazion de78c5fd68 /recommended_posts: enable blacklists. 2018-09-13 23:06:24 -05:00
evazion 785fcda79f /recommended_posts: fix inconsistency in controller/action ids. 2018-09-13 23:06:10 -05:00
Albert Yi 6dd64da9ba fix invalid content type leaving upload stuck in preprocessing status (#3896) 2018-09-13 13:50:18 -07:00
Albert Yi 4b75ccf89f fix index on tag name prefixes (#3858) 2018-09-13 11:44:11 -07:00
Albert Yi 7c6ef9f22c Revert "Revert "add prefix index on tags (#3858)""
This reverts commit 6210c1554c.
2018-09-13 11:44:07 -07:00
evazion 091c4c97a8 Fix #3895: 'Related tags' not appearing automatically on uploads page. 2018-09-12 19:26:59 -05: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 c100600875 fix migration 2018-09-12 15:19:27 -07:00
Albert Yi a4674e1ffe disable statement timeout on migration 2018-09-12 15:10:52 -07:00
Albert Yi 769f115ee1 Merge pull request #3894 from r888888888/index-tag-prefix-search
Index tag prefix search
2018-09-12 15:03:40 -07:00
Albert Yi 10e9daccfd enable autocorrect search for everyone 2018-09-12 14:14:31 -07:00
Albert Yi 8c564f055f add prefix index on tags (#3858) 2018-09-12 14:01:21 -07:00
Albert Yi f487b2a2c6 Merge pull request #3889 from evazion/fix-replace-artist-finder
Cleanup artist finder
2018-09-12 11:44:42 -07:00
evazion fbd5f6b7f2 pixiv: fix preview_urls for ugoiras (#3891). 2018-09-12 00:43:10 -05:00
evazion 0df5937d33 /uploads/batch: use preview_url for non-proxied images (#3891). 2018-09-12 00:08:28 -05:00
evazion 37fc215d75 pixiv: fix preview_urls to use correct url (#3891). 2018-09-11 23:55:46 -05:00
evazion d5c7de84a3 font awesome: disable data-search-pseudo-elements (#3890). 2018-09-11 21:20:24 -05:00
evazion 583f8457f0 artists: clean up artist finding logic.
Rename Artist#find_all_by_url to url_matches and drop previous
url_matches method, along with find_artists and search_for_profile.

Previously find_artists tried to lookup the url, referer url, and profile
url in turn until an artist match was found. This was wasteful, because
the source strategy already knows which url to lookup (usually the profile
url). If that url doesn't find a match, then the artist doesn't exist.
2018-09-11 20:14:46 -05:00