Additions to Administrator.cfc in Lucee 5.2

Lucee 5.2 will come with a much extended Adminstrator.cfc

First of all it is necessary to explain about Administrator.cfc, the new improved component aims to provide a better access to manipulate the Lucee configuration, that will allow users to do whatever they could do with the tag cfadmin in the past.

In a first step the goal was not to give a complete new interface, it was to provide the interface from tag cfadmin in a more transparent way.

This of course includes a documentation of every single action possible with the component that will be part of the new documentation coming with every Lucee Server.

Because this tag is fully CFML based everybody is welcome to help to further improve this component.

Here is how to call the admin functions.

new Administrator( “”, “” );

  @type specifies whether it is web/server.
  @password specifies the password to access the admin.

For example :

	admin         = new Administrator( "web", "password" );
	getDataSource = admin.getDatasources();
	dump(admin);
	dump(getDataSource); //Returns all the datasources defined for current context

Like this way, we’ve to call all the cfadmin functions.

This is just the start to have status quo to the cfadmin tag, to review the current implementation simply install the latest Lucee 5.2 or review the component directly in the repository

The available functions are as follows:

  • getRegional
  • updateRegional
  • resetRegional
  • getCharset
  • updateCharset
  • resetCharset
  • getOutputSetting
  • updateOutputSetting
  • resetOutputSetting
  • getAvailableTimeZones
  • getAvailableLocales
  • getDatasourceSetting
  • updateDatasourceSetting
  • resetDatasourceSetting
  • getDatasources
  • getDatasource
  • updateDatasource
  • removeDatasource
  • verifyDatasource
  • getDatasourceDriverList
  • getMailservers
  • updateMailServer
  • verifyMailServer
  • removeMailServer
  • getMailSetting
  • updateMailSetting
  • resetMailSetting
  • getMappings
  • getMapping
  • updateMapping
  • removeMapping
  • compileMapping
  • compileCTMapping
  • compileComponentMapping
  • createArchiveFromMapping
  • getCustomTagMappings
  • getExtensions
  • getExtensionInfo
  • updateExtensionInfo
  • updateExtension
  • removeExtension
  • getServerExtensions
  • getLocalExtension
  • getLocalExtensions
  • getExtensionProviders
  • verifyExtensionProvider
  • updateExtensionProvider
  • removeExtensionProvider
  • getORMSetting
  • updateORMSetting
  • resetORMSetting
  • getORMEngine
  • updateORMEngine
  • removeORMEngine
  • getComponent
  • updateComponent
  • getComponentMappings
  • updateComponentMapping
  • removeComponentMapping
  • getCacheConnections
  • verifyCacheConnection
  • updateCacheConnection
  • getCacheConnection
  • removeCacheConnection
  • getCompilerSettings
  • updateCompilerSettings
  • resetCompilerSettings
  • getPerformanceSettings
  • updatePerformanceSettings
  • resetPerformanceSettings
  • getGatewayEntries
  • getGatewayEntry
  • updateGatewayEntry
  • gateway
  • removeGatewayEntry
  • getBundles
  • getBundle
  • getLoggedDebugData
  • getDebugEntry
  • updateDebugEntry
  • removeDebugEntry
  • getDebugSetting
  • updateDebugSetting
  • resetDebugSetting
  • getDebug
  • updateDebug
  • resetDebug
  • getSSLCertificate
  • updateSSLCertificate
  • getPluginDirectory
  • getContextes
  • getContexts
  • updateContext
  • updateLabel
  • getFlds
  • getTlds
  • getTasks
  • executeTask
  • removeTask
  • removeAllTask
  • getTaskSetting
  • updateTaskSetting
  • resetTaskSetting
  • verifyCFX
  • getJavaCfxTags
  • verifyJavaCFX
  • updateJavaCFX
  • removeCfx
  • getLoginSettings
  • updateLoginSettings
  • getLogSettings
  • updateLogSettings
  • removeLogSetting
  • getApplicationListener
  • updateApplicationListener
  • resetApplicationListener
  • getScope
  • updateScope
  • resetScope
  • getRestSettings
  • updateRestSettings
  • resetRestSettings
  • getRestMappings
  • updateRestMapping
  • removeRestMapping
  • getApplicationSetting
  • updateApplicationSetting
  • resetApplicationSetting
  • getQueueSetting
  • updateQueueSetting
  • updatePassword
  • resetPassword
  • getDefaultPassword
  • updateDefaultPassword
  • removeDefaultPassword
  • hashPassword
  • getCustomTagSetting
  • updateCustomTagSetting
  • updateCustomTag
  • removeCustomTag
  • getError
  • updateError
  • resetError
  • securityManager
  • createSecurityManager
  • getSecurityManager
  • updateSecurityManager
  • removeSecurityManager
  • getDefaultSecurityManager
  • updateDefaultSecurityManager
  • storageGet
  • storageSet
  • getAPIKey
  • updateAPIKey
  • removeAPIKey
  • createComponentArchive
  • createCTArchive
  • getUpdate
  • updateUpdate
  • runUpdate
  • removeUpdate
  • changeVersionTo
  • resetId
  • restart
  • getMinVersion
  • listPatches
  • connect
4 Likes

Are there any plans to expose Administrator functionality on the command line via the Lucee CLI?

do you mean commandbox or Java Scripting (JSR223)? for commandbox @bdw429s need to answer for java scripting it is available. @bdw429s you access the Admin.cfc the same as as for example the Query.cfc it is auto imorted in every template executed.

@modius @micstriit The administrator.cfc is not useful at all for a CLI context and the reason is the admin cfc (as well as the cfadmin tag) must be run from inside the same actual JVM process as the server they want to affect. A CLI runs as an external process. The only thing remotely close is the RDS server that Adobe CF has which allows an external connection to modify things on a server. Of course, that comes with its own security concerns. A similar product to look at is Couchbase Server. They have a nice pretty web-based UI for managing it as well as a REST API. They also have a CLI that is basically a wrapper for their REST API so it can be run from anywhere with network connectivity to the Couchbase server being managed. (it requires the username/pass to be sent on every request).

So as far as managing settings from a CLI, the CFConfig project is really the current answer to that. Introducing CFConfig : A new way to manage your CF server's configuration from the command line
It’s compat with Lucee 4, Lucee 5, Adobe 10, 11, and 2016 so far and just does straight parsing and manipulation of the XML and properties files where the config is stored. I would have greatly preferred to to be able to leverage built in Java classes inside Lucee, but after about 2 years of asking for it I gave up and reverse engineered it myself :slight_smile:

There are limitations to CFConfig though which include:

  1. It requires direct access to the file system that the server is running on. It would be nice to have a socket connection that could be made to a remote server. See my ticket for a Clojure-like REPL as a possible solution to this. [LDEV-874] - Lucee
  2. It can only affect static settings in the XML files. That means it can’t install an extension, clear trusted cache, restart Lucee, or apply updates. Some of these items are already current pain points with our users-- especially installing extensions for Docker deploys.