Commit Graph

94 Commits

Author SHA1 Message Date
Albert Yi
72f319ccf3 rename lambda references to use shorthand syntax 2018-05-10 11:18:02 -07:00
evazion
6b4a345378 rails 5: replace redirect_to :back with redirect_back
ref: https://blog.bigbinary.com/2016/02/29/rails-5-improves-redirect_to_back-with-redirect-back.html
2018-04-28 12:24:36 -05:00
Albert Yi
f2b525a6d2 Implement forum topic voting and tag change pruning (#3580) 2018-04-26 15:31:06 -07:00
Albert Yi
eddc789df2 fix js bugs 2018-04-26 15:01:57 -07:00
evazion
e772de40a7 posts: add /posts/{id}.html?variant=tooltip template. 2018-04-25 22:12:26 -05:00
evazion
d70a0a64bd Remove controller-level force_ssl checks.
Obsoleted by force_ssl being globally enabled by default.
2018-04-19 00:49:50 -05:00
Albert Yi
d9d98f05c2 Merge branch 'rails-5.1' 2018-04-11 11:40:36 -07:00
evazion
1b14545d0d Fix #3603: Unable to view images on Hijiribe/Sonohara when Danbooru domain is blocked. 2018-04-06 21:25:14 -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
8a012d4c91 Remove unused mobile mode code (#3206).
Mobile mode was removed in 31e36cf.
2018-03-20 02:29:06 -05:00
evazion
84a0a89f4b Fix #3539: Open redirect vulnerabilities. 2018-02-07 19:52:52 -06:00
r888888888
308e3670df gracefully handle unavailable pg connection errors 2018-02-05 12:38:01 -08:00
evazion
5975152ddc Fix double render error in /blah.js. 2017-12-23 00:45:07 -06:00
r888888888
c0ddf266fc move save search button to sidebar 2017-11-17 16:51:38 -08:00
r888888888
d0ccce6985 fixes #3350 2017-11-07 11:56:26 -08:00
r888888888
169fdfb745 re-enable exception rescuefrom 2017-10-03 13:47:50 -07:00
r888888888
014b9af5f8 fetch ugoiras for batch action #3317 2017-10-03 13:36:56 -07:00
r888888888
ba1399abef desktop mode redirects back to original page 2017-04-24 15:54:04 -07:00
r888888888
9718c6e107 fixes to mobile responsive view 2017-04-20 14:29:11 -07:00
evazion
3f35a9ab64 Handle failure gracefully for unconfigured services. 2017-04-05 01:17:03 -05:00
r888888888
c74b1d532a adjust interval for mod queue notice 2017-03-27 15:53:59 -07:00
Albert Yi
5445b341bc fixes #2822: Post vote API: returns 200 for both success and failure; fixes bug with x-api-limit header 2017-01-09 17:31:14 -08:00
Albert Yi
f2a5d45db0 implement token bucket rate limiting 2017-01-09 17:31:14 -08:00
Albert Yi
e7907e0e14 rename some config keys to clarify what they are 2016-11-28 17:31:01 -08:00
Albert Yi
2424f24fcd return 429 for too many requests instead of 421 2016-10-18 13:33:04 -07:00
Albert Yi
87447a51c3 work on #2693 Separate API Limits by Writes/Reads 2016-10-17 16:37:11 -07:00
evazion
bd6ebceda3 Refactor post_approvers_only to approver_only.
Don't duplicate code with post_approvers_only; use the approver_only?
method dynamically defined in `User::Roles.each do ... end`.
2016-10-14 05:04:40 +00:00
evazion
d84184b5f1 Prevent anon/banned/member users from voting (fix #2719).
There was a regression in 6d6d00b; `before_filter :voter_only` was a
no-op in the post vote controller because it merely returned false,
which does not halt the request. The fix is to arrange for a voter_only
method to be defined that properly redirects to the access denied page.
2016-10-14 04:47:51 +00:00
r888888888
800f7d9e5f fix invalid reference to request.request_uri 2016-09-23 15:30:17 -07:00
r888888888
2c80d7b82e more intelligent notice for mod queue 2016-09-09 15:08:23 -07:00
r888888888
122970bc11 fixes #2620: Users who logged in securely should always be redirected to the HTTPS version of Danbooru 2016-07-18 16:48:10 -07:00
r888888888
7efeb5829d fix syntax error 2016-01-03 12:43:39 -08:00
Toks
b708f5ea03 Don't allow banned ip addresses to make changes
Previously banned ip addresses couldn't make new accounts, but if they
get an account somehow the ip ban wouldn't prevent them from making
edits.
2015-10-22 20:14:43 -04:00
r888888888
6480864718 fixes #2469 2015-10-15 15:24:24 -07:00
r888888888
5e70083a6a fix security bug 2015-08-06 11:53:31 -07:00
r888888888
d8f639e721 fixes #2444 2015-07-21 13:42:32 -07:00
r888888888
76718c7012 add details to newrelic trace, fix 401 errors for xml 2015-07-09 18:15:48 -07:00
r888888888
ac8bcdb22f record db timeouts in newrelic 2015-07-09 18:00:18 -07:00
r888888888
1d9596d7f2 fixes #2417 2015-06-29 18:17:59 -07:00
r888888888
0239b0077f fix auth failed json rendering 2015-06-18 17:04:22 -07:00
r888888888
64516b3a37 fixes #2389 2015-06-18 17:03:33 -07:00
Toks
fc5580f1e3 fix #2338 2015-01-24 21:16:01 -05:00
r888888888
9f0d818f81 compatibility fixes 2014-12-10 16:59:54 -08:00
Toks
90bca638bf fixes #2316 (and similar post error messages) 2014-11-30 14:48:51 -05:00
r888888888
cdd17de0af implement coinbase tests 2014-11-29 13:14:46 -08:00
Toks
91270f4567 Fix 404/timeout errors not showing 2014-11-25 21:04:03 -05:00
r888888888
e362d73bb3 fixes #2312 2014-11-25 14:58:00 -08:00
r888888888
a89c57cee0 Fix Rails 4.1 migration issues 2014-04-24 17:01:03 -07:00
r888888888
fad0ab7c93 fixes #2133 2014-04-16 17:43:34 -07:00
r888888888
3e5dd6ca20 enable iqdb previews in upload page 2014-03-27 15:34:05 -07:00