Skip to content

Commit

Permalink
Merge pull request #52 from coldbox-modules/development
Browse files Browse the repository at this point in the history
v4.3.0
  • Loading branch information
lmajano authored Jun 18, 2024
2 parents cba81c0 + 69bad72 commit 6b09d98
Show file tree
Hide file tree
Showing 19 changed files with 128 additions and 25 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ jobs:
strategy:
fail-fast: false
matrix:
cfengine: [ "lucee@5", "adobe@2018", "adobe@2021", "adobe@2023" ]
cfengine: [ "lucee@5", "lucee@6", "adobe@2018", "adobe@2021", "adobe@2023" ]
coldboxVersion: [ "^6.0.0", "^7.0.0" ]
experimental: [ false ]
include:
- coldboxVersion: "be"
cfengine: "lucee@5"
experimental: true
- coldboxVersion: "be"
cfengine: "lucee@6"
experimental: true
- coldboxVersion: "be"
cfengine: "adobe@2018"
experimental: true
Expand Down
11 changes: 11 additions & 0 deletions ModuleConfig.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,24 @@ component {
* Settings
*/
variables.settings = {
// Internal engine flags
engine : {
isLucee : server.keyExists( "lucee" ),
isBoxLang : server.keyExists( "boxlang" ),
isAdobe : server.keyExists( "coldfusion" ) && server.coldfusion.productName.findNoCase(
"ColdFusion"
)
},
// This flag enables/disables the tracking of request data to our storage facilities
// To disable all tracking, turn this master key off
enabled : true,
// This setting controls if you will activate the debugger for visualizations ONLY
// The debugger will still track requests even in non debug mode.
debugMode : controller.getSetting( name = "environment", defaultValue = "production" ) == "development",
// The URL password to use to activate it on demand
// if set to cb:null, will generate random password
// to enable debugger in dev environment set to empty or custom password
// in live environment leave cb:null or set your own password
debugPassword : "cb:null",
// This flag enables/disables the end of request debugger panel docked to the bottem of the page.
// If you disable i, then the only way to visualize the debugger is via the `/cbdebugger` endpoint
Expand Down
8 changes: 3 additions & 5 deletions box.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name":"ColdBox Debugger",
"author":"Ortus Solutions <[email protected]",
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbdebugger/@build.version@/[email protected]@.zip",
"version":"4.2.0",
"version":"4.3.0",
"slug":"cbdebugger",
"type":"modules",
"homepage":"https://github.com/coldbox-modules/cbdebugger",
Expand All @@ -24,8 +24,7 @@
"Brad Wood <[email protected]>",
"Luis Majano <[email protected]>"
],
"dependencies":{
},
"dependencies":{},
"devDependencies":{
"commandbox-cfformat":"*",
"commandbox-docbox":"*",
Expand Down Expand Up @@ -64,6 +63,5 @@
"logs:2018":"server log name=cbdebugger-adobe@2018 --follow",
"logs:2021":"server log name=cbdebugger-adobe@2021 --follow"
},
"installPaths":{
}
"installPaths":{}
}
4 changes: 3 additions & 1 deletion build/Build.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ component {
variables.cwd = getCWD().reReplace( "\.$", "" );
variables.artifactsDir = cwd & "/.artifacts";
variables.buildDir = cwd & "/.tmp";
variables.apidDocsDir = variables.buildDir & "/apidocs";
variables.apiDocsURL = "http://localhost:60299/apidocs/";
variables.testRunner = "http://localhost:60299/tests/runner.cfm";

Expand All @@ -31,7 +32,8 @@ component {
// Cleanup + Init Build Directories
[
variables.buildDir,
variables.artifactsDir
variables.artifactsDir,
variables.apidDocsDir
].each( function( item ){
if ( directoryExists( item ) ) {
directoryDelete( item, true );
Expand Down
12 changes: 12 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Addded

- Lucee 6 Certification
- BoxLang additions
- Better information in dev env, if debugger is not accessible

### Fixed

- CBDEBUGGER-25 - Account for null datasource in QoQ
- Alias for testing mode in CommandBox 6
- JVMUtil wrong location for the temp directory for producing heap dumps

## [4.2.0] - 2024-01-10

### Added
Expand Down
12 changes: 11 additions & 1 deletion handlers/Main.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,21 @@ component extends="coldbox.system.RestHandler" {
* Debugger disabled event
*/
function disabled( event, rc, prc ){
var data = "Page Not Found";

if ( getSetting( "environment" ) == "DEVELOPMENT" ) {
data = " isDebugCookieValid defined: " & debuggerService.isDebugCookieValid();
data &= ", secretKey defined: " & debuggerService.isSecretKeyDefined();
data &= ", doesCookieMatchesSecretKey: " & debuggerService.doesCookieMatchesSecretKey();

data &= ", debugMode: " & debuggerService.getDebugMode();
}

event.renderData(
statusCode = 404,
statusText = "Not Found",
type = "text",
data = "Page Not Found"
data = data
);
}

Expand Down
23 changes: 17 additions & 6 deletions models/DebuggerService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -146,23 +146,34 @@ component
*/
boolean function getDebugMode(){
// If no secretKey has been set, don't allow debug mode
if ( not ( len( variables.secretKey ) ) ) {
if ( not ( isSecretKeyDefined() ) ) {
return false;
}
// If Cookie exists, it's value is used.
if ( isDebugCookieValid() ) {
// Must be equal to the current secret key
if ( cookie[ variables.cookieName ] == variables.secretKey ) {
return true;
} else {
return false;
}
return doesCookieMatchesSecretKey()
}

// If there is no cookie, then use default to app setting
return variables.debugMode;
}

/**
* returns boolean if secret key is defined
* init() will set secret key
*/
boolean function isSecretKeyDefined(){
return javacast( "Boolean", len( variables.secretKey ) );
}

/**
* checks if cookie matches secret key
*/
boolean function doesCookieMatchesSecretKey(){
return cookie[ variables.cookieName ] == variables.secretKey;
}

/**
* Checks if the debug cookie is a valid cookie. Boolean
*/
Expand Down
4 changes: 2 additions & 2 deletions models/JVMUtil.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ component singleton {
*
* @return The absolute path to the generated heap dump
*/
string function generateHeapDump( directoryPath ){
string function generateHeapDump( directoryPath = getTempDirectory() ){
// Create it if it doesn't exist
if ( !directoryExists( arguments.directoryPath = getTempDirectory() ) ) {
if ( !directoryExists( arguments.directoryPath ) ) {
directoryCreate( arguments.directoryPath );
}

Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Apache License, Version 2.0.
- Lucee 5+
- ColdFusion 2018+
- ColdBox 6+
- CommandBox 6 For Development

## Optional Requirements

Expand Down
2 changes: 1 addition & 1 deletion [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"webroot":"test-harness",
"aliases":{
"/moduleroot/cbdebugger":"../"
"/moduleroot/cbdebugger":"./"
}
},
"openBrowser":"false",
Expand Down
2 changes: 1 addition & 1 deletion [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"webroot":"test-harness",
"aliases":{
"/moduleroot/cbdebugger":"../"
"/moduleroot/cbdebugger":"./"
}
},
"openBrowser":"false",
Expand Down
2 changes: 1 addition & 1 deletion [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"webroot": "test-harness",
"aliases":{
"/moduleroot/cbdebugger":"../"
"/moduleroot/cbdebugger":"./"
}
},
"jvm":{
Expand Down
29 changes: 29 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name":"cbdebugger-boxlang@1",
"app":{
"serverHomeDirectory":".engine/boxlang",
"cfengine":"boxlang@1"
},
"web":{
"http":{
"port":"60299"
},
"rewrites":{
"enable":"true"
},
"webroot":"test-harness",
"aliases":{
"/moduleroot/cbdebugger":"./"
}
},
"openBrowser":"false",
"cfconfig":{
"file":".cfconfig.json"
},
"env":{

},
"scripts" : {
"onServerInitialInstall":"install bx-compat"
}
}
4 changes: 2 additions & 2 deletions [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
},
"webroot":"test-harness",
"aliases":{
"/moduleroot/cbdebugger":"../"
"/moduleroot/cbdebugger":"./"
}
},
"openBrowser":"false",
"cfconfig":{
"file":".cfconfig.json"
},
"env":{
"env":{
"lucee-extensions":"D062D72F-F8A2-46F0-8CBC91325B2F067B"
}
}
26 changes: 26 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name":"cbdebugger-lucee@6",
"app":{
"serverHomeDirectory":".engine/lucee6",
"cfengine":"lucee@6"
},
"web":{
"http":{
"port":"60299"
},
"rewrites":{
"enable":"true"
},
"webroot":"test-harness",
"aliases":{
"/moduleroot/cbdebugger":"./"
}
},
"openBrowser":"false",
"cfconfig":{
"file":".cfconfig.json"
},
"env":{
"lucee-extensions":"D062D72F-F8A2-46F0-8CBC91325B2F067B"
}
}
2 changes: 1 addition & 1 deletion views/main/panels/requestTracker/acfSqlPanel.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
#numberFormat( q.endTime - q.startTime )# ms
</td>
<td align="center">
#q.datasource#
#( q.datasource ?: "QoQ" )#
</td>
<td>
<cfif q.template.len()>
Expand Down
2 changes: 1 addition & 1 deletion views/main/panels/requestTracker/acfSqlTable.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</td>

<td align="center">
#q.datasource#
#( q.datasource ?: "QoQ" )#
</td>

<td>
Expand Down
2 changes: 1 addition & 1 deletion views/main/panels/requestTracker/luceeSqlPanel.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
#numberFormat( q.executionTime / 1000000 )# ms
</td>
<td align="center">
#q.datasource#
#( q.datasource ?: "QoQ" )#
</td>
<td>
<cfif q.src.len()>
Expand Down
2 changes: 1 addition & 1 deletion views/main/panels/requestTracker/luceeSqlTable.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</td>

<td align="center">
#q.datasource#
#( q.datasource ?: "QoQ" )#
</td>

<td>
Expand Down

0 comments on commit 6b09d98

Please sign in to comment.