Skip to content

Commit e20e9e5

Browse files
committed
Merge branch 'development' of github.com:coldbox-modules/cbdebugger into development
2 parents 6c629a0 + 2635fee commit e20e9e5

File tree

10 files changed

+64
-33
lines changed

10 files changed

+64
-33
lines changed

ModuleConfig.cfc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,22 @@ component {
3434
variables.settings = {
3535
// Internal engine flags
3636
engine : {
37-
isLucee = server.keyExists( "lucee" ),
38-
isBoxLang = server.keyExists( "boxlang" ),
39-
isAdobe = server.keyExists( "coldfusion" ) && server.coldfusion.productName.findNoCase( "ColdFusion" )
37+
isLucee : server.keyExists( "lucee" ),
38+
isBoxLang : server.keyExists( "boxlang" ),
39+
isAdobe : server.keyExists( "coldfusion" ) && server.coldfusion.productName.findNoCase(
40+
"ColdFusion"
41+
)
4042
},
41-
4243
// This flag enables/disables the tracking of request data to our storage facilities
4344
// To disable all tracking, turn this master key off
4445
enabled : true,
4546
// This setting controls if you will activate the debugger for visualizations ONLY
4647
// The debugger will still track requests even in non debug mode.
4748
debugMode : controller.getSetting( name = "environment", defaultValue = "production" ) == "development",
4849
// 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
4953
debugPassword : "cb:null",
5054
// This flag enables/disables the end of request debugger panel docked to the bottem of the page.
5155
// If you disable i, then the only way to visualize the debugger is via the `/cbdebugger` endpoint

box.json

Lines changed: 1 addition & 1 deletion
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.3.0",
5+
"version":"4.4.0",
66
"slug":"cbdebugger",
77
"type":"modules",
88
"homepage":"https://github.com/coldbox-modules/cbdebugger",

changelog.md

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

1010
## [Unreleased]
1111

12+
## [4.3.0] - 2024-06-18
13+
1214
### Addded
1315

1416
- Lucee 6 Certification
1517
- BoxLang additions
18+
- Better information in dev env, if debugger is not accessible
1619

1720
### Fixed
1821

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

@@ -45,7 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4549

4650
- Dumb whitespace added by CFML engines when doing inline `<pre>#method()#</pre>` calls.
4751
- Better error handling when Debugger assets are not compiled instead of a cryptic error message:
48-
`The parameter [str] to function [closure_m] is required but was not passed in.`
52+
`The parameter [str] to function [closure_m] is required but was not passed in.`
4953

5054
## [4.1.0] - 2023-04-17
5155

@@ -297,7 +301,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
297301
- <https://ortussolutions.atlassian.net/browse/CCM-25> Lucee support
298302
- <https://ortussolutions.atlassian.net/browse/CCM-24> Added names of rendered
299303
- Unloading of helpers on unload
300-
views and layouts
304+
views and layouts
301305
- Updated production ignore lists
302306

303307
## [1.0.1]
@@ -308,7 +312,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
308312

309313
- Create first module version
310314

311-
[Unreleased]: https://github.com/coldbox-modules/cbdebugger/compare/v4.2.0...HEAD
315+
[Unreleased]: https://github.com/coldbox-modules/cbdebugger/compare/v4.3.0...HEAD
316+
317+
[4.3.0]: https://github.com/coldbox-modules/cbdebugger/compare/v4.2.0...v4.3.0
312318

313319
[4.2.0]: https://github.com/coldbox-modules/cbdebugger/compare/v4.1.0...v4.2.0
314320

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
*/

package-lock.json

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/main/panels/requestTracker/acfSqlPanel.cfm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
#numberFormat( q.endTime - q.startTime )# ms
183183
</td>
184184
<td align="center">
185-
#q.datasource#
185+
#( q.datasource ?: "QoQ" )#
186186
</td>
187187
<td>
188188
<cfif q.template.len()>

views/main/panels/requestTracker/acfSqlTable.cfm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</td>
3232

3333
<td align="center">
34-
#q.datasource#
34+
#( q.datasource ?: "QoQ" )#
3535
</td>
3636

3737
<td>

views/main/panels/requestTracker/luceeSqlPanel.cfm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
#numberFormat( q.executionTime / 1000000 )# ms
198198
</td>
199199
<td align="center">
200-
#q.datasource#
200+
#( q.datasource ?: "QoQ" )#
201201
</td>
202202
<td>
203203
<cfif q.src.len()>

views/main/panels/requestTracker/luceeSqlTable.cfm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</td>
3131

3232
<td align="center">
33-
#q.datasource#
33+
#( q.datasource ?: "QoQ" )#
3434
</td>
3535

3636
<td>

0 commit comments

Comments
 (0)