You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--http-probe-cmd-upload http probe flag for uploads and the related --http-probe-cmd-file data format enhancements as well as api spec request data generation enhancements
Copy file name to clipboardExpand all lines: README.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -430,8 +430,9 @@ In the interactive CLI prompt mode you must specify the target image using the `
430
430
-`--poststart-compose-svc` - placeholder for now
431
431
-`--http-probe` - Enables/disables HTTP probing (ENABLED by default; you have to disable the probe if you don't need it by setting the flag to `false`: `--http-probe=false`)
432
432
-`--http-probe-off` - Alternative way to disable HTTP probing
433
-
-`--http-probe-cmd` - Additional HTTP probe command[can use this flag multiple times]
433
+
-`--http-probe-cmd` - User defined HTTP probe(s) as `[[[[\"crawl\":]PROTO:]METHOD:]PATH]`[can use this flag multiple times]
434
434
-`--http-probe-cmd-file` - File with user defined HTTP probe commands
435
+
-`--http-probe-cmd-upload` - User defined HTTP probe(s) to submit form data as `[[[[[PROTO:]FORM_FILE_NAME:]FORM_FIELD_NAME:]FILE_OR_GENERATE_TYPE:]PATH]`[can use this flag multiple times
435
436
-`--http-probe-start-wait` - Number of seconds to wait before starting HTTP probing
436
437
-`--http-probe-retry-count` - Number of retries for each HTTP probe (default value: 5)
437
438
-`--http-probe-retry-wait` - Number of seconds to wait before retrying HTTP probe (doubles when target is not ready; default value: 8)
@@ -958,12 +959,14 @@ To configure Docker Desktop to create the default Unix socket open its UI and go
958
959
959
960
## HTTP PROBE COMMANDS
960
961
961
-
If the HTTP probe is enabled (note: it is enabled by default) it will default to running `GET /` with HTTP and then HTTPS on every exposed port. You can add additional commands using the `--http-probe-cmd` and `--http-probe-cmd-file` options.
962
+
If the HTTP probe is enabled (note: it is enabled by default) it will default to running `GET /` with HTTP and then HTTPS on every exposed port. You can add additional commands using the `--http-probe-cmd`, `--http-probe-cmd-upload` and `--http-probe-cmd-file` options.
962
963
963
964
If you want to disable HTTP probing set the `--http-probe` flag to false (e.g., `--http-probe=false`). You can also use the `--http-probe-off` flag to do the same (simply use the flag without any parameters).
964
965
965
966
The `--http-probe-cmd` option is good when you want to specify a small number of simple commands where you select some or all of these HTTP command options: crawling (defaults to false), protocol, method (defaults to GET), resource (path and query string).
966
967
968
+
The `--http-probe-cmd-upload` option is good when you want to upload a file. The file upload is done using a multipart form data request (the most common way to upload files). The flag value has the following format: `[[[[[PROTO:]FORM_FILE_NAME:]FORM_FIELD_NAME:]FILE_OR_GENERATE_TYPE:]PATH]`. The most basic flag value is a `PATH` (e.g., `--http-probe-cmd-upload /uploadpath`). When no file to upload or data generate instruction is provided a simple text file is generated. The `FILE_OR_GENERATE_TYPE` section can either point to a local file path for the file to upload or it can be one of the data generate instructions: `generate.text`, `generate.text.json`, `generate.image`, `generate.image.png`, `generate.image.jpeg`, `generate.image.gif`. You can specify a custom form field name to use for the request using the `FORM_FIELD_NAME` section (defaults to `file`). You can also specify the file name for the upload using the `FORM_FILE_NAME` section (defaults to `file.data` or the base path of the file name when `FILE_OR_GENERATE_TYPE` points to a local file). The `PROTO` section is used to scope the request to a specific protocol (`http`, `https`, etc). Note that you can also specify an upload command using a JSON record provided with the `--http-probe-cmd-file` flag (see below).
969
+
967
970
If you only want to use custom HTTP probe command and you don't want the default `GET /` command added to the command list you explicitly provided you'll need to set `--http-probe` to false when you specify your custom HTTP probe command. Note that this inconsistency will be addressed in the future releases to make it less confusing.
968
971
969
972
Possible field combinations:
@@ -992,9 +995,14 @@ Available HTTP command options:
992
995
*`headers` - array of strings with column delimited key/value pairs (e.g., "Content-Type: application/json")
993
996
*`body` - request body as a string
994
997
*`body_file` - request body loaded from the provided file
998
+
*`body_generate` - auto-generate request body using one of the instructions: `generate.text`, `generate.text.json`, `generate.image`, `generate.image.png`, `generate.image.jpeg`, `generate.image.gif`
999
+
*`body_is_form` - request body is a multipart form (request data from `body`, `body_file` or `body_generate` will be form encoded)
1000
+
*`form_field_name` - form field name to use (for form submissions)
1001
+
*`form_file_name` - form file name to use (for form submissions)
995
1002
*`username` - username to use for basic auth
996
1003
*`password` - password to use for basic auth
997
1004
*`crawl` - boolean to indicate if you want to crawl the target (to visit all referenced resources)
1005
+
*`fastcgi` - Fast CGI config params (todo: document sub-fields, see code for details)
Copy file name to clipboardExpand all lines: pkg/app/master/command/cliflags.go
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -111,6 +111,7 @@ const (
111
111
FlagHTTPProbeOff="http-probe-off"//alternative way to disable http probing
112
112
FlagHTTPProbeCmd="http-probe-cmd"
113
113
FlagHTTPProbeCmdFile="http-probe-cmd-file"
114
+
FlagHTTPProbeCmdUpload="http-probe-cmd-upload"
114
115
FlagHTTPProbeStartWait="http-probe-start-wait"
115
116
FlagHTTPProbeRetryCount="http-probe-retry-count"
116
117
FlagHTTPProbeRetryWait="http-probe-retry-wait"
@@ -223,6 +224,7 @@ const (
223
224
FlagHTTPProbeUsage="Enable or disable HTTP probing"
224
225
FlagHTTPProbeOffUsage="Alternative way to disable HTTP probing"
225
226
FlagHTTPProbeCmdUsage="User defined HTTP probe(s) as [[[[\"crawl\":]PROTO:]METHOD:]PATH]"
227
+
FlagHTTPProbeCmdUploadUsage="User defined HTTP probe(s) to submit form data as [[[[[PROTO:]FORM_FILE_NAME:]FORM_FIELD_NAME:]FILE_OR_GENERATE_TYPE:]PATH]"
226
228
FlagHTTPProbeCmdFileUsage="File with user defined HTTP probes"
227
229
FlagHTTPProbeStartWaitUsage="Number of seconds to wait before starting HTTP probing"
228
230
FlagHTTPProbeRetryCountUsage="Number of retries for each HTTP probe"
@@ -610,6 +612,12 @@ var CommonFlags = map[string]cli.Flag{
0 commit comments