Commit Graph

175 Commits

Author SHA1 Message Date
Kira
82beab098f More discord fixing 2020-03-05 14:09:33 -08:00
Kira
b2925f3f69 Fix webm playback. 2020-03-05 12:46:01 -08:00
Kira
048d1dcc1c Update CSP 2020-03-04 06:56:28 -08:00
Kira
2d97f292ca Fix typo in CSP policy 2020-02-22 09:38:09 -08:00
Kira
a4f9f10658 Remove link_to_function 2020-02-21 21:40:37 -08:00
Kira
b532ec88fa Replace inline scripts with js tags with nonce 2020-02-21 21:40:37 -08:00
Kira
8e18c6d4e4 Initial CSP setup 2020-02-21 21:40:37 -08:00
Kira
0c69db869c Post serializer 2020-01-02 10:23:09 -08:00
Kira
8e80df77ff Update gems
This also removes the sprockets based asset pipeline because it
isn't being used, and it was causing startup exceptions.
2019-10-22 21:26:35 -07:00
Kira
0102e4239b Update sidekiq settings 2019-10-18 19:14:34 -07:00
Kira
e1fe3cc9c0 Add config option for elasticsearch host 2019-10-18 19:09:02 -07:00
Kira
47ccf8bbe7 Add missing mailgun init 2019-09-13 14:12:32 -07:00
Kira
532e2c1e04 Update to rails 6 2019-08-28 21:50:40 -07:00
evazion
c8c0e31474 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-28 20:51:39 -07:00
evazion
725d6489d1 Fix #4117: Use memcache for fragment caching. 2019-08-10 05:43:13 -07:00
Kira
e60cc2a46f Remove unused gems 2019-08-10 04:56:05 -07:00
Kira
c28ad3b8a3 Remove unused term-ansicolor and query tracer config 2019-08-10 04:49:18 -07:00
Kira
5d8494caac Replace post archive service with inline code 2019-05-10 16:08:08 -07:00
Kira
057edaa8d1 Add pagination support to Elasticsearch 2019-03-24 08:45:44 -04:00
Kira
22a077a2dd Convert delayed_jobs to activejob
Add sidekiq and create jobs for the majority of delayed actions.

Temporary hookup of sidekiq UI in routes for testing purposes.
2019-02-17 19:28:40 -08:00
Albert Yi
fdd7582fb0 add support for upload preprocessing 2018-06-14 17:52:41 -07:00
Albert Yi
d047d04de6 switch from secret_token to secret_key_base 2018-05-15 15:34:53 -07:00
Albert Yi
72f319ccf3 rename lambda references to use shorthand syntax 2018-05-10 11:18:02 -07:00
Albert Yi
3c894eaf86 increase timeout for pixiv api connections 2018-05-10 09:49:46 -07:00
Albert Yi
c658e7d22a add comments for mechanize patch 2018-05-09 16:51:12 -07:00
Albert Yi
5bca31bad1 add retry monkey patch for mechanize 2018-05-09 16:45:03 -07:00
evazion
c7492343ce String: add truthy? & falsy? core extensions.
* Add `truthy?` and `falsy?` core extensions to String.

* Use `truthy?` and `falsy?` to replace ad-hoc parsing of boolean
  parameters in various places.
2018-05-03 19:57:14 -05: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
Albert Yi
f2b525a6d2 Implement forum topic voting and tag change pruning (#3580) 2018-04-26 15:31:06 -07: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
fcec99405c Fix failure in rake db:migrate on fresh install (#3443).
Create the DanbooruBot account in db/seeds.rb instead of in an
initializer. Move the old db/seeds.rb to db/populate.rb.

Fixes a bug introduced in e2eb45a. Creating DanbooruBot in an
initializer was wrong because in a fresh install the users table doesn't
exist yet. This caused `rake db:migrate` to fail.
2017-12-21 12:08:08 -06:00
evazion
efeaad25ca Move lib/danbooru, lib/danbooru_image_resizer to app/logical. 2017-12-18 12:07:52 -06:00
evazion
e2eb45a5a3 Auto-promote DanbooruBot to Mod. Auto-create DanbooruBot if it doesn't exist. 2017-12-15 18:54:18 -06:00
Albert Yi
c3f1c786e8
Merge branch 'master' into fix-recaptcha 2017-12-13 14:33:39 -08:00
Albert Yi
5da62eff8d
Merge branch 'master' into fix-3278 2017-12-13 14:30:08 -08:00
evazion
8d8a2f9c1e Make recaptcha optional on signup page. 2017-11-29 18:09:37 -06:00
evazion
ec6d553fa6 Move execute_sql / select_value_sql etc to ApplicationRecord. 2017-11-26 13:57:52 -06:00
evazion
45cecff1a6 Move with_timeout / without_timeout to ApplicationRecord. 2017-11-26 13:57:52 -06:00
evazion
5b89f56c2e Move PostgresExtensions to ApplicationRecord. 2017-11-26 13:57:51 -06:00
evazion
127e4e385b Fix dmail failures when akismet isn't configured. 2017-11-25 21:46:32 -06:00
r888888888
9f90799f27 fix newrelic handler for statement timeouts 2017-11-15 17:00:37 -08:00
r888888888
c2029b62b5 delayedjob fixes 2017-10-10 15:49:34 -07:00
r888888888
13f7d7e66d add targeted post down voting report, add delayed job plugin to disable statement timeout 2017-10-10 12:56:57 -07:00
evazion
1a998cb3fb Move API methods from initializer to ApplicationRecord. 2017-06-16 13:28:31 -05:00
evazion
cebf29f83e Allow escaping wildcards (\*) in wildcard searches. 2017-05-31 16:15:18 -05:00
Albert Yi
56bd81912d Merge pull request #3029 from evazion/feat-job-control
Add ability to start/stop delayed jobs.
2017-05-08 13:14:40 -07:00
evazion
1a058ebe9a delayed jobs: don't delete failed jobs. 2017-05-05 11:33:11 -05:00
evazion
7b5ae5f8e0 Fix #3024: strip '?' from API attributes. 2017-05-04 12:19:51 -05:00
evazion
192190a313 initializers/z_dalli.rb: initialize Rails.cache. 2017-04-16 16:48:36 -05:00
evazion
ba408c8718 simple_form: regen config files (#2913).
Regens simple form config using `rails generate simple_form:install`.
Seems to fix #2913 (erroneous minlength validations being enforced as of
simple_form 3.4.0).
2017-03-03 17:21:37 -06:00
evazion
951e6d4b5f Remove unused arbitrary_sql_order_clause.
Unused since f87c71c.
2017-02-06 19:07:04 -06:00
evazion
cf54cd1480 core_extensions.rb: remove unused String#to_escaped_js. 2017-02-06 19:07:04 -06:00
r888888888
2aa7a8aa9c fix for statechecker 2017-01-24 14:32:06 -08:00
evazion
1aa2316a9e dotenv: enable overriding rails secret token / session key. 2017-01-23 18:07:51 -06:00
evazion
f33108416e dotenv: enable overriding danbooru_local_config.rb with env vars. 2017-01-23 18:07:51 -06:00
Albert Yi
79842f7a3b restrict min level constraints for forum topics to mod+admin and restrict options based on current user's level. check privileges for visiblity in forum posts and topics. deprecate serializable_hash (undocumented, internal) for as_json, refactor to use hidden_attributes and method_attributes #2658 2016-10-25 15:05:55 -07:00
Albert Yi
ced7a34afa additional fixes for install script 2016-10-17 16:15:12 -07:00
evazion
7c6ba6a7c0 Add /delayed_jobs.json.
Leave out `handler` because it's sensitive.
2016-10-17 05:57:05 -05:00
r888888888
d5fa4b46e3 * refactor aws config options
* fix aws calls in savedsearch
* remove unused scripts
2015-12-28 12:26:20 -08:00
r888888888
2ff44298b9 fixes #2506: API results wrapped inside an extra object 2015-08-24 17:07:38 -07:00
r888888888
e669b66395 update to capistrano3 2015-08-19 15:53:13 -07:00
r888888888
c8f38350c3 update rails default files 2015-08-18 17:50:27 -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
b2b14cba98 add stripe integration for safebooru 2015-01-22 16:20:25 -08:00
r888888888
ace7e6abff fix warnings 2014-12-10 16:23:58 -08:00
r888888888
d9153769b8 remove stripe references 2014-11-24 19:13:21 -08:00
r888888888
cbf48ad948 add stripe integration for safebooru 2014-11-06 17:03:17 -08:00
r888888888
4c73fb9f79 add ugoira support in view 2014-10-19 02:30:02 -07:00
r888888888
e86c8ceb2a add deletion column to promotion report 2014-07-08 10:21:07 -07:00
r888888888
701ed9d161 fixes #2162 2014-05-22 14:54:19 -07:00
r888888888
fad0ab7c93 fixes #2133 2014-04-16 17:43:34 -07:00
r888888888
e3ad8d93d4 fix for production config 2013-08-01 15:06:56 -07:00
r888888888
60b214f4d0 switch to dalli for memcache adapter, related to #1906 2013-08-01 15:02:45 -07:00
r888888888
c520c7f03c fixes #1847 2013-07-11 15:50:51 -07:00
r888888888
d5f575159f rename references of privileged to gold 2013-04-28 00:04:52 -07:00
r888888888
5f6119d28b include unicorn+newrelic initializer 2013-04-19 22:28:53 -07:00
albert
9a70d8c353 fix timeout 2013-04-01 00:06:58 -04:00
albert
88a900ac9e increse timeouts for delayed job actions 2013-03-31 23:40:06 -04:00
albert
d7c6702be0 fixes #1127 2013-03-29 15:49:09 -04:00
albert
4606ec4763 priv users now have 6sec timeout, platinum users have 9sec timeout 2013-03-21 07:46:49 -07:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
2a1758636b fix favorite tags 2013-03-08 21:50:44 -05:00
albert
c9f6954b03 add action mailer init 2013-03-08 17:49:50 -05:00
albert
8f65b567a2 fixes #796 2013-03-08 13:44:34 -05:00
albert
2338f004eb refactored tsquery sql to use rails escaping mechanisms 2013-03-07 16:34:12 -05: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
cca0cc8dbd fix pool metatags, fix artist search 2013-02-26 23:35:17 -08:00
albert
cf2250a17f fixes #638 2013-02-26 22:56:16 -08:00
albert
63394ef161 remove unnecessary count query for post_versions listing 2013-02-20 14:18:33 -05:00
albert
44682156c0 fix searches 2013-02-17 21:09:25 -05:00
albert
a00f546254 more granular memory use logging 2013-02-17 19:29:38 -05:00
albert
9eb5e07677 fix 2013-01-30 15:16:08 -08:00
albert
c6b9de8486 refactored with_timeout helper 2013-01-30 15:04:13 -08:00
albert
493990dae1 chaneg secret token defualt 2013-01-14 15:12:55 -05:00
albert
82bca2419d add alt source for secret token 2013-01-14 15:11:53 -05:00
albert
3603fdd877 converted imagesize plugin to lib 2012-01-27 15:05:46 -05:00
albert
c8bcf5ad7c updated to rails 3.2, fixed tests 2012-01-27 14:22:47 -05:00
albert
713ee07b55 removed img dir initializer 2011-09-16 19:04:33 -04:00