diff --git a/README.md b/README.md index f5cc26c8..ee31da9d 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ - [Summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md) -- [[tutorial v1.1_030] A variable with type "domainname"](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_030/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_030~1..v1.1_030)) +- [[tutorial v1.1_031] A variable with type's parameters](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_031/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_031~1..v1.1_031)) -# [tutorial v1.1_031)] A variable with type's parameters +# [tutorial v1.1_032)] A variable with type "port" -[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_031~1..v1.1_031) +[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_032~1..v1.1_032) -[Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/disabled.html#a-variable-with-type's-parameters) +[Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/disabled.html#a-variable-with-type-"port") ## Screenshot @@ -31,7 +31,7 @@ pip install rougail-cli rougail-output-exporter rougail-output-doc rougail-user- Then switch to the tutorial page: ```shell -git switch --detach v1.1_031 +git switch --detach v1.1_032 ``` ## Structure @@ -39,10 +39,10 @@ git switch --detach v1.1_031

-.
- └── firefox
-     ├── 00-proxy.yml
-     └── 10-manual.yml
+.
+ └── firefox
+     ├── 00-proxy.yml
+     └── 10-manual.yml


Contents of the firefox/10-manual.yml file @@ -61,6 +61,11 @@ manual: # Manual proxy configuration type: domainname params: allow_ip: true + + port: + description: HTTP Port + type: port + default: 8080 ... ``` @@ -88,19 +93,123 @@ rougail -m firefox/ -o doc | Variable                                                                                            | Description                                                                                         | |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **manual.http_proxy.address**
[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP address.
**Validator**: the domain name can be an IP | +| **manual.http_proxy.port**
[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP Port.
**Validators**:
- well-known ports (1 to 1023) are allowed
- registred ports (1024 to 49151) are allowed
- private ports (greater than 49152) are allowed
**Default**: 8080 | ### Let's generate the changelog ```shell rougail -m firefox/ -o doc --doc.contents changelog ``` -#### Modified variable +#### New variable -| Variable                                                                                            | Description                                                                                         | -|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **manual.http_proxy.address**
[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP address.
**Validator**: the domain name can be an IP | +| Variable                                                                                      | Description                                                                                   | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **manual.http_proxy.port**
[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP Port.
**Validators**:
- well-known ports (1 to 1023) are allowed
- registred ports (1024 to 49151) are allowed
- private ports (greater than 49152) are allowed
**Default**: 8080 | +## User datas + +### Example 1 + +#### config/01/config.yml -- [[tutorial v1.1_032] A variable with type "port"](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_032/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_032~1..v1.1_032)) +```yml +--- +proxy_mode: Manual proxy configuration +manual: + http_proxy: + address: example.net +``` +#### Output + +```shell +rougail -m firefox/ -u yaml -yf config/01/config.yml +``` +
╭────────────── Caption ───────────────╮
+│ Variable Default value               │
+│          Modified value              │
+│          (⏳ Original default value) │
+╰──────────────────────────────────────╯
+Variables:
+┣━━ 📓 Configure Proxy Access to the Internet: Manual proxy configuration ◀ loaded from the YAML file "config/01/config.yml" (⏳ No proxy)
+┗━━ 📂 Manual proxy configuration
+    ┗━━ 📂 HTTP Proxy
+        ┣━━ 📓 HTTP address: example.net ◀ loaded from the YAML file "config/01/config.yml"
+        ┗━━ 📓 HTTP Port: 8080
+
+### Example 2 + +#### config/02/config.yml + + +```yml +--- +proxy_mode: Manual proxy configuration +manual: + http_proxy: + address: example.net + port: 3128 +``` +#### Output + +```shell +rougail -m firefox/ -u yaml -yf config/02/config.yml +``` +
🔔 WARNINGS
+┗━━ the value "3128" is an invalid port for "manual.http_proxy.port" (HTTP Port), which is not a string, it will be ignored when loading from the YAML file "config/02/config.yml"
+╭────────────── Caption ───────────────╮
+│ Variable Default value               │
+│          Modified value              │
+│          (⏳ Original default value) │
+╰──────────────────────────────────────╯
+Variables:
+┣━━ 📓 Configure Proxy Access to the Internet: Manual proxy configuration ◀ loaded from the YAML file "config/02/config.yml" (⏳ No proxy)
+┗━━ 📂 Manual proxy configuration
+    ┗━━ 📂 HTTP Proxy
+        ┣━━ 📓 HTTP address: example.net ◀ loaded from the YAML file "config/02/config.yml"
+        ┗━━ 📓 HTTP Port: 8080
+
+### Example 3 + +#### config/03/config.yml + + +```yml +--- +proxy_mode: Manual proxy configuration +manual: + http_proxy: + address: example.net + port: 100000 +``` +#### Output + +```shell +rougail -m firefox/ -u yaml -yf config/03/config.yml +``` +
🔔 WARNINGS
+┗━━ the value "100000" is an invalid port for "manual.http_proxy.port" (HTTP Port), which is not a string, it will be ignored when loading from the YAML file "config/03/config.yml"
+╭────────────── Caption ───────────────╮
+│ Variable Default value               │
+│          Modified value              │
+│          (⏳ Original default value) │
+╰──────────────────────────────────────╯
+Variables:
+┣━━ 📓 Configure Proxy Access to the Internet: Manual proxy configuration ◀ loaded from the YAML file "config/03/config.yml" (⏳ No proxy)
+┗━━ 📂 Manual proxy configuration
+    ┗━━ 📂 HTTP Proxy
+        ┣━━ 📓 HTTP address: example.net ◀ loaded from the YAML file "config/03/config.yml"
+        ┗━━ 📓 HTTP Port: 8080
+
+#### Output when invalid user datas is an error + +```shell +rougail -m firefox/ -u yaml -yf config/03/config.yml --cli.invalid_user_datas_error +``` +
🛑 ERRORS
+┗━━ the value "100000" is an invalid port for "manual.http_proxy.port" (HTTP Port), which is not a string, it will be ignored when loading from the YAML file "config/03/config.yml"
+
+ + +- [[tutorial v1.1_033] A variable with type "boolean"](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_033/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_033~1..v1.1_033)) diff --git a/config/01/cmd_ro.txt b/config/01/cmd_ro.txt new file mode 100644 index 00000000..d46f9445 --- /dev/null +++ b/config/01/cmd_ro.txt @@ -0,0 +1 @@ +rougail -m firefox/ -u yaml -yf config/01/config.yml \ No newline at end of file diff --git a/config/01/config.yml b/config/01/config.yml new file mode 100644 index 00000000..e3db924b --- /dev/null +++ b/config/01/config.yml @@ -0,0 +1,5 @@ +--- +proxy_mode: Manual proxy configuration +manual: + http_proxy: + address: example.net diff --git a/config/01/output_ro.html b/config/01/output_ro.html new file mode 100644 index 00000000..dcc2f500 --- /dev/null +++ b/config/01/output_ro.html @@ -0,0 +1,12 @@ +
╭────────────── Caption ───────────────╮
+│ Variable Default value               │
+│          Modified value              │
+│          (⏳ Original default value) │
+╰──────────────────────────────────────╯
+Variables:
+┣━━ 📓 Configure Proxy Access to the Internet: Manual proxy configuration ◀ loaded from the YAML file "config/01/config.yml" (⏳ No proxy)
+┗━━ 📂 Manual proxy configuration
+    ┗━━ 📂 HTTP Proxy
+        ┣━━ 📓 HTTP address: example.net ◀ loaded from the YAML file "config/01/config.yml"
+        ┗━━ 📓 HTTP Port: 8080
+
diff --git a/config/02/cmd_ro.txt b/config/02/cmd_ro.txt new file mode 100644 index 00000000..772ebbef --- /dev/null +++ b/config/02/cmd_ro.txt @@ -0,0 +1 @@ +rougail -m firefox/ -u yaml -yf config/02/config.yml \ No newline at end of file diff --git a/config/02/config.yml b/config/02/config.yml new file mode 100644 index 00000000..6e7c9dc6 --- /dev/null +++ b/config/02/config.yml @@ -0,0 +1,6 @@ +--- +proxy_mode: Manual proxy configuration +manual: + http_proxy: + address: example.net + port: 3128 diff --git a/config/02/output_ro.html b/config/02/output_ro.html new file mode 100644 index 00000000..8727b4c6 --- /dev/null +++ b/config/02/output_ro.html @@ -0,0 +1,14 @@ +
🔔 WARNINGS
+┗━━ the value "3128" is an invalid port for "manual.http_proxy.port" (HTTP Port), which is not a string, it will be ignored when loading from the YAML file "config/02/config.yml"
+╭────────────── Caption ───────────────╮
+│ Variable Default value               │
+│          Modified value              │
+│          (⏳ Original default value) │
+╰──────────────────────────────────────╯
+Variables:
+┣━━ 📓 Configure Proxy Access to the Internet: Manual proxy configuration ◀ loaded from the YAML file "config/02/config.yml" (⏳ No proxy)
+┗━━ 📂 Manual proxy configuration
+    ┗━━ 📂 HTTP Proxy
+        ┣━━ 📓 HTTP address: example.net ◀ loaded from the YAML file "config/02/config.yml"
+        ┗━━ 📓 HTTP Port: 8080
+
diff --git a/config/03/cmd_invalid.txt b/config/03/cmd_invalid.txt new file mode 100644 index 00000000..ffde9149 --- /dev/null +++ b/config/03/cmd_invalid.txt @@ -0,0 +1 @@ +rougail -m firefox/ -u yaml -yf config/03/config.yml --cli.invalid_user_datas_error \ No newline at end of file diff --git a/config/03/cmd_ro.txt b/config/03/cmd_ro.txt new file mode 100644 index 00000000..fc8085eb --- /dev/null +++ b/config/03/cmd_ro.txt @@ -0,0 +1 @@ +rougail -m firefox/ -u yaml -yf config/03/config.yml \ No newline at end of file diff --git a/config/03/config.yml b/config/03/config.yml new file mode 100644 index 00000000..d05944fe --- /dev/null +++ b/config/03/config.yml @@ -0,0 +1,6 @@ +--- +proxy_mode: Manual proxy configuration +manual: + http_proxy: + address: example.net + port: 100000 diff --git a/config/03/output_invalid.html b/config/03/output_invalid.html new file mode 100644 index 00000000..497dfc56 --- /dev/null +++ b/config/03/output_invalid.html @@ -0,0 +1,3 @@ +
🛑 ERRORS
+┗━━ the value "100000" is an invalid port for "manual.http_proxy.port" (HTTP Port), which is not a string, it will be ignored when loading from the YAML file "config/03/config.yml"
+
diff --git a/config/03/output_ro.html b/config/03/output_ro.html new file mode 100644 index 00000000..fca38054 --- /dev/null +++ b/config/03/output_ro.html @@ -0,0 +1,14 @@ +
🔔 WARNINGS
+┗━━ the value "100000" is an invalid port for "manual.http_proxy.port" (HTTP Port), which is not a string, it will be ignored when loading from the YAML file "config/03/config.yml"
+╭────────────── Caption ───────────────╮
+│ Variable Default value               │
+│          Modified value              │
+│          (⏳ Original default value) │
+╰──────────────────────────────────────╯
+Variables:
+┣━━ 📓 Configure Proxy Access to the Internet: Manual proxy configuration ◀ loaded from the YAML file "config/03/config.yml" (⏳ No proxy)
+┗━━ 📂 Manual proxy configuration
+    ┗━━ 📂 HTTP Proxy
+        ┣━━ 📓 HTTP address: example.net ◀ loaded from the YAML file "config/03/config.yml"
+        ┗━━ 📓 HTTP Port: 8080
+
diff --git a/tree.html b/tree.html index f3ac9c54..b6437367 100644 --- a/tree.html +++ b/tree.html @@ -25,10 +25,10 @@

Directory Tree

- .
- └── firefox
-     ├── 00-proxy.yml
-     └── 10-manual.yml
+ .
+ └── firefox
+     ├── 00-proxy.yml
+     └── 10-manual.yml


2 directories, 2 files