CFConfig Services

   ____ _____ ____             __ _       
  / ___|  ___/ ___|___  _ __  / _(_) __ _ 
 | |   | |_ | |   / _ \| '_ \| |_| |/ _` |
 | |___|  _|| |__| (_) | | | |  _| | (_| |
  \____|_|   \____\___/|_| |_|_| |_|\__, |
                                    |___/ 

Copyright 2017 by Ortus Solutions, Corp - https://www.ortussolutions.com

This is a library for reading, writing, and storing configuration for all CF engines. This is an underlying service layer meant to have other tools built on top of it.

Please enter tickets for bugs and enhancements here: https://ortussolutions.atlassian.net/browse/CFCONFIG

Documentation is found here: https://cfconfig.ortusbooks.com

Main Features

  1. Generic JSON storage of any CF engine's settings
  2. Engine-specific mappings for all major engines to convert their config to and from the generic JSON format

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.

Uses

Uses for this library include but are not limited to:

  • Export config from a server as a backup
  • Import config to a server to speed/automate setup
  • Copy config from one server to another. Servers could be different engines-- i.e. copy config from Adobe CF11 to Lucee 5.
  • Merge config from multiple servers together. Ex: combine several Lucee web contexts into a single config (mappings, datasources, etc)
  • Facilitate the external management of any server's settings (such as CLI tools to read or set settings)
  • Compare configuration between two sources

Supported Engines

CFConfig covers most of the common settings you'll find in Adobe and Lucee servers. This includes datasources, CF Mappings, Lucee caches, mail servers, logging settings, debugging settings, event gateways (Adobe), scheduled tasks (Adobe), and custom tag paths.

The current list of supported engines is:

  • Adobe ColdFusion 9, 10, 11, 2016, 2018
  • Lucee 4, 5
  • Railo 4

If you find a setting or feature which is not supported, please send a pull request or add a ticket so we can track it.

Component Overview

Here are the main components in the project

BaseConfig.cfc

This class represents the configuration of a CF engine. It is agnostic and doesn't contain any particular behavior for a specific engine.
Not all the data it stores applies to every engine though. The BaseConfig.cfc is not capable of reading or writing the config, it merely holds the data in a generic manner. If you want to read or write to/from a specific engine's format, you'll need to create one of the engine-specific subclasses, all of which extend BaseConfig.cfc.

Engine-specific mappers

  • JSONConfig.cfc - Engine-agnostic JSON format
  • Lucee4Server.cfc - Lucee 4.x server context
  • Lucee4Web.cfc - Lucee 4.x web context
  • Lucee5Server.cfc - Lucee 5.x server context
  • Lucee5Web.cfc - Lucee 5.x web context
  • Railo4Server.cfc - Railo 4.x server context
  • Railo4Web.cfc - Railo 4.x web context
  • Adobe9.cfc - Adobe ColdFusion 9
  • Adobe10.cfc - Adobe ColdFusion 10
  • Adobe11.cfc - Adobe ColdFusion 11
  • Adobe2016.cfc - Adobe Coldfusion 2016
  • Adobe2018.cfc - Adobe Coldfusion 2018

Usage

Each of the components above supports these public methods:

  • setCFHomePath() - Points to the server home where the config files are to be read or written.
  • read( CFHomePath ) - Extract the config from the files found in the server home. You can override CFHomePath here too.
  • write( CFHomePath ) - Write the config out to the files in the server home whether or not they already exist. You can override CFHomePath here too.
  • getMemento() - Return all configuration in as a raw CFML data structure. Useful for passing config values to another instance.
  • setMemento() - Accept configuration as a raw CFML data structure. Useful for accepting another instance's data.

Create an instance of the component that corresponds to the server that you'd like to read or write config settings from, or the BaseConfig class if you want to deal with the generic JSON-based config.

Create a new JSON configuration file programmatically

JSONConfig = new path.to.JSONConfig()
	.setNullSupport( true );
	.setUseTimeServer( true );
	.setAdminPassword( 'myPass' );
	.addCFMapping( '/foo', '/bar' );
	.write();

Read an existing JSON configuration file

JSONConfig = new path.to.JSONConfig()
	.read( 'test.json' );

Read an existing Lucee 4 server configuration file

lucee4ServerConfig = new path.to.Lucee4ServerConfig()
	.setCFHomePath( expandPath( '/path/to/lucee-server' ) )
	.read();
	
writeDump( lucee4ServerConfig.getMemento() );

Read an existing JSON config file and load into a Lucee 5 web context

JSONConfig = new path.to.JSONConfig()
	.read( expandPath( '.CFConfig.json' ) );

new path.to.Lucee4WebConfig()
	.setMemento( JSONConfig.getMemento() )		
	.write( expandPath( 'WEB-INF/lucee/' ) );

Notes

The JSONConfig will read/write to a JSON file called .CFConfig.json by default in the home directory you specify. You can alternatively specify a full path to a JSON file to change the name.

The Lucee 4 and Lucee 5 web components expect the CFHomePath to be the folder containing the lucee-web.xml.cfm file.
An example would be:

<webroot>/WEB-INF/lucee/

The Lucee 4 and Lucee 5 server components expect the CFHomePath to be the lucee-server folder containing the /context/lucee-server.xml file.
An example would be:

/opt/lucee/lib/lucee-server/

The Adobe components expect the CFHomePath to be the cfusion folder that contains the lib/neo-runtime.xml file.
An example would be:

C:/ColdFusion11/cfusion/

The code in this library has only been tested on Lucee and likely doesn't work on Adobe ColdFusion. If anyone wants to make it compatible, feel free to try by beware of tons of use of the Elvis operator, reliance on sorted JSON structs, and some specific WDDX behavior.

Here are all the versions for this package. Please note that you can leverage CommandBox package versioning to install any package you like. Please refer to our managing package version guide for more information.

Version Created Last Update Published By Stable Download
1.4.1 Jan 28 2019 02:57 PM Jan 28 2019 02:57 PM Ortus Solutions (ortus)
1.4.0 Jan 28 2019 02:54 PM Jan 28 2019 02:54 PM Ortus Solutions (ortus)
1.3.0 Jan 17 2019 05:21 PM Jan 17 2019 05:21 PM Ortus Solutions (ortus)
1.2.0 Dec 15 2018 12:27 AM Dec 15 2018 12:27 AM Ortus Solutions (ortus)
1.0.5 Dec 07 2018 02:47 PM Dec 07 2018 02:47 PM Ortus Solutions (ortus)
1.0.4 Dec 07 2018 12:34 PM Dec 07 2018 12:34 PM Ortus Solutions (ortus)
1.0.3 Sep 28 2018 03:35 PM Sep 28 2018 03:35 PM Ortus Solutions (ortus)
1.0.2 Sep 28 2018 02:00 PM Sep 28 2018 02:00 PM Ortus Solutions (ortus)
1.0.1 Sep 26 2018 12:43 PM Sep 26 2018 12:43 PM Ortus Solutions (ortus)
1.0.0 Sep 18 2018 06:27 PM Sep 18 2018 06:27 PM Ortus Solutions (ortus)
0.20.34-alpha Sep 17 2018 10:03 PM Sep 17 2018 10:03 PM Ortus Solutions (ortus)
0.20.33-alpha Sep 09 2018 10:45 PM Sep 09 2018 10:45 PM Ortus Solutions (ortus)
0.20.32-alpha Sep 09 2018 04:02 PM Sep 09 2018 04:02 PM Ortus Solutions (ortus)
0.20.31-alpha Sep 09 2018 03:59 PM Sep 09 2018 03:59 PM Ortus Solutions (ortus)
0.20.30-alpha Aug 31 2018 02:01 PM Aug 31 2018 02:01 PM Ortus Solutions (ortus)
0.20.29-alpha Aug 27 2018 01:55 PM Aug 27 2018 01:55 PM Ortus Solutions (ortus)
0.20.28-alpha Aug 21 2018 10:27 PM Aug 21 2018 10:27 PM Ortus Solutions (ortus)
0.20.27-alpha Aug 16 2018 12:02 AM Aug 16 2018 12:02 AM Ortus Solutions (ortus)
0.20.26-alpha Aug 14 2018 10:50 AM Aug 14 2018 10:50 AM Ortus Solutions (ortus)
0.20.25-alpha Aug 04 2018 03:47 PM Aug 04 2018 03:47 PM Ortus Solutions (ortus)
0.20.24-alpha Jul 09 2018 01:47 PM Jul 09 2018 01:47 PM Ortus Solutions (ortus)
0.20.23-alpha Jul 09 2018 01:13 PM Jul 09 2018 01:13 PM Ortus Solutions (ortus)
0.20.22-alpha Jul 08 2018 11:37 PM Jul 08 2018 11:37 PM Ortus Solutions (ortus)
0.20.21-alpha Jul 06 2018 03:48 PM Jul 06 2018 03:48 PM Ortus Solutions (ortus)
0.20.20-alpha Jul 06 2018 03:41 PM Jul 06 2018 03:41 PM Ortus Solutions (ortus)
0.20.19-alpha Jul 05 2018 03:20 PM Jul 05 2018 03:20 PM Ortus Solutions (ortus)
0.20.18-alpha Jul 03 2018 02:43 PM Jul 03 2018 02:43 PM Ortus Solutions (ortus)
0.20.17-alpha Jun 20 2018 07:21 PM Jun 20 2018 07:21 PM Ortus Solutions (ortus)
0.20.16-alpha Jun 19 2018 09:13 PM Jun 19 2018 09:13 PM Ortus Solutions (ortus)
0.20.15-alpha Jun 15 2018 07:42 PM Jun 15 2018 07:42 PM Ortus Solutions (ortus)
0.20.14-alpha Jun 15 2018 01:00 PM Jun 15 2018 01:00 PM Ortus Solutions (ortus)
0.20.13-alpha May 23 2018 12:34 PM May 23 2018 12:34 PM Ortus Solutions (ortus)
0.20.12-alpha May 22 2018 12:10 AM May 22 2018 12:10 AM Ortus Solutions (ortus)
0.20.11-alpha May 21 2018 09:22 PM May 21 2018 09:22 PM Ortus Solutions (ortus)
0.20.10-alpha May 16 2018 11:30 AM May 16 2018 11:30 AM Ortus Solutions (ortus)
0.20.9-alpha May 08 2018 04:28 PM May 08 2018 04:28 PM Ortus Solutions (ortus)
0.20.8-alpha Apr 27 2018 02:36 PM Apr 27 2018 02:36 PM Ortus Solutions (ortus)
0.20.7-alpha Apr 23 2018 07:17 PM Apr 23 2018 07:17 PM Ortus Solutions (ortus)
0.20.6-alpha Apr 18 2018 12:24 PM Apr 18 2018 12:24 PM Ortus Solutions (ortus)
0.20.5-alpha Apr 15 2018 10:26 PM Apr 15 2018 10:26 PM Ortus Solutions (ortus)
0.20.4-alpha Apr 14 2018 04:05 PM Apr 14 2018 04:05 PM Ortus Solutions (ortus)
0.20.3-alpha Apr 13 2018 01:08 AM Apr 13 2018 01:08 AM Ortus Solutions (ortus)
0.20.2-alpha Apr 13 2018 12:53 AM Apr 13 2018 12:53 AM Ortus Solutions (ortus)
0.20.1-alpha Apr 13 2018 12:14 AM Apr 13 2018 12:14 AM Ortus Solutions (ortus)
0.20.0-alpha Apr 12 2018 11:46 PM Apr 12 2018 11:46 PM Ortus Solutions (ortus)
0.19.1-alpha Feb 01 2018 07:10 PM Feb 01 2018 07:10 PM Ortus Solutions (ortus)
0.19.0-alpha Feb 01 2018 07:08 PM Feb 01 2018 07:08 PM Ortus Solutions (ortus)
0.18.10-alpha Jan 31 2018 03:31 PM Jan 31 2018 03:31 PM Ortus Solutions (ortus)
0.18.9-alpha Jan 16 2018 03:30 PM Jan 16 2018 03:30 PM Ortus Solutions (ortus)
0.18.8-alpha Jan 03 2018 05:05 PM Jan 03 2018 05:05 PM Ortus Solutions (ortus)
0.18.7-alpha Dec 29 2017 02:10 PM Dec 29 2017 02:10 PM Ortus Solutions (ortus)
0.18.4-alpha Nov 21 2017 05:23 PM Nov 21 2017 05:23 PM Ortus Solutions (ortus)
0.18.3-alpha Nov 21 2017 10:34 AM Nov 21 2017 10:34 AM Ortus Solutions (ortus)
0.18.2-alpha Nov 11 2017 11:16 PM Nov 11 2017 11:16 PM Ortus Solutions (ortus)
0.18.1-alpha Nov 06 2017 09:45 PM Nov 09 2017 12:43 PM Ortus Solutions (ortus)
0.18.0-alpha Nov 06 2017 01:33 PM Nov 06 2017 01:33 PM Ortus Solutions (ortus)
0.17.0-alpha Nov 06 2017 12:03 PM Nov 06 2017 12:03 PM Ortus Solutions (ortus)
0.16.2-alpha Oct 25 2017 10:43 PM Oct 25 2017 10:43 PM Ortus Solutions (ortus)
0.16.1-alpha Oct 06 2017 03:14 PM Oct 06 2017 03:14 PM Ortus Solutions (ortus)
0.16.0-alpha Oct 06 2017 02:04 PM Oct 06 2017 02:04 PM Ortus Solutions (ortus)
0.15.2-alpha Oct 05 2017 11:16 PM Oct 05 2017 11:16 PM Ortus Solutions (ortus)
0.15.1-alpha Oct 05 2017 10:48 PM Oct 05 2017 10:48 PM Ortus Solutions (ortus)
0.15.0-alpha Oct 05 2017 06:04 PM Oct 05 2017 06:04 PM Ortus Solutions (ortus)
0.14.4-alpha Oct 03 2017 04:39 PM Oct 03 2017 04:39 PM Ortus Solutions (ortus)
0.14.3-alpha Oct 02 2017 09:32 PM Oct 02 2017 09:32 PM Ortus Solutions (ortus)
0.14.2-alpha Sep 29 2017 05:40 PM Sep 29 2017 05:40 PM Ortus Solutions (ortus)
0.14.1-alpha Sep 29 2017 05:23 PM Sep 29 2017 05:23 PM Ortus Solutions (ortus)
0.14.0-alpha Sep 29 2017 05:23 PM Sep 29 2017 05:23 PM Ortus Solutions (ortus)
0.13.3-alpha Sep 01 2017 12:36 AM Sep 01 2017 12:36 AM Ortus Solutions (ortus)
0.13.2-alpha Aug 28 2017 08:10 PM Aug 28 2017 08:10 PM Ortus Solutions (ortus)
0.13.0-alpha Aug 22 2017 08:23 PM Aug 22 2017 08:23 PM Ortus Solutions (ortus)
0.12.10-alpha Aug 16 2017 01:19 AM Aug 16 2017 01:19 AM Ortus Solutions (ortus)
0.12.9-alpha Aug 02 2017 05:32 PM Aug 02 2017 05:32 PM Ortus Solutions (ortus)
0.12.8-alpha Aug 02 2017 02:05 PM Aug 02 2017 02:05 PM Ortus Solutions (ortus)
0.12.7-alpha Aug 02 2017 01:36 PM Aug 02 2017 01:36 PM Ortus Solutions (ortus)
0.12.6-alpha Aug 02 2017 01:51 AM Aug 02 2017 01:51 AM Ortus Solutions (ortus)
0.12.5-alpha Jul 27 2017 03:20 PM Jul 27 2017 03:20 PM Ortus Solutions (ortus)
0.12.4-alpha Jul 10 2017 06:03 PM Jul 10 2017 06:03 PM Ortus Solutions (ortus)
0.12.3-alpha Jul 05 2017 06:05 PM Jul 05 2017 06:05 PM Ortus Solutions (ortus)
0.12.2-alpha May 19 2017 01:18 AM May 19 2017 01:18 AM Ortus Solutions (ortus)
0.12.1-alpha May 19 2017 12:59 AM May 19 2017 12:59 AM Ortus Solutions (ortus)
0.12.0-alpha Apr 18 2017 03:32 PM Apr 18 2017 03:32 PM Ortus Solutions (ortus)
0.11.0-alpha Apr 11 2017 11:09 PM Apr 11 2017 11:09 PM Ortus Solutions (ortus)
0.10.0-alpha Apr 04 2017 01:47 AM Apr 04 2017 01:47 AM Ortus Solutions (ortus)
0.9.0-alpha Apr 04 2017 01:44 AM Apr 04 2017 01:44 AM Ortus Solutions (ortus)
0.8.4-alpha Mar 06 2017 01:40 AM Mar 06 2017 01:40 AM Ortus Solutions (ortus)
0.8.3-alpha Mar 02 2017 10:14 PM Mar 02 2017 10:14 PM Ortus Solutions (ortus)
0.8.2-alpha Mar 02 2017 05:30 PM Mar 02 2017 05:30 PM Ortus Solutions (ortus)
0.8.1-alpha Mar 02 2017 03:44 PM Mar 02 2017 03:44 PM Ortus Solutions (ortus)
0.8.0-alpha Mar 02 2017 11:01 AM Mar 02 2017 11:01 AM Ortus Solutions (ortus)
0.7.15-alpha Mar 02 2017 01:51 AM Mar 02 2017 01:51 AM Ortus Solutions (ortus)
0.7.14-alpha Mar 01 2017 02:03 AM Mar 01 2017 02:03 AM Ortus Solutions (ortus)
0.7.13-alpha Mar 01 2017 01:47 AM Mar 01 2017 01:47 AM Ortus Solutions (ortus)
0.7.11-alpha Mar 01 2017 01:39 AM Mar 01 2017 01:39 AM Ortus Solutions (ortus)
0.7.10-alpha Feb 23 2017 08:41 PM Feb 23 2017 08:41 PM Ortus Solutions (ortus)
0.7.9-alpha Feb 23 2017 06:01 PM Feb 23 2017 06:01 PM Ortus Solutions (ortus)
0.7.8-alpha Feb 23 2017 02:38 PM Feb 23 2017 02:38 PM Ortus Solutions (ortus)
0.7.7-alpha Feb 22 2017 08:57 PM Feb 22 2017 08:57 PM Ortus Solutions (ortus)
0.7.5-alpha Feb 22 2017 11:14 AM Feb 22 2017 11:14 AM Ortus Solutions (ortus)
0.7.4-alpha Feb 21 2017 10:42 PM Feb 21 2017 10:42 PM Ortus Solutions (ortus)
0.7.3-alpha Feb 20 2017 06:41 PM Feb 20 2017 06:41 PM Ortus Solutions (ortus)
0.7.2-alpha Feb 20 2017 06:35 PM Feb 20 2017 06:35 PM Ortus Solutions (ortus)
0.7.1-alpha Feb 17 2017 04:47 PM Feb 17 2017 04:47 PM Ortus Solutions (ortus)
0.7.0-alpha Feb 16 2017 11:34 PM Feb 16 2017 11:34 PM Ortus Solutions (ortus)
0.6.1-alpha Feb 11 2017 12:28 AM Feb 11 2017 12:28 AM Ortus Solutions (ortus)
0.6.0-alpha Feb 11 2017 12:25 AM Feb 11 2017 12:25 AM Ortus Solutions (ortus)
0.5.9-alpha Feb 11 2017 12:18 AM Feb 11 2017 12:18 AM Ortus Solutions (ortus)
0.5.8-alpha Feb 10 2017 09:47 PM Feb 10 2017 09:47 PM Ortus Solutions (ortus)
0.5.7-alpha Feb 10 2017 09:44 PM Feb 10 2017 09:44 PM Ortus Solutions (ortus)
0.5.6-alpha Feb 10 2017 09:23 PM Feb 10 2017 09:23 PM Ortus Solutions (ortus)
0.5.5-alpha Feb 10 2017 08:17 PM Feb 10 2017 08:17 PM Ortus Solutions (ortus)
0.5.4-alpha Feb 10 2017 05:43 PM Feb 10 2017 05:43 PM Ortus Solutions (ortus)
0.5.3-alpha Feb 10 2017 01:12 PM Feb 10 2017 01:12 PM Ortus Solutions (ortus)
0.5.2-alpha Feb 06 2017 10:42 PM Feb 06 2017 10:42 PM Ortus Solutions (ortus)

 

  •   Ortus Solutions
  • Published
  • 1.4.1 is the latest of 114 release(s)
    Published
  • Published on Jan 28 2019 02:57 PM
No collaborators yet.
 
  • Feb 06 2017 10:42 PM
  • Jan 28 2019 02:57 PM
  • 1221
  • 0
  • 12902