|
@@ -7,29 +7,45 @@ A full list of argument types are below;
|
|
|
[%header,cols="1,0,2"]
|
|
[%header,cols="1,0,2"]
|
|
|
|===
|
|
|===
|
|
|
| Type | Rendered as | Allowed values
|
|
| Type | Rendered as | Allowed values
|
|
|
-| (default) | xref:args/input.adoc[Textbox] | If a `type:` is not set, and `choices:` is empty, then ascii will be used, and a warning will be logged. It is recommended that you set the type explicitly, rather than relying on defaults.
|
|
|
|
|
-| ascii | xref:args/input.adoc[Textbox] | a-z (case insensitive), 0-9, but no spaces or punctuation
|
|
|
|
|
-| ascii_identifier | xref:args/input.adoc[Textbox] | Like a DNS name, a-Z (case insensitive), 0-9, `-`, `.`, and `_`.
|
|
|
|
|
|
|
+| (default) | xref:args/input.adoc[Textbox] | If a `type:` is not set, and `choices:` is empty, then `ascii` will be used, and a config warning is reported. It is recommended that you set the type explicitly, rather than relying on defaults.
|
|
|
|
|
+| ascii | xref:args/input.adoc[Textbox] | `a-z`, `A-Z`, `0-9` only. No spaces or punctuation.
|
|
|
|
|
+| ascii_identifier | xref:args/input.adoc[Textbox] | `a-z`, `A-Z`, `0-9`, `-`, `.`, and `_`.
|
|
|
| dnsname | xref:args/input.adoc[Textbox] | A DNS hostname (RFC 1123). Short names (e.g. `webserver`) and FQDNs (e.g. `webserver.example.com`). Letters/digits/hyphens only, no underscores. Optional trailing dot allowed.
|
|
| dnsname | xref:args/input.adoc[Textbox] | A DNS hostname (RFC 1123). Short names (e.g. `webserver`) and FQDNs (e.g. `webserver.example.com`). Letters/digits/hyphens only, no underscores. Optional trailing dot allowed.
|
|
|
| shell_safe_identifier | xref:args/input.adoc[Textbox] | Like an ascii identifier, but also allows `@` and `+`. Useful for shell-safe usernames and email-style identifiers.
|
|
| shell_safe_identifier | xref:args/input.adoc[Textbox] | Like an ascii identifier, but also allows `@` and `+`. Useful for shell-safe usernames and email-style identifiers.
|
|
|
-| ascii_sentence | xref:args/input.adoc[Textbox] | a-z (case insensitive), 0-9, with spaces, `.` and `,`.
|
|
|
|
|
-| unicode_identifier | xref:args/input.adoc[Textbox] | Like an ascii identifier, but allows unicode characters. This is useful for languages that use non-ascii characters, such as Chinese, Japanese, etc.
|
|
|
|
|
-| email | xref:args/input.adoc[Textbox] | An email address.
|
|
|
|
|
-| password | xref:args/password.adoc[Password] | A password, which is hidden when typed.
|
|
|
|
|
-| very_dangerous_raw_string | xref:args/input.adoc[Textbox] | Anything. This is **incredibly dangerous**, as effectively people can type anything they like, including executing additional commands beyond what you specify. Absolutely should not be used unless your OliveTin instance can only be used by people you trust entirely.
|
|
|
|
|
-| regex:... | xref:args/input.adoc[Textbox] | Version 2024.03.081 and above support custom regex patterns. See xref:args/regex.adoc[Custom regex arguments].
|
|
|
|
|
-| int | xref:args/input.adoc[Textbox] | Any number, made up of the characters 0 to 9. Negative numbers are not supported.
|
|
|
|
|
-| url | xref:args/input.adoc[Textbox] | A URL (e.g. https://example.com). Accepts any scheme, including `file://` and `ftp://`. See warning below.
|
|
|
|
|
|
|
+| ascii_sentence | xref:args/input.adoc[Textbox] | `a-z`, `A-Z`, `0-9`, spaces, `.`, `,`, `-`, and `_`.
|
|
|
|
|
+| unicode_identifier | xref:args/input.adoc[Textbox] | Same character class as Go's `\w` plus `-` and `.` (ASCII letters, digits, and `_`, plus `-` and `.`). Despite the name, non-ASCII letters are **not** accepted by the current server check.
|
|
|
|
|
+| email | xref:args/input.adoc[Textbox] | An email address (parsed with Go's `mail.ParseAddress`).
|
|
|
|
|
+| password | xref:args/password.adoc[Password] | Any string (not type-checked). Hidden in the UI. **Not allowed with `shell:`** — use `exec:`.
|
|
|
|
|
+| very_dangerous_raw_string | xref:args/input.adoc[Textbox] | Anything. This is **incredibly dangerous**, as effectively people can type anything they like, including executing additional commands beyond what you specify. Absolutely should not be used unless your OliveTin instance can only be used by people you trust entirely. **Not allowed with `shell:`** — use `exec:`.
|
|
|
|
|
+| regex:... | xref:args/input.adoc[Textbox] | Custom regex patterns. See xref:args/regex.adoc[Custom regex arguments]. **Not allowed with `shell:`** — use `exec:`.
|
|
|
|
|
+| int | xref:args/input.adoc[Textbox] | Digits `0-9` only. Negative numbers are not supported.
|
|
|
|
|
+| url | xref:args/input.adoc[Textbox] | A URL with scheme `http` or `https` only (e.g. `https://example.com`). **Not allowed with `shell:`** — use `exec:`.
|
|
|
|
|
+| datetime | xref:args/input_datetime.adoc[Date & Time] | A local datetime in the form `YYYY-MM-DDTHH:MM:SS` (seconds may be mangled to `:00` when browsers omit them).
|
|
|
| confirmation | xref:args/input_confirmation.adoc[Confirmation] | A UI gate that requires a checkbox before starting. Usually unnamed (nothing is substituted). If named, the value is only `0` or `1`.
|
|
| confirmation | xref:args/input_confirmation.adoc[Confirmation] | A UI gate that requires a checkbox before starting. Usually unnamed (nothing is substituted). If named, the value is only `0` or `1`.
|
|
|
-| checklist | xref:args/input_checklist.adoc[Checklist] | Multiple checkboxes from predefined choices. Selected values are passed as a comma-separated string.
|
|
|
|
|
-| n/a, but `choices` used | xref:args/input_dropdown.adoc[Dropdown] | A "hidden" argument that makes the action require a confirmation before launching.
|
|
|
|
|
-| raw_string_multiline | xref:args/input_textarea.adoc[Textarea] | Anything. This is **dangerous**, as effectively people can type anything they like
|
|
|
|
|
|
|
+| checkbox | xref:args/input_checkbox.adoc[Checkbox] | Typically used with `choices` for on/off flag values. A checkbox **without** choices is **not allowed with `shell:`** — use `exec:` or define choices.
|
|
|
|
|
+| checklist | xref:args/input_checklist.adoc[Checklist] | Multiple checkboxes from predefined choices. Selected values are passed as a JSON array string (e.g. `["documents","photos"]`).
|
|
|
|
|
+| n/a, but `choices` used | xref:args/input_dropdown.adoc[Dropdown] | Predefined choices shown as a dropdown. The submitted value must match one of the choice values (or an entity-expanded choice).
|
|
|
|
|
+| raw_string_multiline | xref:args/input_textarea.adoc[Textarea] | Anything (not type-checked). **Dangerous**, and **not allowed with `shell:`** — use `exec:`.
|
|
|
|===
|
|
|===
|
|
|
|
|
|
|
|
-[WARNING]
|
|
|
|
|
-.Security risk: URL argument type
|
|
|
|
|
-====
|
|
|
|
|
-The `url` argument type does not restrict the URL scheme. Users can enter `file://` (local filesystem) URLs, `ftp://`, or other schemes. If the argument value is passed directly to curl, wget, or similar tools, a malicious or mistaken input could read local files, access internal services, or trigger unwanted network requests.
|
|
|
|
|
|
|
+[#shell-blocked-arg-types]
|
|
|
|
|
+== Types that cannot be used with `shell:`
|
|
|
|
|
+
|
|
|
|
|
+When an action uses `shell:` (including with arguments substituted into the command string), OliveTin rejects these argument types and asks you to use `exec:` instead:
|
|
|
|
|
+
|
|
|
|
|
+* `url`
|
|
|
|
|
+* `email`
|
|
|
|
|
+* `password`
|
|
|
|
|
+* `raw_string_multiline`
|
|
|
|
|
+* `very_dangerous_raw_string`
|
|
|
|
|
+* `html` (internal/display-oriented; skips normal type checks)
|
|
|
|
|
+* any custom `regex:...` type
|
|
|
|
|
+* `checkbox` when it has **no** `choices`
|
|
|
|
|
|
|
|
-If your action might be used by untrusted users, validate or filter the URL in your script (e.g. allow only `https://`) before using the value.
|
|
|
|
|
|
|
+See xref:action_execution/shellvsexec.adoc[Shell vs Exec].
|
|
|
|
|
+
|
|
|
|
|
+[NOTE]
|
|
|
|
|
+.URL schemes
|
|
|
|
|
+====
|
|
|
|
|
+The `url` type accepts only `http` and `https`. Schemes such as `file://`, `ftp://`, and `gopher://` are rejected by the server.
|
|
|
====
|
|
====
|