Commit graph

63 commits

Author SHA1 Message Date
1057fdd3a9 Add rake task to load pet data
Just a quick lil shortcut to look up a pet, I've wanted this recently!
2024-01-24 00:51:37 -08:00
99f5cd717f Move some model mixins to lib/
The models folder is a bit confusingly large, these are more mixins and
kinda clutter it. Push them off into `lib`, I think!

I think they used to be in models mainly because Rails used to handle
`lib` differently with autoloading, and it made for a worse dev
experience. Now it's all the same, though!
2023-12-05 14:55:31 -08:00
0845881aba Add TIMEOUT parameter to swf_assets:manifests task
At this point, I've gone through all the assets, and the only ones
without manifests are:

1. The ones that truly have no manifest yet (that we know of)
2. The ones where execution happened to time out

I think the 5-second timeout is a very reasonable default for starting
the backfill, in a way that prioritizes moving forward; but now that we
have most things, I'd rather be able to re-run it with a more generous
timeout. So here we are!
2023-11-11 11:04:53 -08:00
d2de971a60 Delete more rake tasks
I tried to port the Rainbow Pool ones forward, but ran into issues with the
service that uses browser-specific stuff to check that traffic is valid :/

Incidentally, those were the only places we were using `rest-client`.
Goodbye!
2023-11-10 18:59:46 -08:00
93511b3d51 Delete unused rake tasks 2023-11-10 18:04:24 -08:00
eb4a3ce0d9 More gracefully handle batches that fail to save
I noticed a thing with like, an asset that I think referenced an item that
doesn't exist, which caused an error in the `body_specific?` validation
step?

Tbh that validation step needs fixed up in a number of ways, but I'm
scared to, since it's hard to know what will break modeling lol.

But in any case, more graceful handling is nice! If something happens,
I'd rather leave it null and try again later than have the job crash!
2023-11-10 17:42:56 -08:00
80bd229bc6 Clarify an error message in swf_assets:manifests task
It's not just that none of them were 200 OK, it's that they were all 404.
In the event that something returns not-200 and not-404, we immediately
abort, so we shouldn't get to this case unless they were all 404!
2023-11-10 17:27:35 -08:00
dc22a458bf Move manifest backfill to swf_assets:manifests task
Okay, I've simplified the migration to *just* add the column, and
instead added a task to find assets without manifest URLs and backfill
them.

Performance is a lot better now, using the `async-http` library, which
as I understand it supports both persistent connections when invoked
like this, and maybe also HTTP/2 multiplexing?? (Though I'm not
actually sure images.neopets.com does lol)

I'm not sure about the number of concurrent tasks I picked here, 100
seems okay for an internet thing and for such small requests, but I
worry that the CDN is gonna get annoyed or something. Well, we'll see!
This task is very resumable if it turns out we get frozen out or
something.
2023-11-10 16:52:50 -08:00
22e3f4240a Update most URLs to use HTTPS
I noticed we didn't have the little lock icon in the browser, and yeah
huh there's a lot of `http://` still floating around! Let's fix that!
2023-10-25 15:22:57 -07:00
cbad00f32d Fix AMFPHP requests
Okay, right, if we're just using www.neopets.com (like we are for now), it fails on http://www.neopets.com because it triggers a redirect that we don't follow.

So here I 1) change the default to HTTPS, and 2) add HTTPS support to our little RocketAMF lib
2023-10-23 19:05:09 -07:00
700e26d7df Remove old OpenNeo ID auth code
This removes login/logout/session logic for integrating with OpenNeo ID, replacing them with stubs that just redirect to `/?TODO` when you click login, and helpers that act as if you're not logged in.

This gives us a clean slate to plug in new Devise logic to integrate with the `openneo_id` database directly!
2023-10-23 19:05:07 -07:00
f80d220a62 Upgrade to Rails 4.2.11.3 and Ruby 2.4.10
Some tricks required here to get the dependencies to work out, but we got it!!

Oh also, we move away from the rbenv in Ubuntu's package manager, because it doesn't support more recent Rubies like 2.4.10.
2023-10-23 19:05:05 -07:00
0d4c6ca077 Delete utf8 backfill for old Ruby
Idk if the replacement `require` is necessary exactly, but it's the one-to-one replacement for this lib, so let's start there for now!
2023-10-23 19:05:05 -07:00
7e0971eac6 Delete unused deferred_attributes lib
No idea what this was! Goodbye!
2023-10-23 19:05:05 -07:00
Matchu
fd263ea82f Remove mall spider cron jobs
I don't think these work anymore, and our volunteers get new items into the db fast anyway, Impress 2020 is doing better spidering these days. And then we get to remove the cron job `whenever` gem!
2023-10-23 19:05:05 -07:00
Matchu
1195a6190b Uninstall resque
Yay, we've deleted all our background tasks!

We'll probably want to replace some of the basic functionality like certain caching? But we can deal with that as we run into it.

The direct motivation here was a seeming version conflict between Rails 4.2's rack dependency and latest Resque's rack dependency... but this is just nice complexity elimination regardless, we want this anyway :3
2023-10-23 19:05:04 -07:00
Matchu
8ea74b737e Remove outfit image saving
This has already been moved to Impress 2020 too, so we can delete all the image generation and saving!
2023-10-23 19:05:04 -07:00
Matchu
72a08901c8 Upgrade to Ruby 2.2.4, Rails 4.0.13
NOTE: This doesn't boot yet! There's something changed in the `devise` API that we'll need to fix!

```
/vagrant/config/initializers/devise.rb:46:in `block in <top (required)>': undefined method `encryptor=' for Devise:Module (NoMethodError)
```

But yeah, we navigated the gem upgrades, and also I ran `rake rails:update` and hand-processed the suggestions it had for our config files.
2023-10-23 19:05:02 -07:00
d8038f2fbf prefer scraped rainbow pool images over pet images 2015-09-05 18:48:41 +00:00
Matchu
1fa7031bac force utf8 on a copy of the openneo auth secret, instead of mutating input 2015-07-17 18:36:22 -04:00
8ccc2fd741 set the right asset id in the rake task :P 2014-03-28 00:12:04 -05:00
e62d52bbd4 use body zone (15) instead of static so that most items look good 2014-03-27 22:28:48 -05:00
173c1eab5d fit the asset ID in the 8-char image_hash limit 2014-03-27 22:28:48 -05:00
58fdb3d6ac rake task to quickly create prank pet types 2014-03-27 22:28:48 -05:00
b583254397 create colors from rake 2014-03-27 22:28:48 -05:00
2b870cf91b add pet state replacement task 2013-11-30 20:33:48 -05:00
edc61e9cb4 fix NoMethodError when pet not found
Looks like I forgot to update the RemoteGateway code to consider
that RocketAMF now returns strings. Like in the Pet code, I opted
to dump it into a HashWithIndifferentAccess rather than assume
that we'll forever use strings and it'll never get switched back
to symbols.
2013-04-25 16:39:13 -05:00
f547a75c40 ruby 2.0.0 compatibility... hopefully. 2013-02-25 01:14:45 -05:00
6c3ff09f5d make en-MEEP translatable - because sorting by translations doesnt work well with fallbacks 2013-01-27 20:43:08 -06:00
9c37e894f7 translate species/color 2013-01-26 10:34:48 -06:00
361b5df256 translate zones 2013-01-26 09:54:29 -06:00
29ed401238 load pet by locale, prepare needed translations 2013-01-24 18:24:34 -06:00
1571a10500 shoot, included in the wrong spot. this is rspec issue hard to test :( 2013-01-02 23:58:25 -05:00
b6f1b73738 fix(?) rake issues in production when rspec is missing 2013-01-02 23:56:44 -05:00
202f1dc527 update Rakefile and tasks to match new version of rake 2013-01-02 23:40:37 -05:00
2016216d42 stricter timeout on neopets gateway requests 2012-09-29 14:02:11 -05:00
7dfc6d81a2 add timeout to pet load 2012-08-11 18:47:25 -04:00
38a9e620c4 Merge branch 'outfit_thumbnails' 2012-07-31 11:21:28 -04:00
05acae3cb8 retroactively enqueue outfit images 2012-07-31 10:20:37 -04:00
0633f6012a fix cron job scheduler 2012-07-24 12:05:34 -04:00
91c1ac2acf rake task to update spotlight pets 2011-12-20 21:00:02 -05:00
69ca36e75a rake task to add/remove image mode access for given users 2011-07-01 15:10:13 -04:00
cf94c7ef59 utf-8 support in both ruby 1.9 and 1.8 2011-06-04 18:40:15 -04:00
4e919aca04 ree compatibility 2011-05-31 10:36:32 -04:00
b13fd7ae99 moving toward s3 image storage 2011-05-20 19:19:14 -04:00
2a7fea11e6 handle timeout errors for pet data, swfs, pet images 2011-02-19 22:49:13 -05:00
ac3e9c0051 no more eventmachine for http requests 2011-02-09 18:39:16 -05:00
28b387d4ca fix bug with eventmachine in dev 2011-02-06 17:49:30 -05:00
b07456cc30 make openneo auth strategy a devise strategy, so it can inherit rememberable 2011-02-05 10:33:34 -05:00
8c8776ff63 devise implemented, but not remembering 2011-01-26 13:40:15 -05:00