Skip to content

Commit 2ed8e31

Browse files
bdw429sgitbook-bot
authored andcommitted
GitBook: [ortus-docs#8] No subject
1 parent b33f142 commit 2ed8e31

37 files changed

+298
-30
lines changed
Loading
Loading
Loading
Loading
Loading
Loading

about-this-book.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ We highly encourage contribution to this book and our open source software. The
1818

1919
## Charitable Proceeds
2020

21-
15% of the proceeds of this book will go to charity to support orphaned kids in El Salvador - [http://www.harvesting.org/](http://www.harvesting.org). Please donate and purchase the printed version of this book as every book sold can help a child for almost 2 months.
21+
15% of the proceeds of this book will go to charity to support orphaned kids in El Salvador - [http://www.harvesting.org/](http://www.harvesting.org/). Please donate and purchase the printed version of this book as every book sold can help a child for almost 2 months.
2222

2323
### Shalom Children's Home
2424

25-
![](<.gitbook/assets/shalom (2) (2) (2) (2) (2) (2) (2) (1).jpg>)
25+
![](<.gitbook/assets/shalom (2) (2) (2) (2) (2) (2) (2) (1) (1).jpg>)
2626

27-
Shalom Children’s Home ([http://www.harvesting.org/](http://www.harvesting.org)) is one of the ministries that is dear to our hearts located in El Salvador. During the 12 year civil war that ended in 1990, many children were left orphaned or abandoned by parents who fled El Salvador. The Benners saw the need to help these children and received 13 children in 1982. Little by little, more children came on their own, churches and the government brought children to them for care, and the Shalom Children’s Home was founded.
27+
Shalom Children’s Home ([http://www.harvesting.org/](http://www.harvesting.org/)) is one of the ministries that is dear to our hearts located in El Salvador. During the 12 year civil war that ended in 1990, many children were left orphaned or abandoned by parents who fled El Salvador. The Benners saw the need to help these children and received 13 children in 1982. Little by little, more children came on their own, churches and the government brought children to them for care, and the Shalom Children’s Home was founded.
2828

2929
Shalom now cares for over 80 children in El Salvador, from newborns to 18 years old. They receive shelter, clothing, food, medical care, education and life skills training in a Christian environment. The home is supported by a child sponsorship program.
3030

config-settings/endpoint-settings.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ These settings are used to configure CommandBox's endpoints.
1010

1111
**string**
1212

13-
The API Token provided to you when you signed up for [ForgeBox.io](https://www.forgebox.io). This will be set for you automatically when you use the `forgebox register` or `forgebox login` commands. This token will be sent to ForgeBox to authenticate you. Please do not share this secret token with others as it will give them permission to edit your packages!
13+
The API Token provided to you when you signed up for [ForgeBox.io](https://www.forgebox.io/). This will be set for you automatically when you use the `forgebox register` or `forgebox login` commands. This token will be sent to ForgeBox to authenticate you. Please do not share this secret token with others as it will give them permission to edit your packages!
1414

1515
```bash
1616
config set endpoints.forgebox.APIToken=my-very-long-secret-key

config-settings/misc-settings.md

+48
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,51 @@ config show tabCompleteInline
8989
```
9090

9191
![](<../.gitbook/assets/image (7).png>)
92+
93+
## developerMode
94+
95+
The `developerMode` setting reloads shell before each command to help testing changes to CommandBox core or modules.
96+
97+
```
98+
config set developerMode=true
99+
```
100+
101+
It will prevent you from needing to use the `reload` command, but it will cause a delay before each command. Don't forget to turn this back off when you're done.
102+
103+
## terminalWidth
104+
105+
Terminal width can be overridden for entire CLI. This will affect ASCII art, interactive job output, progress bars, and the table printer.
106+
107+
```
108+
config set terminalWidth=150
109+
```
110+
111+
## offlineMode
112+
113+
The `offlineMode` setting will disable most external HTTP calls. This can be useful for
114+
115+
* testing production server starts to ensure they aren’t reliant on external calls
116+
* running `box` in a secure network which blocks or flags any external access
117+
118+
```bash
119+
# enable offline mode
120+
config set offlineMode=true
121+
122+
# go back to normal
123+
config set offlineMode=falses
124+
```
125+
126+
&#x20;This setting is obeyed in the following parts of CommandBox:
127+
128+
* commandbox-update-check module
129+
* installation endpoints
130+
* forgebox
131+
* http/https/cached+http/cached\_https
132+
* git/git+ssh/git+https/github
133+
* java
134+
* lex
135+
* jar
136+
* CFLib
137+
* S3
138+
* upgrade command
139+
* inside the progressable downloader class

deploying-commandbox/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
CommandBox may also be used in production or continuous deployments, since it allows you to orchestrate your server environment. This eliminates dependency on hardware, and makes your CFML applications more portable, as a whole.&#x20;
44

55
{% hint style="info" %}
6-
For advanced server configurations, be sure to check out the [`CFConfig` module](https://cfconfig.ortusbooks.com).
6+
For advanced server configurations, be sure to check out the [`CFConfig` module](https://cfconfig.ortusbooks.com/).
77
{% endhint %}
88

99
Since the startup of a CommandBox server allows you specify a host and server port, you can easily bind your server to a machine IP address and specify which port it should serve the application on. This allows you to proxy traffic to the application from IIS, Apache, or NGINX and even allows you to serve traffic directly on HTTP port 80 or 443, if you choose.

deploying-commandbox/heroku.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![](../.gitbook/assets/heroku.png)
44

5-
The [Heroku buildpack for CommandBox](https://github.com/ortus-solutions/heroku-buildpack-commandbox) will allow you to deploy your CFML applications directly to [Heroku](https://www.heroku.com) (or to [Dokku](http://dokku.viewdocs.io/dokku/) hosts) using CommandBox to manage your CFML engine. It allows you to specify your custom server configuration settings using the CommandBox server API, avoiding additional script and configuration files during the Heroku deployment process.
5+
The [Heroku buildpack for CommandBox](https://github.com/ortus-solutions/heroku-buildpack-commandbox) will allow you to deploy your CFML applications directly to [Heroku](https://www.heroku.com/) (or to [Dokku](http://dokku.viewdocs.io/dokku/) hosts) using CommandBox to manage your CFML engine. It allows you to specify your custom server configuration settings using the CommandBox server API, avoiding additional script and configuration files during the Heroku deployment process.
66

77
## Usage
88

developing-for-commandbox/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,13 @@ CommandBox's expressive CLI gets its power from commands. You can create your ow
1919
Customizing the internals of CommandBox is achieved via an event model known as interceptors. What this means is that at pre-defined points in the lifecycle of the shell, command execution, or web server starting, the CLI broadcasts events that you can listen to. This lets you provide custom error handling, special server handling, or modify command output. Interceptors are packaged up in modules and can be combined with custom commands and config settings for fully-configurable shell add-ons.
2020

2121
[Read about **Developing Interceptors** here.](interceptors/)
22+
23+
## Developer Mode
24+
25+
The `developerMode` setting reloads shell before each command to help testing changes to CommandBox core or modules.
26+
27+
```
28+
config set developerMode=true
29+
```
30+
31+
It will prevent you from needing to use the `reload` command, but it will cause a delay before each command. Don't forget to turn this back off when you're done.

embedded-server/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ config set server.defaults.trayEnable=false
4040

4141
## Full Control
4242

43-
CommandBox's embedded server does not require any prior installations of any CFML engine to work. It does not use Apache, IIS, or Nginx. A very lightweight Java web server called [Undertow](http://undertow.io) is used and a context is programmatically deployed via a WAR file.
43+
CommandBox's embedded server does not require any prior installations of any CFML engine to work. It does not use Apache, IIS, or Nginx. A very lightweight Java web server called [Undertow](http://undertow.io/) is used and a context is programmatically deployed via a WAR file.
4444

4545
You should still have all the options you need to set up most local development servers quickly. The web-based administrator is available to you where you can edit any setting, add data sources, CF mappings, and mail servers. To see a list of all the parameters you can pass to the `server start` command, refer to the [CommandBox API Docs](http://apidocs.ortussolutions.com/commandbox/5.0.0/index.html?commandbox/system/modules\_app/server-commands/commands/server/start.html) or run `server start help` command directly from the CLI.
4646

embedded-server/configuring-your-server/experimental-features.md

+36
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,41 @@ server set runwar.args="--cache-servlet-paths=true"
8484

8585
Standard Adobe ColdFusion installations have a similar cache of "real" paths from the servlet context that is tied to a setting in the administrator called "Cache Webserver paths" but that setting is not available and does not work on CommandBox servers for some reason..
8686

87+
## Custom Log Pattern
8788

89+
The Java logging library Log4j is used for servers' log files and console logs. The default logging pattern is:
8890

91+
```
92+
[%-5p] %c: %m%n
93+
```
94+
95+
You can customize this with any valid Log4j pattern layout, which you can find here:
96+
97+
{% embed url="https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html" %}
98+
99+
This would put the date/time into every log message:
100+
101+
```
102+
server set runwar.args='--log-pattern "[%-5p] %d{dd MMM yyyy HH:mm:ss.SSS} %c: %m%n"'
103+
```
104+
105+
This would log ONLY the message with no severity or category:
106+
107+
```
108+
server set runwar.args='--log-pattern "%m%n"'
109+
```
110+
111+
Note, the color coding of log lines in CommandBox is dependent upon the default Log4j pattern layout.
112+
113+
## Disable Resource Manager Change Listener
114+
115+
There is an XNIO file system watcher started for the web root and any virtual directories in your server. This change listener serves two purposes:
116+
117+
* Cache invalidation for the servlet path lookup matching
118+
* Cache invalidation for welcome file lookups
119+
120+
In normal operations you should have no issues with this, but it has been observed starting a server in a web root with a very large number of files (like over 200,000) can consume a lot of resources, and even cause out of memory errors. The change listener in Undertow can be disabled with this setting:
121+
122+
```
123+
server set runwar.args='--resource-manager-file-system-watcher=false'
124+
```

embedded-server/configuring-your-server/jvm-args.md

+44
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,28 @@ server set JVM.args="-XX:MaxGCPauseMillis\=200"
4949
server show JVM.args
5050
```
5151

52+
JVM args can also be set an array of strings which prevents you from needing to escape or quote anything. &#x20;
53+
54+
```
55+
{
56+
"jvm" : {
57+
"args" : [
58+
"-XX:+UseG1GC",
59+
"-XX:-CreateMinidumpOnCrash",
60+
"--add-opens=java.base/java.net=ALL-UNNAMED"
61+
]
62+
}
63+
}
64+
```
65+
66+
Or via the CLI like so:
67+
68+
```
69+
server set jvm.args=["-XX:+UseG1GC"]
70+
server set jvm.args=["-XX:-CreateMinidumpOnCrash"] --append
71+
server set jvm.args=["--add-opens=java.base/java.net=ALL-UNNAMED"] --append
72+
```
73+
5274
## Ad Hoc Runwar Options
5375

5476
You can specify ad-hoc options for the underlying Runwar library using the `RunwarArgs` parameter.
@@ -63,3 +85,25 @@ In `server.json`
6385
server set runwar.args="--sendfile-enable false"
6486
server show runwar.args
6587
```
88+
89+
Runwar args can also be set an array of strings which prevents you from needing to escape or quote anything. &#x20;
90+
91+
```
92+
{
93+
"runwar" : {
94+
"args" : [
95+
"--runwar-option",
96+
"value",
97+
"--runwar-option2",
98+
"value2"
99+
]
100+
}
101+
}
102+
```
103+
104+
Or via the CLI like so:
105+
106+
```
107+
server set runwar.args=["--runwar-option","value"]
108+
server set runwar.args=["--runwar-option2","value2"] --append
109+
```

embedded-server/configuring-your-server/server-port-and-host.md

+8
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ server show web.SSL.enable
4040
server show web.SSL.port
4141
```
4242

43+
#### Setting SSL Enabled protocols
44+
45+
You can customize what SSL protocols your HTTPS listener will respond to with the following XNIO option. Supply a comma-delimited list of valid protocols. &#x20;
46+
47+
```
48+
server set runwar.XNIOOptions.SSL_ENABLED_PROTOCOLS=TLSv1.3,TLSv1.2
49+
```
50+
4351
### HTTP/2
4452

4553
HTTP/2 is a newer standard of HTTP supported by all modern browsers. HTTP/2 is enabled by default any time you are using an HTTP/HTTPS listener, however all major browsers will only allow the server to negotiate HTTP/2 over an HTTPS connection. HTTP/2 runs over the same port and only changes the exchange between the server and browser. You can disable HTTP/2 support like so:

embedded-server/configuring-your-server/undertow-options.md

+2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ To set an XNIO option that CommandBox doesn't already expose with a first-class
3333

3434
```bash
3535
server set runwar.XNIOOptions.WORKER_NAME=myWorker
36+
server set runwar.XNIOOptions.SSL_ENABLED_PROTOCOLS=TLSv1.3,TLSv1.2
3637
```
3738

3839
You can also set global XNIO objects that will apply to all servers. Global options will be appended to server-level options.
3940

4041
```bash
4142
config set server.defaults.runwar.XNIOOptions.WORKER_NAME=myWorker
43+
config set server.defaults.runwar.XNIOOptions.SSL_ENABLED_PROTOCOLS=TLSv1.3,TLSv1.2
4244
```

embedded-server/server-logs.md

+59
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,62 @@ server log myServername --follow --rewrites
122122
```
123123

124124
Your rewrites log will be auto-rotated every 10MB. The amount of information that appears in the rewrites log will be affected by the `--debug` and `--trace` flags when you start the server.
125+
126+
## Request Dumping
127+
128+
There is a feature you can use to dump all the header details for an HTTP request and response in the form of an Undertow handler called `dump-request()`. Just include the following server rule in your `server.json`
129+
130+
```javascript
131+
{
132+
"web" : {
133+
"rules" : [
134+
"dump-request()"
135+
]
136+
}
137+
}
138+
```
139+
140+
To fire only for certain requests, you can pair the handler with any predicate you wish:
141+
142+
```
143+
{
144+
"web" : {
145+
"rules" : [
146+
"regex('(.*).cfm') -> dump-request()"
147+
]
148+
}
149+
}
150+
```
151+
152+
Then start your server with the `--console` flag or tail the console with `server log --follow` and you'll see info like this for each request:
153+
154+
```
155+
Request Dump:
156+
----------------------------REQUEST---------------------------
157+
URI=/bar.cfm
158+
characterEncoding=null
159+
contentLength=-1
160+
contentType=null
161+
header=Accept=text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
162+
header=Accept-Language=en-US,en;q=0.9,nb;q=0.8,da;q=0.7
163+
header=Accept-Encoding=gzip, deflate, br
164+
header=User-Agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36
165+
header=Host=127.0.0.1:55599
166+
locale=[en_US, en, nb, da]
167+
method=GET
168+
protocol=HTTP/1.1
169+
scheme=http
170+
host=127.0.0.1:55599
171+
serverPort=55599
172+
isSecure=false
173+
--------------------------RESPONSE--------------------------
174+
contentLength=3
175+
contentType=text/html;charset=UTF-8
176+
header=Connection=keep-alive
177+
header=Content-Type=text/html;charset=UTF-8
178+
header=Content-Length=3
179+
header=Date=Thu, 31 Mar 2022 22:55:19 GMT
180+
status=200
181+
182+
==============================================================
183+
```

embedded-server/server-versions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ One minor difference to keep in mind is Lucee server and Adobe ColdFusion use a
1414
5.3.4.80
1515
```
1616

17-
However, [CommandBox](https://commandbox.ortusbooks.com) and [ForgeBox](https://www.forgebox.io) use the [npm-flavored semantic versioning](https://commandbox.ortusbooks.com/package-management/semantic-versioning) (semver) which is slightly different. Basically the build ID is moved to the end after a plus (+) sign.
17+
However, [CommandBox](https://commandbox.ortusbooks.com/) and [ForgeBox](https://www.forgebox.io/) use the [npm-flavored semantic versioning](https://commandbox.ortusbooks.com/package-management/semantic-versioning) (semver) which is slightly different. Basically the build ID is moved to the end after a plus (+) sign.
1818

1919
```bash
2020
<major>.<minor>.<patch>[-<preReleaseID>]+<build>
@@ -76,7 +76,7 @@ server start [email protected]+48
7676

7777
## **Lucee Light builds on ForgeBox**
7878

79-
Lucee has a modular core and comes bundled with a bunch of extensions that approximate the functionality that comes bundled with Adobe ColdFusion. But that means you are loading the Hibernate libraries, PDF libraries or JDBC drivers even if you don't need them. There is a second type of Lucee server called "Lucee Light" which contains all the core engine, but with zero extensions. People creating custom docker builds for example will start with Lucee Light and then add back only the extensions their app needs. To get a feel for all the Lucee extensions available, see [this page](https://download.lucee.org) that lists all official extensions.
79+
Lucee has a modular core and comes bundled with a bunch of extensions that approximate the functionality that comes bundled with Adobe ColdFusion. But that means you are loading the Hibernate libraries, PDF libraries or JDBC drivers even if you don't need them. There is a second type of Lucee server called "Lucee Light" which contains all the core engine, but with zero extensions. People creating custom docker builds for example will start with Lucee Light and then add back only the extensions their app needs. To get a feel for all the Lucee extensions available, see [this page](https://download.lucee.org/) that lists all official extensions.
8080

8181
We're now publishing CF Engines to ForgeBox based on the Lucee Light builds which allows you to start up a Lucee Light server. These are under a ForgeBox package named `lucee-light` and we've also backfilled all the same versions that exist for the normal `lucee` engine. Note, the three bullets points above apply to Lucee Light as well, Just replace `lucee` with `lucee-light` and you're good to go.
8282

getting-started-guide.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ You're well on your way now. While you wait for arrival you might want to secure
2727

2828
## 2. Unzip & First Run
2929

30-
![Setup](<.gitbook/assets/open\_package (2) (2) (2) (2) (2) (2) (2) (1).png>)
30+
![Setup](<.gitbook/assets/open\_package (2) (2) (2) (2) (2) (2) (2) (1) (1).png>)
3131

3232
Your CommandBox is sent to you via a zip archive. Decompress the archive to a location of your choice. The **No JRE Included** download will only have one file in it named `box`. For Windows users, this will be an `exe` file. For unix-based users, it will be an executable binary. The **With JRE Included** version will have a `jre` folder. You can move `box.exe`, but keep the `jre` folder in the same relative location as the executable so it can be found.
3333

34-
![CommandBox Icon](<.gitbook/assets/box\_icon (2) (2) (2) (2) (2) (2) (2) (1).png>)
34+
![CommandBox Icon](<.gitbook/assets/box\_icon (2) (2) (2) (2) (2) (2) (2) (1) (1).png>)
3535

3636
Now just double click the file from your GUI, or execute it via a console window. This will start a short, quick, one-time process of unpacking CommandBox into your user's home directory. Congratulations, CommandBox is now installed! You'll still run the same executable binary every time you want to use the CLI, but the extraction process won't need to happen again.
3737

@@ -41,7 +41,7 @@ The green `CommandBox>` prompt is what we call the _interactive shell_. Type `ex
4141

4242
## 3. Setup & Usage
4343

44-
![Start Using](<.gitbook/assets/run (1) (1) (1) (1) (2) (2) (2) (2) (2) (2) (1).png>)
44+
![Start Using](<.gitbook/assets/run (1) (1) (1) (1) (2) (2) (2) (2) (2) (2) (1) (1).png>)
4545

4646
To open up the interactive shell at any time, just double click on the `box` executable. If you prefer to stay in your OS's native shell, then just place the `box` file in your system path and add it before any CommandBox commands like so:
4747

ide-integrations/visual-studio-code.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ What do you want to do with VSC?
1111

1212
## Installing VSCode
1313

14-
This IDE has it's own domain. ( [https://code.visualstudio.com/](https://code.visualstudio.com) ) with downloads for **macOS**, **Windows** and **Linux** on the home page. :+1:
14+
This IDE has it's own domain. ( [https://code.visualstudio.com/](https://code.visualstudio.com/) ) with downloads for **macOS**, **Windows** and **Linux** on the home page. :+1:
1515

1616
![Visual Studio Code Snapshot](https://code.visualstudio.com/home/home-screenshot-win-lg.png)
1717

0 commit comments

Comments
 (0)