Comment out the default environment vars in .env when createing a new coldbox app

Description

The default template when using "coldbox create app" in Commandbox generates a .env file that sets some "live" default environment variables.

This causes an issue when trying to set the environment setting in Coldbox.cfc

i.e. enviroments = { development = "localhost,^127\.0\.0\.1" }

as it will always default to what is set in the .env file and not detect the development environment.

Can the "example" variables be commented out by default in the .env file when download the template?

Activity

Show:

Brad Wood February 26, 2021 at 8:23 PM

I think this has been done, but it is actually part of a different repo than Commandbox.

Eric Peterson February 21, 2020 at 4:13 PM

I agree with modifying the comment. I would also comment out the environments struct by default and point people to the environment variable.

Leon Seremelis February 20, 2020 at 1:03 AM

Ok, so if the ENVIRONMENT variable stays uncommented in the .env file then there is the following problem in Coldbox.cfc. Namely environment detection doesn’t work out of the box:

Perhaps we could modify the above comment to state that the environment setting in the .env file will override any setting added here?

 

Eric Peterson February 19, 2020 at 3:57 AM

I disagree with commenting them out. The defaults will never be right for everyone, but I think it is a better default to point to environment variables as the environment detection via urls has some subtle problems when used inside container environments.

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Fix versions

Priority

Sentry

Created February 18, 2020 at 11:46 PM
Updated April 7, 2021 at 5:37 PM
Resolved February 26, 2021 at 8:23 PM