seandaniels
01/14/2023, 3:55 PM"fusionreactor":{
"enable":true,
"licenseKey":"${FR_LICENSEKEY}",
"debugEnable":false,
"port":"8089",
"password":"${LUCEE_ADMIN_PASSWORD}",
"cloudGroup":"dealstream,${FR_CLOUDGROUP}",
"defaultApplicationName":"dealstream",
"licenseDeactivateOnShutdown":true,
"ChatEnabled":false
}
I have the various environment variables referenced in that snippet in a .env file in the same app root. But when I do server start
, none of those .env variables appear to get populated. I have the commandbox-dotenv package installed... am I missing something?garciadev
01/14/2023, 3:59 PMenv show
do you see the variables and values you expect?seandaniels
01/14/2023, 4:01 PM{}
garciadev
01/14/2023, 4:01 PMgarciadev
01/14/2023, 4:02 PMgarciadev
01/14/2023, 4:06 PMBOX_SERVER_FUSIONREACTOR_ENABLE=true
BOX_SERVER_FUSIONREACTOR_LICENSEKEY=***VALUE***
BOX_SERVER_FUSIONREACTOR_DEBUGENABLE=false
BOX_SERVER_FUSIONREACTOR_PORT=8089
BOX_SERVER_FUSIONREACTOR_PASSWORD=***VALUE***
BOX_SERVER_FUSIONREACTOR_CLOUDGROUP=***VALUE***
BOX_SERVER_FUSIONREACTOR_DEFAULTAPPLICATIONNAME=dealstream
BOX_SERVER_FUSIONREACTOR_LICENSEDEACTIVATEONSHUTDOWN=true
BOX_SERVER_FUSIONREACTOR_CHATENABLED=false
garciadev
01/14/2023, 4:07 PMgarciadev
01/14/2023, 4:08 PMseandaniels
01/14/2023, 5:02 PMLUCEE_ADMIN_PASSWORD=
FR_LICENSEKEY=
FR_CLOUDGROUP=
HEALTHCHECK_URI=
APP_ENV=develop
And I also tried:
BOX_SERVER_LUCEE_ADMIN_PASSWORD=
BOX_SERVER_FR_LICENSEKEY=
BOX_SERVER_FR_CLOUDGROUP=
BOX_SERVER_HEALTHCHECK_URI=
BOX_SERVER_APP_ENV=develop
Neither seems to do the trick. I run server start and the environment variables are not used. And env show
returns {}
seandaniels
01/14/2023, 5:03 PMseandaniels
01/14/2023, 5:04 PMstart frontend
and start backoffice
. But neither one receives the .env variables.seandaniels
01/14/2023, 5:40 PMdotenvFile
property one can add to server.json. I added dotenvFile=".env"
and that seems to do the trick. I thought by default commandbox-dotenv would find that file but maybe because I have multiple servers in the same approot, it needs to be specified explicitly. Anyway, thanks for the help.garciadev
01/14/2023, 5:41 PMgarciadev
01/14/2023, 5:41 PMgarciadev
01/14/2023, 5:41 PMgarciadev
01/14/2023, 5:41 PMseandaniels
01/14/2023, 5:41 PMgarciadev
01/14/2023, 5:42 PMenv show
seandaniels
01/14/2023, 5:42 PMgarciadev
01/14/2023, 5:43 PMbdw429s
01/14/2023, 7:23 PMbdw429s
01/14/2023, 7:24 PMserver.json
livesbdw429s
01/14/2023, 7:25 PMbdw429s
01/14/2023, 7:27 PMinterceptData.serverDetails.serverInfo.webRoot
from the interceptor annnoucement to find the .env
filebdw429s
01/14/2023, 7:28 PM.env
is already the default name of the file unless you changed this module setting:
https://github.com/commandbox-modules/commandbox-dotenv/blob/master/ModuleConfig.cfc#L5seandaniels
01/16/2023, 2:58 PM.env
is in same webroot as my server.json. Technically there are two server configs though - server-frontend.json
and server-backoffice.json
so I can run multiple servers from the same root (front end and our admin console). I'll try enabling the debug mode to see what I can see.seandaniels
01/16/2023, 2:58 PMseandaniels
01/16/2023, 5:04 PMmodules.commandbox-dotenv.fileName
to env.properties
. I don't know when or why. 🤣 But I did a config show
and sure enough. There ya go...