Commit Graph

288 Commits

Author SHA1 Message Date
evazion
ec8c427ef3 reports/uploads: remove upload report page. 2020-01-13 12:58:20 -06:00
evazion
309821bf73 rubocop: fix various style issues. 2019-12-22 21:23:37 -06:00
evazion
43d0955b61 Fix #4065: Sometimes normalization brakes twitter intent links.
Fix incorrectly normalized Twitter intent URLs:

    url: https://twitter.com/intent/user?user_id=881080941443239936
    normalized_url: http://twitter.com/intent/

to

    url: https://twitter.com/intent/user?user_id=881080941443239936
    normalized_url: http://twitter.com/intent/user?user_id=881080941443239936/

Fixes about ~1300 incorrectly normalized urls in the production db.
2019-11-17 19:08:07 -06:00
evazion
13f26c81d8 Remove unused files. 2019-11-15 23:59:56 -06:00
evazion
d617b20b49 dtext links: allow searching for forum posts linking to specific tag. 2019-10-27 01:05:54 -05:00
evazion
6dcf0484f0 dtext links: add fix script to populate dtext_links table. 2019-10-24 19:48:30 -05:00
evazion
2c6567b5d2 Remove uses of the read replica database.
https://danbooru.donmai.us/forum_topics/9127?page=283#forum_post_160508

There was a recent outage that was caused by the read replica
(yukinoshita.donmai.us) being temporarily unavailable. The pg driver in
rails got hardstuck trying to connect to the replica, which brought down
the whole site. The app servers stopped responding and could only be
brought down with SIGKILL. Even try to boot the rails console didn't
work.

We only really used this to calculate tag counts inside Post.fast_count,
which wasn't really beneficial since the read replica is slower than the
main database.
2019-10-22 12:15:46 -05:00
evazion
22d4625071 Fix #4173: Fix inconsistent max upload size. 2019-09-22 22:59:33 -05:00
evazion
1d6d816b23 nginx: add production nginx config files. 2019-09-22 22:59:33 -05:00
evazion
0df5c0fd2b Replace deprecated update_attributes with update.
https://rubyinrails.com/2019/04/09/rails-6-1-activerecord-deprecates-update-attributes-methods/

DEPRECATION WARNING: update_attributes! is deprecated and will be removed from Rails 6.1 (please, use update! instead)
2019-08-25 20:29:32 -05:00
evazion
dfe2b831a3 cache: replace memcache with redis.
Drop memcache. Use redis for all caching instead.
2019-08-22 23:15:34 -05:00
evazion
e29e5fe984 Fix #4131: Upgrade to Ruby 2.6.
Upgrade procedure:

    $ echo 2.6.3 > .ruby-version

    # upgrade ruby-build to know about the latest ruby versions.
    # see also: github.com/rkh/rbenv-update
    $ cd ~/.rbenv/plugins/ruby-build && git pull

    # install the version of ruby specified in .ruby-version.
    # see also: github.com/capistrano/rbenv/issues/83
    $ rbenv install --skip-existing

    # update the shell to use the latest version of ruby by default.
    $ rbenv global 2.6.3

    # update rubygems and bundler
    $ gem update --system

    # update the lockfile to use the latest version of bundler
    $ bundle update --bundler
2019-08-14 12:25:50 -05:00
evazion
b0da649b09 Remove obsolete scripts.
These are mostly old files mostly related to maintenance of Danbooru 1
or the upgrade to Danbooru 2.
2019-08-06 10:42:45 -05:00
nothink
14b0b3f000 Fix typo in nginx.danbooru.conf 2019-08-06 07:48:08 +09:00
nothink
72ceb484ce Update INSTALL.debian, for Debian 9(stretch) 2019-08-05 23:29:12 +09:00
Albert Yi
5e5e86c383 limit number of synchronous saved search updates 2019-07-02 17:16:33 -07:00
Albert Yi
0508b127fd continue refactoring savedsearch 2018-11-15 12:06:13 -08:00
Albert Yi
ea405bdc47 update nginx config 2018-10-16 14:58:30 -07:00
Albert Yi
66ce07e993 add additional install scripts, fix staging deploy 2018-10-16 09:47:58 -07:00
evazion
60ea46e1e7 Add sample newrelic config. 2018-10-09 20:11:44 -05:00
Albert Yi
1a4949368c add server 2018-10-09 14:40:43 -07:00
Albert Yi
897d3d3a99 add production2 env for testing new servers 2018-10-03 11:23:26 -07:00
Albert Yi
e58172483b update iqdb after post replacements (#3885) 2018-09-11 12:24:15 -07:00
evazion
6ff70c5002 mod actions: separate account upgrades from promotions (fix #3841) 2018-08-26 11:12:04 -05:00
r888888888
344c46ed00 add mock recommender service for development, add user-context recommended posts 2018-07-21 14:02:57 -07:00
Albert Yi
2ec9aad320 fixes #3735 2018-06-05 13:23:30 -07:00
evazion
c50ad41792 nginx.danbooru.conf: fix X-Forwarded-Proto.
Sending `http` is wrong, it causes a redirect loop if HSTS is enabled.
2018-04-19 00:45:55 -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
feaad0bbd0 nginx.conf: fix inconsistent client_max_body_size. 2018-02-27 18:22:37 -06:00
evazion
89b523bdae Fix #3480: NoMethodError error when adding artist tag to post. 2017-12-30 16:07:52 -06:00
evazion
45cecff1a6 Move with_timeout / without_timeout to ApplicationRecord. 2017-11-26 13:57:52 -06:00
evazion
7034a96048 Purge invalid gentags from tags table (#3390).
Purges gentags with invalid names from the tags table. Addresses #3390
(Searching certain metatags results in an empty paginator) by removing
metatags from the tags table.
2017-11-20 12:47:30 -06:00
r888888888
5f004b6138 add script for vacuuming 2017-11-15 18:56:19 -08:00
BrokenEagle
e312ae3d92 Added fix script to update the correct tagcount for all posts 2017-11-14 17:11:18 -08: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
r888888888
507aa7c641 Merge branch 'master' of github.com:r888888888/danbooru 2017-09-23 13:15:05 -07:00
r888888888
5ad18aef22 implement gestures 2017-09-23 13:14:49 -07:00
r888888888
b9bc536a79 force s3 backup on post replacements if md5 doesn't change (ref #3290) 2017-09-18 11:11:48 -07:00
r888888888
1e413362e3 don't run spam checks on gold account users (ref #3301) 2017-09-15 16:15:32 -07:00
Tyler Bennett
76fd54b284 update nginx config
On Ubuntu 16.04 LTS, the break in the config causes nginx to fail to restart
2017-08-12 22:19:49 -05:00
r888888888
2947b25d6e script to remove expunged posts from users' favorites 2017-07-20 15:42:59 -07:00
r888888888
a9f15cd862 remove unused pixiv test script 2017-06-27 14:48:55 -07:00
evazion
caebdef9fd commentaries: trim whitespace from existing commentaries. 2017-06-13 16:42:30 -05:00
r888888888
09ed1ea720 another bug fix for nico seiga artist url normalization 2017-05-31 15:50:40 -07:00
r888888888
6a706a6b90 fix normalization for nico seiga urls 2017-05-31 15:45:28 -07:00
r888888888
216ca06fee fixes #3100 2017-05-30 15:38:01 -07:00
r888888888
76b5031bbf add uniqueness constraint on user names 2017-04-13 18:04:06 -07:00
r888888888
da06bee0ab revamp saved search implementation 2017-03-15 15:36:48 -07:00
r888888888
83a5856627 include cache proxy config for nginx 2017-03-13 16:26:07 -07:00
r888888888
26267cd238 add fix script for user names 2017-03-06 16:59:24 -08:00