Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added compression in production on heroku (#41)
* Added compression in production on heroku testing this out as the propshaft asset compiler is only minifying currently and it looks like I would need cssbundler and jsbundler to handle this otherwise * pulled in some updates to the heroku compress gem * added exporter adapter and sprockets ... who knows??!? * found a bug about returning 500 error for some assets .. this might fix it https://fuzzyblog.io/blog/rails/2022/06/02/rails-7-madness-no-such-middleware-to-insert-before-actiondispatch-static.html * removing the heroku asset exporter since it doesn't work * revmoved the heroku stuff * reverting to the original configuration * sprockets exporter * added fork of heroku-deflater that is upgraded for rail 6.1 assets * test that heroku deflator is no longer required romanbsd/heroku-deflater#54 (comment) * explicitly set when to use Rack:Deflator / Brotli romanbsd/heroku-deflater#54 (comment) * attempt to constrain the use of the compressors * Updated bin/dev and bin/prod to switch back and forth between a prod and dev like experience. Added details of ngrok to DevNotes for remote access to localhost Added notes about setting the same ENV variables that are used in Heroku using the dotenv gem and .env.production Removed the interfont stylesheet link that was very large and not loading during production testing Added a database config section to use the osx local Postgres.app but in production the DATABASE_URL will override this The prod script 'builds' the app like in heroku and 'deploys' it to https://jitter.test with precompiled assets * Update of Gemfile.lock Added example of the heroku environment variables to copy to .env.production for bin/prod script * added a script to make testing prod simpler with bin/puma-dev-prod added clearer explanation about secrets to Devnotes added the dotenv-rails gem to support setting env variables like heroku does enabled access to ENV['HOST'] to support requests from https://jitter.prod or ngrok urls * added and extra layer of security for the production enviroment to filter requests passed from the ENV['host'] for example jitter.prod and from x-feature.herokuapp.com fixed a typo that showed up in the preview environment this kinda stinks but for heroku previewapps and ngrok apps we can't predict the subdomain to set ENV['HEROKU_APP_NAME'] * adjusted the config since production is blocked * grrr.. this is still blocking requests in heroku * added scripts to use https://jitter.test which is using rails development mode added scripts to use https://jitter.prod which builds like heroku deployment and uses postgres and local bundle and cached classes etc added some explanation in the DevNotes upgraded a security fix that is actually pretter urgent from two days ago pupulated the .env.production with the heroku configs with and explanation and heroku sample since this is git ignored to protect secrets ngrok still needs a little debugging but for this PR i just needed the prod like build to work to examine the host.config problem in heroku * ENV['Host'] is working for jitter.prod locally but the hosts 403 error is still happening on heroku .. so trying som things * determined that the 403 error is coming from the default_url_options combined with config.hosts. Added the HEROKU_APP_NAME to fix this * ugghh fixed typo in herokuapp.com
- Loading branch information