After moving my site’s images and assets (js) to s3, I tried to upgrade the forum by using the /admin/upgrade interface. It upgraded fine but it seems like it didn’t upload the assets to s3 bucket, rendering by site unavailable untill I rebuilt the app from the shell.
There I have a hook which does it for me. It would be nice to have this sort of functionality in web interface aswell. I don’t know if it’s already present if it is please let me know.
No, You can’t move assets to s3 from the admin area. You’ll have to do that through ssh Because there are additional tasks that are required at the time of this migration unless you’re doing this on a fresh install.
Ah I see, I liked the seemless no downtime way of upgrading until I switched to s3. Is there a way of not serving js through s3 and only images through it?
Yes I am not serving JS directly from S3, it’s stored in S3 then served through CDN. What I meant to ask was can I store JS locally and serve it through CDN, storing only the media on S3.
You’re getting it all wrong once again.
Discourse JS is meant to be served directly through the CDN with the Discourse installation being the pull origin. I don’t know how you’d put JS in s3 but bear in mind that JS is regenerated upon rebuild. Whatever you’d be serving through s3 would probably be outdated and you’ll be inviting more trouble.
That’s why they added the after_assets_precompile hook to upload the updated assets on s3.
How do I fix this. It 404s if I try to access any asset through local server. It have to be through s3. Or I would’ve put an edge routing rule on my cdn pulling asset requests through local domain.
Unfortunately, the topic that is being mentioned doesn’t do that, even while it is indeed called “using object storage for uploads”. If you configure your forum according to the instructions in that topic, it requires the assets being pushed onto S3.