Commit Graph

41 Commits

Author SHA1 Message Date
Cinder
b852254ad0
[Seeding] Rewrite the seeding script (#676) 2024-07-20 08:30:21 -07:00
Earlopain
a7228612a2
[Rails] Update to 7.1
Run `app:update`, fix the one deprecation warning
2024-01-25 22:05:29 +01:00
Earlopain
3a58ac0938
Switch to OpenSearch (#550)
Run the following commands to import data into OpenSearch:

Post.document_store.create_index!
PostVersion.document_store.create_index!
Post.document_store.import
PostVersion.document_store.import

* Add opensearch client

* Add url param to force use opensearch

* Switch import method over to opensearch

* Index to opensearch as well

* Add option to gradually roll out os

* Index os with separate queue

* Move os post creation to job as well

* Exclusively use the OpenSearch client

* Stop enqueuing OsIndexUpdateJob

* Remove remaining elasticsearch code

Bump faraday since v2 is no longer blocked
2023-10-02 18:57:07 +02:00
Earlopain
b6dc473a55
[Elasticsearch] Bring back the proxy object 2023-09-16 17:09:33 +02:00
Earlopain
a79e25dfbd
[Elasticsearch] Start implementing own elasticsearch-model
This implements create_index!
2023-09-14 20:49:19 +02:00
Earlopain
de4068ade8
[Tests] Clear elasticsearch before tests run
Previously they were only created if they didn't exist.
Data from previous test runs was still present.
2023-09-08 19:17:47 +02:00
Earlopain
f722dbb4c3
[Docker] Tentative fix for intermittent CI test failures
Elastic indicies aren't ready sometimes. I don't know where they are
created, but it seems to be too late. Move creation into the seeds file
and execute it in all environments.

Calling create_index! multiple times is fine, this is important because
the seeds file should be idempotent
2023-05-15 13:58:41 +02:00
Earlopain
5de55edad3
[Cleanup] Remove webpack-cli/webpack-dev-server
They are not used in this project
2023-03-10 09:30:16 +01:00
Earlopain
b3c8608cee
[Docker] Fix initial setup
Since the correct database is now getting created on boot Rails does
things a bit different by trying to run migrations.
Also creates the test database since that wasn't automatic.
2023-03-04 14:19:40 +01:00
Earlopain
09be4cded9
[CI] Commit database.yml
Makes the test setup easier.
Also eases prod deploys with the two separate db pool sizes.
2023-02-25 14:41:07 +01:00
Earlopain
9a8aaab758
[Rails] Remove currently broken binstubs
Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.

Also updated bin/bunlder so that newly added ones could theoretically run.
Remove bin/update because it is not useful for docker environments.
2023-01-28 16:41:55 +01:00
Earlopain
934c8e3b87
[Docker] Run daily maintenance
Remove whenever, it's not used in prod. Prod uses systemd timers.
This executes the daily task on container startup. My PC isn't going to
run when this would execute 99% of the time.
2022-12-09 18:16:53 +01:00
Zwagoth
debb6fe993
Merge pull request #439 from zwagoth/rails-7
Rails 7
2022-11-24 17:13:58 -05:00
Earlopain
372cb8a1ac
[Docker] Clean up bin/setup 2022-11-09 18:35:20 +01:00
Earlopain
fbc06182cc
[Rails] Update to 7 and run app:update 2022-10-10 13:22:35 +02:00
Earlopain
4cb88300c7
[Versions] Rename post/pool archive classes to versions
This just makes sense, and was confusing beforehand.
Case-in-point: Two test classes for pools: pool_versions and pool_archive
2022-08-06 18:58:24 +02:00
Earlopain
c930c9ee52
[Cleanup] Remove unused binstubs + capistrano 2022-04-25 21:10:20 +02:00
Earlopain
5c215ea154
[Docker] Install bundler into image 2022-05-19 12:02:04 +02:00
Earlopain
59e80b7a4d
[Docker] Implement recommendations from review
* Use alpine as the base image
* Parallelize bundle install

Using alpine as base make is feasable to use the provides vips library.
The version is actually newer than what was installed previously.

Other stuff I did:
* Set SECRET_TOKEN/SESSION_SECRET_KEY from docker-compose
* Mute elasticsearch startup logspam
* Execute image as root. This means mounted volume do'nt need to  be chowned
2021-11-16 21:32:40 +01:00
Earlopain
7c972ecf91
[Setup] Replace vagrant with docker 2021-11-14 03:31:26 +01:00
Kira
3da92e81e7 [JS] Because I was forced to upgrade webpack and redo everything from scratch
This is probably going to be partially broken somehow. Let's find out.
2021-09-22 23:29:14 -07:00
Kira
76d1999ade [Rails] Upgrade to rails 6.1 + fix tests 2021-02-25 12:08:09 -08:00
Kira
b11d54a694 Fix webpacker SCSS 2019-11-24 06:18:02 -08:00
Zwagoth
b6ba5e8263 Fix execute perms on setup scripts 2019-09-11 16:01:08 -04:00
Kira
532e2c1e04 Update to rails 6 2019-08-28 21:50:40 -07:00
Kira
c28ad3b8a3 Remove unused term-ansicolor and query tracer config 2019-08-10 04:49:18 -07:00
Kira
1fdc3926df Update webpacker and fix a bunch of broken things with it 2019-08-03 20:25:22 -07:00
Kira
a2a26e25d4 Replace google cloud with ElasticSearch
Most of this was related to use of BigQuery for post versions and
generating reports and bulk reverts, but elasticsearch can easily
handle returning 5k results in a few ms, so this isn't a big deal.

There is also some pubsub stuff which has been gone for a while now.
I don't remember what it was being used for, but it is likely reporting
items, so not an immediate priority.
2019-05-16 16:29:08 -07:00
Liam P. White
d1d416247c apparently can't spell system 2019-03-24 08:45:44 -04:00
byte
03ec687331 add elasticsearch to vagrant setup 2019-03-24 08:45:44 -04:00
evazion
004f1e630d binstubs: revert to rails binstubs (77b42310)
Silence complaints from rails about using Bundler-generated binstubs.
2018-12-16 11:50:16 -06:00
Albert Yi
77b42310eb update gems 2018-12-12 11:20:22 -08:00
Albert Yi
0231b940b0 revert binstubs 2018-10-24 14:01:52 -07:00
Albert Yi
683b45c031 update dtext gem 2018-10-22 13:48:50 -07:00
Albert Yi
ea4e7f1970 Expire unused aliases and implications after 2 years of inactivity 2018-08-01 16:54:48 -07:00
Albert Yi
881c76c788 update readme, remove sprockets gem 2018-08-01 15:34:15 -07:00
Albert Yi
6fa0ae2cf1 Migrate assets to use Webpacker 2018-07-27 15:24:05 -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
c8f38350c3 update rails default files 2015-08-18 17:50:27 -07:00
r888888888
fad0ab7c93 fixes #2133 2014-04-16 17:43:34 -07:00