Commit Graph

38 Commits

Author SHA1 Message Date
evazion
0563ca3001 docs: document config/ and some directories in app/.
* Add README files to several directories in app/ giving a brief
  overview of some parts of Danbooru's architecture.
* Add documentation for files in config/.
2021-06-27 05:21:38 -05:00
evazion
6f6a73edd2 Fix "Blocked host" error in development environment.
Fix custom hostnames being blocked in the development environment.
2021-03-29 03:01:06 -05:00
evazion
6404aa9aa9 Log to stdout in development and production.
Always log to stdout instead of logging to files in `log/{development,production}.log`.

For development, logging to files wasn't really useful, and could
generate multi-gigabyte log files if you weren't paying attention. For
production, most systems these days (such as Docker and Systemd) prefer
that you write your logs to stdout so they can manage them.

Fixes the Docker image writing logs inside the container, which never
got rotated and could fill up the container.
2021-03-29 03:01:02 -05:00
evazion
7bdec9b5fa config: whitelist ngrok.io for development.
Add ngrok.io (plus a few more domains) to the hostname whitelist so that
it can be used as a hostname in development. Useful for testing
webhooks.

* https://ngrok.com
2021-03-11 03:02:50 -06:00
evazion
896e5cb763 Add BetterErrors gem. 2021-01-30 14:19:37 -06:00
evazion
6849a3d68b Update app files to Rails 6.1 defaults. 2020-12-19 00:26:27 -06:00
evazion
15ba2f6cd7 tests: fix email delivery tests.
Setting deliver_later_queue_name inside config/application.rb broke
tests because assert_enqueued_email_with assumes that the deliver_later
queue is called `mailers`.
2020-03-20 18:03:00 -05:00
evazion
796efccbf4 Update ruby gems and yarn packages. 2020-01-12 13:13:03 -06:00
evazion
309821bf73 rubocop: fix various style issues. 2019-12-22 21:23:37 -06:00
evazion
3e37869768 rails: disable asset pipeline.
Disable the assets pipeline (Sprockets). Sprockets errors out now after
upgrading to Sprockets 4 because of missing config files. We don't use
it any more after switching to Webpack, so we can disable it entirely.

Also disable a few more Rails features that we don't use (ActiveStorage,
ActionCable, ActionMailbox, ActionText).
2019-10-14 13:50:31 -05:00
evazion
3f86a60457 Upgrade to Rails 6.0.0. 2019-08-27 18:13:30 -05:00
evazion
822dce20ed jobs: add base ApplicationJob. 2019-08-16 20:49:34 -05:00
r888888888
82cb31eb28 standardize on new servers 2018-10-04 01:11:31 -07:00
Albert Yi
897d3d3a99 add production2 env for testing new servers 2018-10-03 11:23:26 -07:00
Albert Yi
6fa0ae2cf1 Migrate assets to use Webpacker 2018-07-27 15:24:05 -07:00
r888888888
0d6cf961a8 disable js compression on staging 2018-04-30 11:34:21 -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
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
r888888888
b2245349b3 fixes #3136 2017-06-14 16:21:05 -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
341b29ce41 fix tests 2015-08-18 17:40:53 -07:00
r888888888
48b2719031 Reenable asset compilation for production 2014-04-25 14:40:20 -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
albert
fb21db2774 fixes #816 2013-03-09 12:59:09 -05:00
albert
8bf842ae99 use sendmail mailer in production 2013-02-23 18:17:42 -05:00
albert
2af59642f6 clean up job listing, bug fixes 2013-02-17 23:16:56 -05:00
albert
2392684862 up log level 2013-02-17 12:58:15 -05:00
albert
b758289845 disable production logging 2013-02-16 23:54:39 -05:00
albert
c0bc10304c fixes 2012-02-10 18:09:21 -05:00
albert
c8bcf5ad7c updated to rails 3.2, fixed tests 2012-01-27 14:22:47 -05:00
albert
c92bdf491e updated to rails 3.1.rc5 2011-08-06 16:22:49 -04:00
albert
1c964b5189 upgraded to rails 3.1.0.rc1 2011-05-24 18:04:25 -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