This is a CommandBox module that provides a CLI for reading, writing, and storing configuration for all CF engines.
This does not use RDS and doesn't need the server to be running. It just needs access to the installation folder for a server to locate its config files. You will need to restart the server for the change to take effect unless you have configured the server to scan it's config files for changes.
Uses for this library include but are not limited to:
Here are some examples of commands you can run. Use the built-in help to get full details on all commands.
Each command allows you to specify a
from and/or a
to location, based on what you are doing. A location can be any one of the following:
When interacting with CommandBox servers, we try really hard to figure out the type and version of server you're dealing with. When you simply point to a folder on the hard drive that contains a server home, you'll need to tell us what format you would like the config read or written as. When writing config, the target directory doesn't need to exist. We'll create everything for you so you can
import configuration before you even start the server the first time. Proper formats look like one of these:
cfconfig export myConfig.json cfconfig export myConfig.json serverName cfconfig export myConfig.json /path/to/server/install/home [email protected]
cfconfig import myConfig.json cfconfig import myConfig.json serverName cfconfig import myConfig.json /path/to/server/install/home [email protected]
Note the two servers do not need to be the same kind. CFConfig will translate the config for you.
cfconfig transfer server1 server2 cfconfig transfer from=/path/to/server1/install/home to=/path/to/server2/install/home [email protected] [email protected]
cfconfig show cfconfig show serverName cfconfig show /path/to/server/install/home
cfconfig show requestTimeout cfconfig show requestTimeout serverName cfconfig show requestTimeout /path/to/server/install/home [email protected]
Note, this command requires named parameters.
cfconfig set adminPassword=commandbox cfconfig set adminPassword=commandbox to=serverName cfconfig set adminPassword=commandbox to=/path/to/server/install/home [email protected]
You can actually use
cfconfig set to manage the static contents of a JSON export. The JSON file is, after all, just another location you can read from or write to.
# Pull current config from server into JSON file cfconfig export myConfig.json # Edit JSON file directly cfconfig set adminPassword=commandbox to=myConfig.json
There are three commands to manage CF mappings.
cfconfig cfmapping list cfconfig cfmapping save /foo C:/foo cfconfig cfmapping delete /foo
This is very much a work in progess. Features yet to come include:
And remember, this project is just the CLI component. If you'd like to build a custom process of managing your server's config, the entire service layer is available as a separate project, which can operate outside of CommandBox. https://www.forgebox.io/view/cfconfig-services
box install commandbox-cfconfig
Add the following to your dependencies or devdependencies objects in your
box.json, so CommandBox can track it as a dependency.
"commandbox-cfconfig" : "stable"