Skip to content

Commit 6b09d98

Browse files
authored
Merge pull request #52 from coldbox-modules/development
v4.3.0
2 parents cba81c0 + 69bad72 commit 6b09d98

19 files changed

+128
-25
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
cfengine: [ "lucee@5", "adobe@2018", "adobe@2021", "adobe@2023" ]
21+
cfengine: [ "lucee@5", "lucee@6", "adobe@2018", "adobe@2021", "adobe@2023" ]
2222
coldboxVersion: [ "^6.0.0", "^7.0.0" ]
2323
experimental: [ false ]
2424
include:
2525
- coldboxVersion: "be"
2626
cfengine: "lucee@5"
2727
experimental: true
28+
- coldboxVersion: "be"
29+
cfengine: "lucee@6"
30+
experimental: true
2831
- coldboxVersion: "be"
2932
cfengine: "adobe@2018"
3033
experimental: true

ModuleConfig.cfc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,24 @@ component {
3232
* Settings
3333
*/
3434
variables.settings = {
35+
// Internal engine flags
36+
engine : {
37+
isLucee : server.keyExists( "lucee" ),
38+
isBoxLang : server.keyExists( "boxlang" ),
39+
isAdobe : server.keyExists( "coldfusion" ) && server.coldfusion.productName.findNoCase(
40+
"ColdFusion"
41+
)
42+
},
3543
// This flag enables/disables the tracking of request data to our storage facilities
3644
// To disable all tracking, turn this master key off
3745
enabled : true,
3846
// This setting controls if you will activate the debugger for visualizations ONLY
3947
// The debugger will still track requests even in non debug mode.
4048
debugMode : controller.getSetting( name = "environment", defaultValue = "production" ) == "development",
4149
// The URL password to use to activate it on demand
50+
// if set to cb:null, will generate random password
51+
// to enable debugger in dev environment set to empty or custom password
52+
// in live environment leave cb:null or set your own password
4253
debugPassword : "cb:null",
4354
// This flag enables/disables the end of request debugger panel docked to the bottem of the page.
4455
// If you disable i, then the only way to visualize the debugger is via the `/cbdebugger` endpoint

box.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name":"ColdBox Debugger",
33
"author":"Ortus Solutions <[email protected]",
44
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbdebugger/@build.version@/[email protected]@.zip",
5-
"version":"4.2.0",
5+
"version":"4.3.0",
66
"slug":"cbdebugger",
77
"type":"modules",
88
"homepage":"https://github.com/coldbox-modules/cbdebugger",
@@ -24,8 +24,7 @@
2424
"Brad Wood <[email protected]>",
2525
"Luis Majano <[email protected]>"
2626
],
27-
"dependencies":{
28-
},
27+
"dependencies":{},
2928
"devDependencies":{
3029
"commandbox-cfformat":"*",
3130
"commandbox-docbox":"*",
@@ -64,6 +63,5 @@
6463
"logs:2018":"server log name=cbdebugger-adobe@2018 --follow",
6564
"logs:2021":"server log name=cbdebugger-adobe@2021 --follow"
6665
},
67-
"installPaths":{
68-
}
66+
"installPaths":{}
6967
}

build/Build.cfc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ component {
1212
variables.cwd = getCWD().reReplace( "\.$", "" );
1313
variables.artifactsDir = cwd & "/.artifacts";
1414
variables.buildDir = cwd & "/.tmp";
15+
variables.apidDocsDir = variables.buildDir & "/apidocs";
1516
variables.apiDocsURL = "http://localhost:60299/apidocs/";
1617
variables.testRunner = "http://localhost:60299/tests/runner.cfm";
1718

@@ -31,7 +32,8 @@ component {
3132
// Cleanup + Init Build Directories
3233
[
3334
variables.buildDir,
34-
variables.artifactsDir
35+
variables.artifactsDir,
36+
variables.apidDocsDir
3537
].each( function( item ){
3638
if ( directoryExists( item ) ) {
3739
directoryDelete( item, true );

changelog.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
## [Unreleased]
1111

12+
### Addded
13+
14+
- Lucee 6 Certification
15+
- BoxLang additions
16+
- Better information in dev env, if debugger is not accessible
17+
18+
### Fixed
19+
20+
- CBDEBUGGER-25 - Account for null datasource in QoQ
21+
- Alias for testing mode in CommandBox 6
22+
- JVMUtil wrong location for the temp directory for producing heap dumps
23+
1224
## [4.2.0] - 2024-01-10
1325

1426
### Added

handlers/Main.cfc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,21 @@ component extends="coldbox.system.RestHandler" {
3030
* Debugger disabled event
3131
*/
3232
function disabled( event, rc, prc ){
33+
var data = "Page Not Found";
34+
35+
if ( getSetting( "environment" ) == "DEVELOPMENT" ) {
36+
data = " isDebugCookieValid defined: " & debuggerService.isDebugCookieValid();
37+
data &= ", secretKey defined: " & debuggerService.isSecretKeyDefined();
38+
data &= ", doesCookieMatchesSecretKey: " & debuggerService.doesCookieMatchesSecretKey();
39+
40+
data &= ", debugMode: " & debuggerService.getDebugMode();
41+
}
42+
3343
event.renderData(
3444
statusCode = 404,
3545
statusText = "Not Found",
3646
type = "text",
37-
data = "Page Not Found"
47+
data = data
3848
);
3949
}
4050

models/DebuggerService.cfc

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,23 +146,34 @@ component
146146
*/
147147
boolean function getDebugMode(){
148148
// If no secretKey has been set, don't allow debug mode
149-
if ( not ( len( variables.secretKey ) ) ) {
149+
if ( not ( isSecretKeyDefined() ) ) {
150150
return false;
151151
}
152152
// If Cookie exists, it's value is used.
153153
if ( isDebugCookieValid() ) {
154154
// Must be equal to the current secret key
155-
if ( cookie[ variables.cookieName ] == variables.secretKey ) {
156-
return true;
157-
} else {
158-
return false;
159-
}
155+
return doesCookieMatchesSecretKey()
160156
}
161157

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

162+
/**
163+
* returns boolean if secret key is defined
164+
* init() will set secret key
165+
*/
166+
boolean function isSecretKeyDefined(){
167+
return javacast( "Boolean", len( variables.secretKey ) );
168+
}
169+
170+
/**
171+
* checks if cookie matches secret key
172+
*/
173+
boolean function doesCookieMatchesSecretKey(){
174+
return cookie[ variables.cookieName ] == variables.secretKey;
175+
}
176+
166177
/**
167178
* Checks if the debug cookie is a valid cookie. Boolean
168179
*/

models/JVMUtil.cfc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ component singleton {
2727
*
2828
* @return The absolute path to the generated heap dump
2929
*/
30-
string function generateHeapDump( directoryPath ){
30+
string function generateHeapDump( directoryPath = getTempDirectory() ){
3131
// Create it if it doesn't exist
32-
if ( !directoryExists( arguments.directoryPath = getTempDirectory() ) ) {
32+
if ( !directoryExists( arguments.directoryPath ) ) {
3333
directoryCreate( arguments.directoryPath );
3434
}
3535

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ Apache License, Version 2.0.
6969
- Lucee 5+
7070
- ColdFusion 2018+
7171
- ColdBox 6+
72+
- CommandBox 6 For Development
7273

7374
## Optional Requirements
7475

[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"webroot":"test-harness",
1515
"aliases":{
16-
"/moduleroot/cbdebugger":"../"
16+
"/moduleroot/cbdebugger":"./"
1717
}
1818
},
1919
"openBrowser":"false",

0 commit comments

Comments
 (0)