Good morning, all! (Depending where you are in our...
# box-products
r
Good morning, all! (Depending where you are in our world!) I am receiving the following when spinning up a commandbox Lucee server and attempting to access
/lucee/admin/server.cfm
I see the instructions, but it was so nice just typing in the commandbox password. My feeling is that something went awry. To add, I ran a
box server forget
on this server to start it from scratch because I noticed there were two instances of the same server with the same server name. I suspect this may have happened after changing the web root directory possibly in the server.json, but not 100% on that. Therefore, I removed both of the servers by having to run
box server forget
twice. When running
box start
, everything installed, but now I am noticing this password issue.
Copy code
No Password set yet!
For security reasons it is no longer possible to set the inital password here directly.
You will need to configure a password before you can access the Server Administrator.
create a file with name password.txt containing your new password under the root Lucee server directory ( /lucee-server/context/password.txt ).
click "import file", Lucee will then read and configure your new password, afterwards Lucee will automatically delete that file
r
Thanks, @thisOldDave
šŸ‘ 1
b
@ryan My favorite way to do this is to ensure you have
commandbox-dotenv
installed and simply run this
Copy code
propertyFile set ~/.box.env cfconfig_adminPassword Password123!
That will set a global env file that gets loaded every time you start CommandBox, ensuring you ALWAYS have a
cfconfig_adminPassword
env vars set.
now, all servers you start (whether Lucee or Adobe) will have that default password so you never have to guess
note, this will override any passwords set in your individual site JSON files as env vars are always applied last.
r
that's how I would prefer it on my local machine, anyway
thanks, @bdw429s
šŸ‘ 1
Should this notification of "No Password set yet!" go away and present me with a password field after I set the cfconfig_adminPassword with your command above, @bdw429s? I restart the server just to make sure, but still receiving this notification. Maybe there is more that I need to do. I just did what the Lucee instructions told me to move on Lol
b
@ryan Did you restart the shell after creating the global env var?
That file is loaded in the
onCLIStart()
interception point
So if the shell hasn't started again since you created it, it hasn't been loaded
You can easily see what env vars are defined by running
Copy code
env show
If you don't see the
cfconfig_adminPassword
env var, it hasn't been loaded!
r
ah, my apologies. I did not restart the shell, which makes sense. I restarted the server. Thank you.
b
Well, I mean restart the CLI
But yeah, you'd need to restart the server as well since the CFConfig bits are applied in the
onServerStart()
interceptor
So, what needed to happen was ā€¢ create global env file ā€¢ restart CLI to pick up the global env var file ā€¢ restart the server to pick up the new env vars loaded from aforementioned global env var file
r
I did that, but hard to tell if it is adhering to this configuration since I already did what Lucee requested. I do see the adminPassword in the
env show
. Thanks for the help, @bdw429s
b
When you do a
start --verbose
the debug output will tell you exactly what CFConfig did or did not set
šŸ‘šŸ¼ 1
Including the admin password
šŸ‘šŸ¼ 1
And yes, this password will overwrite any other password you may have previously set into the server
šŸ‘šŸ¼ 1
r
start --verbose
Yep! Thank you!
Copy code
Loading CFConfig into server
   |   |-------------------------------------------
   |   | Found box environment variable [cfconfig_adminPassword]
   |   | Importing into [luceeserver]...
   |   | [adminPassword] set.
šŸ‘ 1