New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow static asset serving from env variable (enhanced!) #18100

Merged
merged 2 commits into from Dec 19, 2014

Conversation

Projects
None yet
4 participants
@chancancode
Member

chancancode commented Dec 19, 2014

ENHANCE

Improved upon #17347 to address some comments, added deprecation for the old name, etc

Make `config.serve_static_assets` settable via an ENV var
`config.serve_static_assets` can now be set from an environment variable in
production mode. The feature remains off by default, but can be enabled by
setting `RAILS_SERVE_STATIC_FILES` to a non-empty string at boot time.

[Richard Schneeman, Godfrey Chan]
@chancancode

This comment has been minimized.

Show comment
Hide comment
Member

chancancode commented Dec 19, 2014

@chancancode

This comment has been minimized.

Show comment
Hide comment
Deprecate `config.serve_static_assets`
Deprecate `config.serve_static_assets` in favor of `config.serve_public_assets`
to clarify that the option is unrelated to the asset pipeline.
@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Dec 19, 2014

Member

This is awesome, i can dig this deprecation. Originally i was worried that something like this:

ENV['RAILS_SERVE_STATIC_FILES'].present?

Would be harder do deal with on Heroku (docker et. al.). Basically we can set a default environment variable but it is difficult to unset an environment variable (using a .profile.d script). That's why my original patch checked for == "true". However now that i'm thinking about it we can make this a public default config and people can unset it if they want. They can also manually put false there if they want. So overall i'm 👍

Thanks ❤️

Member

schneems commented Dec 19, 2014

This is awesome, i can dig this deprecation. Originally i was worried that something like this:

ENV['RAILS_SERVE_STATIC_FILES'].present?

Would be harder do deal with on Heroku (docker et. al.). Basically we can set a default environment variable but it is difficult to unset an environment variable (using a .profile.d script). That's why my original patch checked for == "true". However now that i'm thinking about it we can make this a public default config and people can unset it if they want. They can also manually put false there if they want. So overall i'm 👍

Thanks ❤️

@chancancode

This comment has been minimized.

Show comment
Hide comment
@chancancode

chancancode Dec 19, 2014

Member

Yeah, decided that it's probably not worth going down the "parsing from an ENV var rabbit hole" ("false", "0", "NO", "FALSE", "OMG_PLEASE_DONT" 😛) so we went with the blank vs non-blank option.

Thanks for bearing with us and sorry that it was so difficult! ❤️

Member

chancancode commented Dec 19, 2014

Yeah, decided that it's probably not worth going down the "parsing from an ENV var rabbit hole" ("false", "0", "NO", "FALSE", "OMG_PLEASE_DONT" 😛) so we went with the blank vs non-blank option.

Thanks for bearing with us and sorry that it was so difficult! ❤️

@chancancode chancancode added this to the 4.2.0 milestone Dec 19, 2014

@chancancode chancancode self-assigned this Dec 19, 2014

chancancode added a commit that referenced this pull request Dec 19, 2014

Merge pull request #18100 from chancancode/serve_static_files
Allow static asset serving from env variable (enhanced!)

@chancancode chancancode merged commit eddbd42 into rails:4-2-stable Dec 19, 2014

1 check was pending

continuous-integration/travis-ci The Travis CI build is in progress
Details
@@ -1,3 +1,14 @@
* Deprecate `config.serve_static_assets` in favor of `config.serve_public_assets`

This comment has been minimized.

@kainosnoema

kainosnoema Dec 19, 2014

I believe this should read Deprecateconfig.serve_static_assetsin favor ofconfig.serve_static_files`` (serve_static_files vs. `serve_public_assets`).

@kainosnoema

kainosnoema Dec 19, 2014

I believe this should read Deprecateconfig.serve_static_assetsin favor ofconfig.serve_static_files`` (serve_static_files vs. `serve_public_assets`).

This comment has been minimized.

@chancancode

chancancode Dec 19, 2014

Member

You are totally right, thanks for catching the mistake!

@chancancode

chancancode Dec 19, 2014

Member

You are totally right, thanks for catching the mistake!

*Godfrey Chan*
* `config.serve_static_assets` can now be set from an environment variable in

This comment has been minimized.

@kainosnoema

kainosnoema Dec 19, 2014

Again, this should probably be config.serve_static_files, as the other has been deprecated.

@kainosnoema

kainosnoema Dec 19, 2014

Again, this should probably be config.serve_static_files, as the other has been deprecated.

@jeremy

This comment has been minimized.

Show comment
Hide comment
@jeremy

jeremy Dec 19, 2014

Member

❤️ @schneems @chancancode ❤️

Member

jeremy commented Dec 19, 2014

❤️ @schneems @chancancode ❤️

chancancode added a commit that referenced this pull request Dec 19, 2014

Merge pull request #18100 from chancancode/serve_static_files
Allow static asset serving from env variable (enhanced!)

chancancode added a commit that referenced this pull request Dec 19, 2014

Merge pull request #18100 from chancancode/serve_static_files
Allow static asset serving from env variable (enhanced!)
Conflicts:
	railties/CHANGELOG.md

sivagollapalli added a commit to sivagollapalli/rails that referenced this pull request Dec 29, 2014

Merge pull request #18100 from chancancode/serve_static_files
Allow static asset serving from env variable (enhanced!)
Conflicts:
	railties/CHANGELOG.md

@rossmeissl rossmeissl referenced this pull request Jan 26, 2015

Merged

Support for Rails 4.2 #8

schneems added a commit to heroku/heroku-buildpack-ruby that referenced this pull request Feb 27, 2015

schneems added a commit to heroku/heroku-buildpack-ruby that referenced this pull request Feb 27, 2015

schneems added a commit to heroku/heroku-buildpack-ruby that referenced this pull request Feb 27, 2015

schneems added a commit to heroku/heroku-buildpack-ruby that referenced this pull request Feb 27, 2015

Enable Rails 5 to work on Heroku
- Set RAILS_SERVE_STATIC_FILES by default on Rails 4.2+ (rails/rails#18100)

schneems added a commit to heroku/heroku-buildpack-ruby that referenced this pull request Feb 27, 2015

Enable Rails 5 to work on Heroku
- Set RAILS_SERVE_STATIC_FILES by default on Rails 4.2+ (rails/rails#18100)

schneems added a commit to heroku/heroku-buildpack-ruby that referenced this pull request Feb 27, 2015

Enable Rails 5 to work on Heroku
- Set RAILS_SERVE_STATIC_FILES by default on Rails 4.2+ (rails/rails#18100)

schneems added a commit to heroku/heroku-buildpack-ruby that referenced this pull request Feb 27, 2015

Enable Rails 5 to work on Heroku
- Set RAILS_SERVE_STATIC_FILES by default on Rails 4.2+ (rails/rails#18100)

geoffharcourt added a commit to geoffharcourt/heroku-buildpack-ruby that referenced this pull request Mar 19, 2015

Enable Rails 5 to work on Heroku
- Set RAILS_SERVE_STATIC_FILES by default on Rails 4.2+ (rails/rails#18100)

aemengo added a commit to cloudfoundry/ruby-buildpack that referenced this pull request Mar 31, 2015

Enable Rails 5 to work on Heroku
- Set RAILS_SERVE_STATIC_FILES by default on Rails 4.2+ (rails/rails#18100)

@usutani usutani referenced this pull request Apr 1, 2015

Closed

Rails 4.2対応 #1

2 of 2 tasks complete

sibsfinx added a commit to sibsfinx/heroku-buildpack-ruby that referenced this pull request Apr 14, 2015

Enable Rails 5 to work on Heroku
- Set RAILS_SERVE_STATIC_FILES by default on Rails 4.2+ (rails/rails#18100)

lcfg added a commit to lcfg/heroku-buildpack-jekyll that referenced this pull request Jun 22, 2015

Enable Rails 5 to work on Heroku
- Set RAILS_SERVE_STATIC_FILES by default on Rails 4.2+ (rails/rails#18100)

edwardloveall added a commit to jneen/rouge.jneen.net that referenced this pull request Oct 11, 2015

Use serve_static_files config
Rails is now using `serve_statuc_files` as the config name:
rails/rails#18100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment