1
0
Fork 0
forked from OpenNeo/impress
Commit graph

1172 commits

Author SHA1 Message Date
3ae8a265b2
Use Fastly to cache our PNG assets from S3
We've been serving images directly from `impress-asset-images.s3.amazonaws.com` for a long time. While they serve with long-lasting HTTP cache headers, and the app requests them with the `updated_at` timestamp in the query string; each GET request still executes a full S3 ReadObject operation to get the latest version.

In the past, this was only relevant to users on Image Mode, not Flash Mode. But now that everyone's on Image Mode, this matters a lot more!

Now, we've configured a Fastly host at `impress-asset-images.openneo.net`, to sit in front of our S3 bucket. This should dramatically reduce the GET requests to S3 itself, as our cache warms up and gains copies of the most common asset PNGs.

That said, I'm not sure how much actual cost impact this change will have. Our AWS console isn't configured to differentiate cost by bucket yet—I've started this process, but it might take a few days to propagate. All I know is that our current costs are $35/mo data transfer + $20/mo storage, and that outfit images are responsible for most of the storage cost. I hypothesize that `impress-asset-images` is responsible for most of the reads and data transfers, but I'm not sure!

In the future, I think we'll be able to bring our AWS costs to near-zero, by:
- Obsolete `impress-asset-images`, by using the official Neopets PNGs instead, after the HTML5 conversion completes.
- Obsolete `impress-outfit-images`, by using a Node endpoint to generate the images, fronted by a CDN cache. (Transfer the actual data to a long-term storage backup, and replace the S3 objects with redirects, so that old S3 URLs will still work.)

I hope this will be a big slice of the costs though! 🤞

(Note: I'll be deploying this on a bit of a delay, because I want to see the DNS propagate across the globe before flipping to a new domain!)
2021-05-12 22:50:05 -07:00
238a458131
Fix body ID bug saving SwfAsset outside modeling
Oops, if you saved `SwfAsset` outside of modeling code, the `item` field would be empty, and so `item.body_specific?` wouldn't happen.

This would trigger when you even just report a broken image!

Now, we always run the SQL query to check for that flag.
2021-03-16 10:40:01 -07:00
Matt Dunn-Rankin
6697b15413 More generously catch errors on userlookup
Okay so, userlookup stuff hasn't worked in years, because it requires a login now.

But apparently, somewhere recently, the code inside our `neopets` gem started hard crashing, because of assumptions we made about the document we'd get back.

I'm not sure why it only recently started crashing? or if I'm even necessarily right about that?

But anyway, I'm just doing the easiest safest (🤞🏻) change possible: being more generous with the errors we swallow.

Test Plan:
Deploy and cross fingers.
2019-10-27 14:24:21 -07:00
Matt Dunn-Rankin
c7d60e3e41 Add db field to override special color
Okay, fine, finally making this controllable from the db without requiring a deploy :P Setting this new field will cause `item.special_color` to return the corresponding color. This mainly affects what we show on the item page, and what colors we request for modeling on the homepage.
2018-05-09 14:10:20 -07:00
Matt Dunn-Rankin
7707580ed5
Update Neopia URLs to use HTTPS
We recently flipped the switch for various hosts to force HTTPS, yay! This includes `neopia.openneo.net`.

However, I forgot to change the URL scheme in this file. This meant that the form submit from the homepage would go to `http://neopia.openneo.net/`, then redirect to `https://neopia.openneo.net/`, but only preserve the form data in certain browsers. This change should fix that!

Note: This probably breaks the dev environment, where we don't have a cert for `https://neopia.dev.openneo.net`. I'll fix that some other time!
2018-04-16 20:36:50 -07:00
Matt Dunn-Rankin
711aca0008 hardcode more baby IDs :P
Interestingly, these items *are* correctly detecting their special
color on the homepage for model progress. So, we *do* have the ability
to detect this. But I don't have good item data locally, so it would
be hard to test this, so I'm just gonna go with the cheap solution
again, sorry XP
2018-02-25 14:45:13 -08:00
Matt Dunn-Rankin
9771ec834d whoops, accept 1-digit donation amounts! 2018-01-20 17:55:21 -08:00
Matt Dunn-Rankin
55477baa15 new donate layout for post-2017 campaign 2018-01-18 17:14:02 -08:00
Matt Dunn-Rankin
5cae876c46 ugh, one more bug fix? 2017-10-29 15:18:53 -07:00
Matt Dunn-Rankin
80e74da84f whoops, re-add check for explicitly_body_specific?
In bfd825d, we refactored the "is item body-specific?" check. In the process, we dropped the check for the manual override flag, `explicitly_body_specific?`. Not sure if it was an accident or if I was just _so_ confident that it was gonna work :P In any case, re-add the check!
2017-10-29 15:08:22 -07:00
Matt Dunn-Rankin
bd3b75c675 hardcode some color-specific items 😬 2017-10-21 13:32:01 -07:00
Matt Dunn-Rankin
d6ab0e71b3 new JN items URL format 2017-06-17 12:28:07 -07:00
Matt Dunn-Rankin
daa831e2b0 show gear image when no thumbnail URL present
Okay, surprise, the bug was unrelated to Camo config (though I'm glad I cleaned
that up anyway :P). We now, at a low level, serve a placeholder image for item
thumbnail URL if, for some reason, we don't have a good thumbnail URL on hand.
2017-04-01 10:29:12 -07:00
Matt Dunn-Rankin
f54683464f stop appending ?NO_CAMO_CONFIG when image proxying is disabled
One time I did a thing called Camo to try to get our HTTPS pages working,
because images.neopets.com not supporting HTTPS is crazy >_> I've diasbled it
these days, but it had debug behavior to append `?NO_CAMO_CONFIG` to all
proxied URLs when Camo was not configured.

When an item had no thumbnail URL for some reason (mall spider needs fixing,
maybe?), this caused Rails to try to map that empty string into the path
`/assets/?NO_CAMO_CONFIG`, which made Rails complain that it was trying to load
an asset that doesn't exist. This is probably a sign that using `image_tag` for
URLs that *should* be external URLs, but aren't strictly *guaranteed* to be, is
unwise - but, for now, I've just disabled that behavior. I hope Rails has a
better escape hatch for the empty string :P
2017-04-01 10:04:54 -07:00
Matt Dunn-Rankin
512b64a104 update campaign final stretch copy 2017-01-09 11:35:55 -08:00
Matt Dunn-Rankin
17f289f68f whoops, dont trigger autofilter checkbox if we *only* collapsed spaces 2017-01-09 11:16:42 -08:00
Matt Dunn-Rankin
0679d60c82 quote the "fits" filter string if the color/species contains spaces 2017-01-08 12:14:38 -08:00
Matt Dunn-Rankin
0fac707157 Merge branch 'master' of github.com:openneo/impress 2017-01-07 19:19:54 -08:00
Matt Dunn-Rankin
dc582e5980 donation error handling 2017-01-07 19:19:44 -08:00
Matt Dunn-Rankin
822efede84 undo accidental commit
These credentials were never used, and are now revoked. Awkward!
2017-01-06 19:54:17 -08:00
Matt Dunn-Rankin
3b609052d5 donate form visual nits 2017-01-05 20:46:02 -08:00
Matt Dunn-Rankin
c1c2b11a40 ooof, got the amount wrong D: 2017-01-05 18:52:08 -08:00
Matt Dunn-Rankin
6b81da82b1 new donate form :) new colors and new amount chooser 2017-01-05 15:47:12 -08:00
Matt Dunn-Rankin
f5fb8711fc improved donation campaign nav 2017-01-05 13:06:50 -08:00
Matt Dunn-Rankin
6a331bf79b whoops, fix typo in donation fine print 2017-01-05 15:38:17 -05:00
Matchu
b5442d0f3f news posts read from the database, with a campaign-supplement classname option :) 2015-09-26 20:37:03 -07:00
Matchu
49cd93087a get STUCK, actions bar! get. stuck. 2015-09-26 20:09:13 -07:00
Matchu
40f508247d hint at the select all button 2015-09-26 19:59:16 -07:00
Matchu
e4757b0ee4 deselect all 2015-09-26 19:58:31 -07:00
Matchu
e6a2b978f1 oh huh. looks like remove/move are ready. 2015-09-26 19:55:09 -07:00
Matchu
6bba2ae288 bulk action bar renders, but does nothing 2015-09-26 15:31:55 -07:00
Matchu
776b2e864a fun hacks to persist checkboxes after all hangers update 2015-09-26 15:04:59 -07:00
Matchu
48185fd5b8 bulk actions toolbar, with selected items count
TODO: adding an item resets the checked state of everything, boooo.
this is why react is better :'(
2015-09-26 15:00:31 -07:00
Matchu
621c768921 Select All + visual feedback 2015-09-26 14:22:11 -07:00
Matchu
0aca529e27 checkbox for closet management
drop the remove link (just use quantity: 0)
to create a bigger checkbox label target
2015-09-26 13:56:25 -07:00
Matchu
9108703dd0 womp womp, our source link was broken. thanks, dice. 2015-09-26 13:18:58 -07:00
Matchu
b953e572a3 hide desc on complete campaign; add toggle link 2015-09-26 13:17:38 -07:00
Matchu
4ae43f61ea good-enough zeroclipboard implementation 2015-09-24 20:50:27 -07:00
Matchu
bbd11adefa collapse search on empty string 2015-09-24 20:18:15 -07:00
Matchu
c8b9833dee fix the necklace/collar advanced search bug!
Ooh, this one was nasty, and only one symptom ever got noticed:

1. Pick "Occupies: Collar" in Advanced Search.
   You get the text query "occupies:necklace".
2. And, if you try to do "occupies:collar" even in text-based search,
   you *also* get the results from "occupies:necklace" mixed in with
   the correct results.

The trick is that, in Spanish, zone 24 (necklace) is named "collar",
as is zone 27 (collar). Not sure what to do for Spanish, but this
issue also leaked into English: we really don't want English to return
results for Spanish-named zones.

This is a tricky problem, though, because it'd be nice for es users
to be able to type "occupies:hat". I think we'll have to do the quick
fix for now, though, and just only interpret the query in the current
locale.
2015-09-24 19:51:45 -07:00
Matchu
973bbbcb0a even better campaign copy: complete text + ceil to $5 for the finish-up pitch 2015-09-24 19:39:49 -07:00
Matchu
90ac52dc74 tweak the fine print phrasing again ;P 2015-09-22 22:41:00 -07:00
Matchu
2ca784c3a2 thank-you message automatically deploys on campaign success 2015-09-22 22:40:51 -07:00
Matchu
5466cc9301 when remaining costs < $200, pitch harder 2015-09-22 22:19:43 -07:00
d8038f2fbf prefer scraped rainbow pool images over pet images 2015-09-05 18:48:41 +00:00
7b17f70635 show campaign on trade lists
Turns out ~22% of our users initially land on a trade list.
We like to keep the campaign off the pages where space is at a
premium, so we try to whitelist it to major landing pages in order
to avoid accidentally creating a bad experience on some page :)
2015-09-05 17:53:15 +00:00
Matchu
a4079d2e0c campaign 2015 copy updates 2015-08-30 16:49:46 -07:00
Matchu
4a539f32db hope I did this swfimages fix right xD 2015-08-05 20:22:23 -04:00
Matchu
b11d7a8c9c oh dang, did we just fix most of the mixed content? 2015-08-05 20:11:08 -04:00
Matchu
4a18f22571 camo the emotes on the campaign show page 2015-08-05 19:41:42 -04:00