Commit Graph

43 Commits

Author SHA1 Message Date
evazion
2e407fa476 rails: update defaults from 5.1 to 5.2.
protect_from_forgery removed from because it's now on by default.

ref: https://edgeguides.rubyonrails.org/configuring.html
2019-08-22 22:09:05 -05:00
Albert Yi
72f319ccf3 rename lambda references to use shorthand syntax 2018-05-10 11:18:02 -07:00
Albert Yi
664a3f02e2 fixes for failed cron maintenance tasks
* update rails scripts for 5.2
* system dmails should be scoped to system
* fix broken url generator in forum notices
2018-04-27 15:01:40 -07:00
evazion
09462aefeb Fix #3522: Enable HSTS. 2018-04-19 01:39:46 -05:00
evazion
2fd91bfa20 Load danbooru_default_config.rb earlier.
Load danbooru_default_config.rb inside application.rb instead of in an
initializer so that it's available as soon as possible.
2018-04-19 00:49:50 -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
127e4e385b Fix dmail failures when akismet isn't configured. 2017-11-25 21:46:32 -06:00
r888888888
b944b642b8 akismet integration 2017-09-14 13:37:36 -07:00
evazion
ebff8d04f7 config/application.rb: set hostname so root_url works. 2017-02-18 03:10:42 -06:00
evazion
f8d5add0cc Silence git messages to stdout during app boot.
Caused this to be printed every time tests were run:

    git is /usr/bin/git
    /home/user/src/danbooru
2016-12-03 20:09:58 -06:00
evazion
58ef469a76 Link current commit if running inside a git repo.
Useful when running `rails server` straight from a dev repo.
2016-10-24 19:07:08 -05:00
r888888888
06ddb16843 better mechanism for determining release revision 2016-09-07 18:54:24 -07:00
r888888888
af60ed7763 include git hash in footer 2016-09-07 18:45:21 -07:00
r888888888
c8f38350c3 update rails default files 2015-08-18 17:50:27 -07:00
r888888888
341b29ce41 fix tests 2015-08-18 17:40:53 -07:00
r888888888
53844af8dc Merge branch 'ruby-2.1'
This reverts commit 616aef4394.
2014-12-10 16:23:58 -08:00
r888888888
616aef4394 Revert "Merge branch 'ruby-2.1'"
This reverts commit 18dd5acca7, reversing
changes made to 55fef2f7c6.
2014-04-24 16:12:30 -07:00
r888888888
18dd5acca7 Merge branch 'ruby-2.1'
Conflicts:
	app/assets/javascripts/comments.js
	app/helpers/delayed_jobs_helper.rb
2014-04-23 18:05:31 -07:00
r888888888
fad0ab7c93 fixes #2133 2014-04-16 17:43:34 -07:00
r888888888
ec0280bcde upgrade to ruby 2.0.0 2014-02-26 13:16:34 -08:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
f52181db94 Major revamp of security. Passwords are first SHA1 hashed and then
that hash is bcrypted.  Bcrypted hashes are stored in a new column on
users.  This separate column is only to allow for rollbacks,
eventually the old SHA1 hash column will be removed.  Sensitive cookie
details are now encrypted to prevent user tampering and more stringent
checks on secret_token and session_secret_key are enforced.
2013-03-04 22:55:41 -05:00
albert
a3658f6811 tweak logger 2013-02-17 18:14:12 -05:00
albert
963bb18de2 fix 2013-02-17 17:55:21 -05:00
albert
48d4673935 add memorylogic 2013-02-17 17:50:00 -05:00
albert
fdff706336 add tagged logging 2013-02-17 17:33:09 -05:00
albert
4cc04d395a fix 2012-02-10 17:51:34 -05:00
albert
1eae813f6d revert precompile behavior 2012-01-27 18:38:24 -05:00
albert
c8bcf5ad7c updated to rails 3.2, fixed tests 2012-01-27 14:22:47 -05:00
albert
1e9efe65f4 updated mailer urls 2011-09-18 17:12:48 -04:00
albert
d42e82eb2f updated mailer urls 2011-09-18 17:08:17 -04:00
albert
713ee07b55 removed img dir initializer 2011-09-16 19:04:33 -04:00
albert
cfb4c04d6a disable ssl for mailer 2011-09-15 18:24:52 -04:00
albert
a562d27a5f fixes for mailer config 2011-09-15 18:21:42 -04:00
albert
c92bdf491e updated to rails 3.1.rc5 2011-08-06 16:22:49 -04:00
albert
72e9da01b5 fixing functional tests 2011-07-17 16:42:26 -04:00
albert
469ae14805 fixed tests, implemented sql based partitioning for favorites 2011-07-16 20:16:34 -04:00
albert
1c964b5189 upgraded to rails 3.1.0.rc1 2011-05-24 18:04:25 -04:00
albert
158810d9f0 fixed comment test 2011-05-16 09:27:06 -04:00
albert
5856b105f5 stuff 2011-03-29 13:56:30 -04:00
albert
5610731b35 sync 2010-08-18 18:42:33 -04:00
Albert Yi
3bfae1f0db added user test, basic user methods 2010-02-06 16:48:40 -05:00
Albert Yi
9bb07046cd initial 2010-02-04 15:08:49 -05:00