[tutorial v1.1_032)] A variable with type "port" (config and doc)
This commit is contained in:
parent
eafbc6acc2
commit
391d758ad0
13 changed files with 191 additions and 18 deletions
137
README.md
137
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
|
|||
|
||||
|
||||
<p>
|
||||
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_031/./">.</a><br/>
|
||||
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_031/./firefox/">firefox</a><br/>
|
||||
├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_031/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
|
||||
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_031/./firefox/10-manual.yml">10-manual.yml</a><br/>
|
||||
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_032/./">.</a><br/>
|
||||
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_032/./firefox/">firefox</a><br/>
|
||||
├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_032/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
|
||||
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_032/./firefox/10-manual.yml">10-manual.yml</a><br/>
|
||||
<br/><br/></p>
|
||||
|
||||
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**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP address.<br/>**Validator**: the domain name can be an IP |
|
||||
| **manual.http_proxy.port**<br/>[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP Port.<br/>**Validators**: <br/>- well-known ports (1 to 1023) are allowed<br/>- registred ports (1024 to 49151) are allowed<br/>- private ports (greater than 49152) are allowed<br/>**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**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP address.<br/>**Validator**: <ins>the domain name can be an IP</ins> |
|
||||
| Variable | Description |
|
||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| **manual.http_proxy.port**<br/>[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP Port.<br/>**Validators**: <br/>- well-known ports (1 to 1023) are allowed<br/>- registred ports (1024 to 49151) are allowed<br/>- private ports (greater than 49152) are allowed<br/>**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
|
||||
```
|
||||
<pre>╭────────────── Caption ───────────────╮
|
||||
│ Variable <span style="color: #ffd700">Default value</span> │
|
||||
│ Modified value │
|
||||
│ (<span style="color: #00aa00">⏳ Original default value</span>) │
|
||||
╰──────────────────────────────────────╯
|
||||
Variables:
|
||||
<span style="color: #5c5cff">┣━━ </span>📓 Configure Proxy Access to the Internet: Manual proxy configuration ◀ loaded from the YAML file "config/01/config.yml" (⏳ <span style="color: #00aa00">No proxy</span>)
|
||||
<span style="color: #5c5cff">┗━━ </span>📂 Manual proxy configuration
|
||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📂 HTTP Proxy
|
||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 HTTP address: example.net ◀ loaded from the YAML file "config/01/config.yml"
|
||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 HTTP Port: <span style="color: #ffd700">8080</span>
|
||||
</pre>
|
||||
### 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
|
||||
```
|
||||
<pre><span style="font-weight: bold; color: #ffff00">🔔 WARNINGS</span>
|
||||
<span style="color: #ffff00">┗━━ </span>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 <span style="color: #ffd700">Default value</span> │
|
||||
│ Modified value │
|
||||
│ (<span style="color: #00aa00">⏳ Original default value</span>) │
|
||||
╰──────────────────────────────────────╯
|
||||
Variables:
|
||||
<span style="color: #5c5cff">┣━━ </span>📓 Configure Proxy Access to the Internet: Manual proxy configuration ◀ loaded from the YAML file "config/02/config.yml" (⏳ <span style="color: #00aa00">No proxy</span>)
|
||||
<span style="color: #5c5cff">┗━━ </span>📂 Manual proxy configuration
|
||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📂 HTTP Proxy
|
||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 HTTP address: example.net ◀ loaded from the YAML file "config/02/config.yml"
|
||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 HTTP Port: <span style="color: #ffd700">8080</span>
|
||||
</pre>
|
||||
### 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
|
||||
```
|
||||
<pre><span style="font-weight: bold; color: #ffff00">🔔 WARNINGS</span>
|
||||
<span style="color: #ffff00">┗━━ </span>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 <span style="color: #ffd700">Default value</span> │
|
||||
│ Modified value │
|
||||
│ (<span style="color: #00aa00">⏳ Original default value</span>) │
|
||||
╰──────────────────────────────────────╯
|
||||
Variables:
|
||||
<span style="color: #5c5cff">┣━━ </span>📓 Configure Proxy Access to the Internet: Manual proxy configuration ◀ loaded from the YAML file "config/03/config.yml" (⏳ <span style="color: #00aa00">No proxy</span>)
|
||||
<span style="color: #5c5cff">┗━━ </span>📂 Manual proxy configuration
|
||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📂 HTTP Proxy
|
||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 HTTP address: example.net ◀ loaded from the YAML file "config/03/config.yml"
|
||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 HTTP Port: <span style="color: #ffd700">8080</span>
|
||||
</pre>
|
||||
#### Output when invalid user datas is an error
|
||||
|
||||
```shell
|
||||
rougail -m firefox/ -u yaml -yf config/03/config.yml --cli.invalid_user_datas_error
|
||||
```
|
||||
<pre><span style="font-weight: bold; color: #ff0000">🛑 ERRORS</span>
|
||||
<span style="color: #ff0000">┗━━ </span>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"
|
||||
</pre>
|
||||
|
||||
|
||||
- [[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))
|
||||
|
|
|
|||
1
config/01/cmd_ro.txt
Normal file
1
config/01/cmd_ro.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
rougail -m firefox/ -u yaml -yf config/01/config.yml
|
||||
5
config/01/config.yml
Normal file
5
config/01/config.yml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
proxy_mode: Manual proxy configuration
|
||||
manual:
|
||||
http_proxy:
|
||||
address: example.net
|
||||
12
config/01/output_ro.html
Normal file
12
config/01/output_ro.html
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<pre>╭────────────── Caption ───────────────╮
|
||||
│ Variable <span style="color: #ffd700">Default value</span> │
|
||||
│ Modified value │
|
||||
│ (<span style="color: #00aa00">⏳ Original default value</span>) │
|
||||
╰──────────────────────────────────────╯
|
||||
Variables:
|
||||
<span style="color: #5c5cff">┣━━ </span>📓 Configure Proxy Access to the Internet: Manual proxy configuration ◀ loaded from the YAML file "config/01/config.yml" (⏳ <span style="color: #00aa00">No proxy</span>)
|
||||
<span style="color: #5c5cff">┗━━ </span>📂 Manual proxy configuration
|
||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📂 HTTP Proxy
|
||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 HTTP address: example.net ◀ loaded from the YAML file "config/01/config.yml"
|
||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 HTTP Port: <span style="color: #ffd700">8080</span>
|
||||
</pre>
|
||||
1
config/02/cmd_ro.txt
Normal file
1
config/02/cmd_ro.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
rougail -m firefox/ -u yaml -yf config/02/config.yml
|
||||
6
config/02/config.yml
Normal file
6
config/02/config.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
proxy_mode: Manual proxy configuration
|
||||
manual:
|
||||
http_proxy:
|
||||
address: example.net
|
||||
port: 3128
|
||||
14
config/02/output_ro.html
Normal file
14
config/02/output_ro.html
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<pre><span style="font-weight: bold; color: #ffff00">🔔 WARNINGS</span>
|
||||
<span style="color: #ffff00">┗━━ </span>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 <span style="color: #ffd700">Default value</span> │
|
||||
│ Modified value │
|
||||
│ (<span style="color: #00aa00">⏳ Original default value</span>) │
|
||||
╰──────────────────────────────────────╯
|
||||
Variables:
|
||||
<span style="color: #5c5cff">┣━━ </span>📓 Configure Proxy Access to the Internet: Manual proxy configuration ◀ loaded from the YAML file "config/02/config.yml" (⏳ <span style="color: #00aa00">No proxy</span>)
|
||||
<span style="color: #5c5cff">┗━━ </span>📂 Manual proxy configuration
|
||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📂 HTTP Proxy
|
||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 HTTP address: example.net ◀ loaded from the YAML file "config/02/config.yml"
|
||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 HTTP Port: <span style="color: #ffd700">8080</span>
|
||||
</pre>
|
||||
1
config/03/cmd_invalid.txt
Normal file
1
config/03/cmd_invalid.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
rougail -m firefox/ -u yaml -yf config/03/config.yml --cli.invalid_user_datas_error
|
||||
1
config/03/cmd_ro.txt
Normal file
1
config/03/cmd_ro.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
rougail -m firefox/ -u yaml -yf config/03/config.yml
|
||||
6
config/03/config.yml
Normal file
6
config/03/config.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
proxy_mode: Manual proxy configuration
|
||||
manual:
|
||||
http_proxy:
|
||||
address: example.net
|
||||
port: 100000
|
||||
3
config/03/output_invalid.html
Normal file
3
config/03/output_invalid.html
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<pre><span style="font-weight: bold; color: #ff0000">🛑 ERRORS</span>
|
||||
<span style="color: #ff0000">┗━━ </span>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"
|
||||
</pre>
|
||||
14
config/03/output_ro.html
Normal file
14
config/03/output_ro.html
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<pre><span style="font-weight: bold; color: #ffff00">🔔 WARNINGS</span>
|
||||
<span style="color: #ffff00">┗━━ </span>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 <span style="color: #ffd700">Default value</span> │
|
||||
│ Modified value │
|
||||
│ (<span style="color: #00aa00">⏳ Original default value</span>) │
|
||||
╰──────────────────────────────────────╯
|
||||
Variables:
|
||||
<span style="color: #5c5cff">┣━━ </span>📓 Configure Proxy Access to the Internet: Manual proxy configuration ◀ loaded from the YAML file "config/03/config.yml" (⏳ <span style="color: #00aa00">No proxy</span>)
|
||||
<span style="color: #5c5cff">┗━━ </span>📂 Manual proxy configuration
|
||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📂 HTTP Proxy
|
||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 HTTP address: example.net ◀ loaded from the YAML file "config/03/config.yml"
|
||||
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 HTTP Port: <span style="color: #ffd700">8080</span>
|
||||
</pre>
|
||||
|
|
@ -25,10 +25,10 @@
|
|||
</head>
|
||||
<body>
|
||||
<h1>Directory Tree</h1><p>
|
||||
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_031/./">.</a><br>
|
||||
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_031/./firefox/">firefox</a><br>
|
||||
├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_031/./firefox/00-proxy.yml">00-proxy.yml</a><br>
|
||||
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_031/./firefox/10-manual.yml">10-manual.yml</a><br>
|
||||
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_032/./">.</a><br>
|
||||
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_032/./firefox/">firefox</a><br>
|
||||
├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_032/./firefox/00-proxy.yml">00-proxy.yml</a><br>
|
||||
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_032/./firefox/10-manual.yml">10-manual.yml</a><br>
|
||||
<br><br><p>
|
||||
|
||||
2 directories, 2 files
|
||||
|
|
|
|||
Loading…
Reference in a new issue