Blog

CommandBox 5.8.0 Released!

Brad Wood March 04, 2023

Spread the word

Brad Wood

March 04, 2023

Spread the word


Share your thoughts

We are pleased to announce the release of CommandBox 5.8.0, which comes with a handful of new features and some important library updates.

Download

As usual, you can acquire the latest release from our download page or your favorite HomeBrew or apt/yum repo

https://www.ortussolutions.com/products/commandbox#download

Read The Docs

Documentation is available here:

https://commandbox.ortusbooks.com/

Check Out The New Stuff

Here's an overview of the new things available in CommandBox 5.8.0.

Bundled System Modules

To be more useful, CommandBox now bundles the following system modules

They will be automatically installed (or updated) when you start the CLI for the first time.  You can still update or uninstall them, just like any system module.  Note:  If you have any of these modules currently linked into the CommandBox core, any uncommitted changes will be overwritten when you upgrade box.  Please unlink the repos first before upgrading.

The CommandBox Update Check modules can be disabled if you don't like it via

config set modules.commandbox-update-check.enable=false

It will also automatically obey the offlineMode Config Setting.

Custom MIME Types

CommandBox will automatically set the content type in the HTTP response for common static file types. If you come across a file extension that doesn't have the correct type, you can set it like so in your server.json:

server set web.mimeTypes.log=text/plain

Which creates the following

{                            
    "web":{                             
        "mimeTypes":{                  
            "log":"text/plain"      
        }
    }
} 

In the above example, hitting a file such as foo.log would come back with a text/plain content type header.

This setting will override any <mime-mapping> tag in your web.xml file.

More Info: https://commandbox.ortusbooks.com/embedded-server/configuring-your-server/mime-types

Config and Module Sync

If you are authenticated to ForgeBox in the CLI, you can synchronize your config settings to and from your ForgeBox account. This is a great way to get up and running on a new PC or keep multiple CommandBox installs in sync. In addition to synchronizing your Config Settings, this feature will also track your installed system modules, such as CFConfig, etc.

config sync push

This command will push your local settings and modules up to your ForgeBox account.

config sync push

By default, the settings are "merged" so new local settings will be added to ForgeBox, but nothing will be removed. To remove config that only exists on ForgeBox, you can use the --overwrite flag to force a full sync.

config sync pull

This command will pull your settings and modules from your ForgeBox account and set/install them locally.

config sync pull

By default, the settings are "merged" so missing settings will be added locally, and missing system modules will be installed, but nothing will be removed. To remove config and modules that only exist locally, you can use the --overwrite flag to force a full sync. This will remove local config settings and uninstall local system modules which were not on ForgeBox.

config sync diff

This command will not change anything, but gives you a full report of all settings which are different between your local CommandBox CLI and ForgeBox. It will show you "Remote Only," "Local Only," and "Changed" settings and modules. Use this to see what you're about to change before pushing or pulling.

config sync diff

Read More: https://commandbox.ortusbooks.com/config-settings/setting-sync

onServerInitialInstall interceptor

This is the same as onServerInstall, but it only runs the VERY FIRST time a CF engine is installed. This is helpful if you want to install Lucee extensions or ACF modules and only need to do it the first time. This interceptor is easier than using onServerInstall and inspecting the installDetails.initialInstall flag.

Case Sensitivity of Web Server

This has been an experimental feature of CommandBox servers for a while, but we've finalized the feature and added a proper setting to enable it in server.json.  By default, the web server in CommandBox will follow the case sensitivity of the underlying file system. So, when on Windows /FiLe.TxT will still load an actual file called /file.txt. But on Linux, the case in the browser would need to match that of the file system. CommandBox allows you to force case sensitivity to be ON or OFF for a server, overriding the server's file system.

Forcing Case sensitivity

To force CommandBox's web server to be case sensitive, even on operating systems like Windows, use the following setting.  There is a nominal performance benefit in doing this, and it can allow a Windows CommandBox server to mimic a Linux server for testing.
 

server set web.caseSensitivePaths=true

Forcing Case Insensitivity

To force CommandBox's web server to be case insensitive, even on operating systems like Linux, use the following setting. There is a nominal performance overhead in doing this, and it can allow a Linux CommandBox server to mimic a Windows IIS server. In this mode, CommandBox will use an internal cache of file system lookups to improve performance. If there are two files of the same name using different case, then you will get whatever file is found first.

server set web.caseSensitivePaths=false

Read More: https://commandbox.ortusbooks.com/embedded-server/configuring-your-server/case-sensitivity-of-web-server 

Support for PFX cert files   

If using CommandBox's SSL, you can now use a PFX file (PKCS #8 format) which contains the public and private key in one file.

More Info: https://commandbox.ortusbooks.com/embedded-server/configuring-your-server/ssl-certs

Case Insensitive Server Rule Predicates

Most of the Server Rule predicates are case-sensitive, which poses a problem when using them for security on Windows since they will only match one specific spelling of a folder or file.  We have added "-nocase" versions of several popular predicates which perform case-insensitive checks.

  • regex-nocase()
  • path-suffix-nocase()
  • path-prefix-nocase()
  • path-nocase()
  • equals-nocase()
  • contains-nocase()

Server Rule Reverse Proxy handler supports SSL

Undertow's reverse-proxy() handler would not connect to a back-end server using SSL.  We've given up on RedHat fixing this any time soon, and added a new load-balanced-proxy() handler which works with SSL.

load-balanced-proxy({'https://reports1.mydomain.com','https://reports2.mydomain.com'})

REPL Improvements

Due to long-standing bugs in the Lucee evaluate() function that seem like they'll never get fixed, we've finally put a workaround in the REPL, which captures the return value of member functions chained to literals and expressions using closures. Ex:

CFSCRIPT-REPL: "test".len()
4
CFSCRIPT-REPL: [1,2,3].each( (i)=>echo(i) )
123

Per-Server Preferred Browser Setting

There is already a Config Setting for the preferred browser when opening up sites.  You can now customize this on a per-server basis with this server.json setting

server set preferredBrowser=firefox
server open

New Server Console Log Layouts

You can now control the Log4j appender layout for CommandBox servers, which includes formats such as JSON, which allows your server logs to be automatically imported into Elastic Search

server set runwar.console.appenderLayout=JSONTemplateLayout

Read More: https://commandbox.ortusbooks.com/embedded-server/configuring-your-server/console-log-layout

New forgebox version-debug command

There is a helpful command called forgebox version-debug which will show you what version of a package will be installed without actually installing it. It can also be useful to test a semver range and see what packages it matches.

Read More: https://commandbox.ortusbooks.com/package-management/installing-packages/debug-installation

Release Notes

Bug

COMMANDBOX-1537 Experimental feature force insensitive web server has stopped working in some cases

COMMANDBOX-1541 Hide Felix error messages in console on startup

COMMANDBOX-1542 Custom tray options calling box with space in path fail

COMMANDBOX-1550 Add load-balanced-proxy() handler to replace Undertow's broken reverse-proxy() because they refuse to fix it

COMMANDBOX-1551 Capture return value from some REPL expressions because Lucee refuses to fix evaluate()'s parser

COMMANDBOX-1552 Two instance of CLI cause class loading issues from OSGI bundles

COMMANDBOX-1559 server start port check doesn't take web.http.enable into accout

New Feature

COMMANDBOX-1434 CommandBox settings sync feature

COMMANDBOX-1539 Add onServerInitialInstall package/server script

COMMANDBOX-1540 Add `.webp` as a default mime type for CommandBox to support this new image format

COMMANDBOX-1543 Formalize setting for case sensitivity of web server

COMMANDBOX-1549 Add "nocase" versions of regex(), path-suffix(), path-prefix(), equals(), contains(), and path() predicates

COMMANDBOX-1555 Improve forgebox whoami command

COMMANDBOX-1556 Allow CommandBox to customize console appender Layout

COMMANDBOX-1562 New "forgebox version-debug" command

COMMANDBOX-1566 Bundle super helpful modules in box core

COMMANDBOX-1567 onConfigSettingSave and onEndpointLogin interception announcements

Improvement

COMMANDBOX-1034 Ability to pass file name to "more" command

COMMANDBOX-1345 Add a method in server.json to add MIME type mappings to Undertow

COMMANDBOX-1393 Improve message when starting second server with single server mode enabled

COMMANDBOX-1538 system setting serverinfo namespace use interceptdata if running inside of server script

COMMANDBOX-1544 Allow `web.webroot` to be changed in single server mode

COMMANDBOX-1545 Authentication failures don't send custom error pages

COMMANDBOX-1547 Add directory param to coldbox watch-reinit command

COMMANDBOX-1548 Support PKCS #8 format private keys

COMMANDBOX-1554 Allow preferredBrowser to be set on a per-server basis

COMMANDBOX-1557 Add file and directory completion to the ID param of the install command

COMMANDBOX-1558 Add installExtension() for commands and task runners to install Lucee extensions on the fly to the CLI

COMMANDBOX-1560 Update Lucee to 5.3.10.120 in CLI core

COMMANDBOX-1561 Improve upgrade command

COMMANDBOX-1564 Load libdirs in system classloader

COMMANDBOX-1565 Check for default branch of "main" in Git endpoint

Task

COMMANDBOX-1357 Try removing JAX API classes from runwar

COMMANDBOX-1546 Update to Undertow 2.2.22-Final

COMMANDBOX-1553 Update bundled JRE to jdk-11.0.18+10

COMMANDBOX-1563 Remove stopgap for COMMANDBOX-1459

Add Your Comment

(3)

Mar 05, 2023 00:48:35 UTC

by Will Belden

What's the command to update Commandbox? Or is this another instance of "yeah, you have to download it again" ? (That's not meant to be sarcastic.)

Mar 05, 2023 01:06:29 UTC

by Brad Wood

Hi Will, the command is "upgrade", but unfortunately I had to update the core Java bootstrapper so a fresh download is needed of the binary. You can use the link in the "Download" section at the top of the post and just overwrite the box.exe.

Mar 05, 2023 03:04:28 UTC

by Will Belden

Roger, roger.

Recent Entries

Partner with BoxLang and Ortus at Into the Box 2025: Empowering the Future of Modern Software Development!

Partner with BoxLang and Ortus at Into the Box 2025: Empowering the Future of Modern Software Development!

At Ortus Solutions, we’ve always been at the forefront of innovation in the ColdFusion ecosystem. From pioneering modern ColdFusion practices to developing cutting-edge tools and frameworks, we’ve been passionate to help and sup[port the community into shaping the future of web development.That’s why we decided to build BoxLang, our new JVM programming language that not only builds on the strengths of ColdFusion but takes modern software development to the next level.

Maria Jose Herrera
Maria Jose Herrera
December 23, 2024
Why BoxLang When You Have Kotlin, Groovy, Scala, and more…

Why BoxLang When You Have Kotlin, Groovy, Scala, and more…

As we approach a stable release of BoxLang and our continued marketing reaches more folks, many have asked about its purpose. Why create a new language when the JVM ecosystem already includes established languages like Kotlin, Groovy, and Scala, to name a few.

Luis Majano
Luis Majano
December 18, 2024