Converting my server.json to env vars for linux, b...
# box-products
d
Converting my server.json to env vars for linux, but not sure how to do the following?
Copy code
"runwar": {
        "undertowOptions": {
            "ALLOW_UNESCAPED_CHARACTERS_IN_URL": true
        }
}
BOX_SERVER_RUNWAR_UNDERTOWOPTIONS_ALLOW_UNESCAPED_CHARACTERS_IN_URL=true
Seems like it wont do the right thing?
b
Yeah, that's not going to work sadly.
The convention with env var overrides is underscores become dots
There are no built in CommandBox settings with underscores in the name so that works fine, but that doesn't hold up for undertow options, which I don't control
It would be fairly simply to add in a couple exceptions like this one for the generic env var parsing to handle anything after
runwar.undertowOptions
as a single string. Can you pout in a ticket?
Also, is there a compelling reason you're getting rid of your
server.json
? The env vars are designed to make it easy to override bits of your JSON which differ per environment, but I never quite envisioned people just 100% replacing their JSON files with env vars!
This setting seems like the sort of thing you'd want enabled in all environments for the app to work, so it seems like the perfect candidate to live in the
server.json
file.
@Dean
Oh, also if you do a
--verbose
server start, you'll see debugging info that shows all the env vars which were read in to override server.json values.
d
Thinking about it, there probably isnt a compelling reason to remove the server.json totally, but to use the env var overrides specifically where necessary. Our server.json wasnt lengthy so it seemed easy to throw the 20-odd config items into a secret and manage all the config from there. THanks Brad, I'll have a longer think about this
b
Please do put in a ticket tho, I'm confident I can make those undertow options work out of the box with env vars
d
No worries, will do that shortly
👍 1
b
I've honestly just never even tried or thought about it!
d
It was the only thing left in my server.json 😄
b
@Dean This is fixed now on the bleeding edge
Both of these should work
Copy code
box_server_runwar_undertowOptions_foo_bar_baz=true
box_server_runwar_XNIOOptions_bradley_david_wood=false
d
Nice one! Thanks Brad 👍