@ -1,9 +1,9 @@
- [Summary ](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md )
- [Summary ](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md )
- [[tutorial v1.1_020] A variable with type "domainname"](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_020/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_020~1..v1.1_020 ))
- [[tutorial v1.1_021] A variable with type's parameters](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_021/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_021~1..v1.1_021 ))
# [tutorial v1.1_021)] A variable with type's parameters
# [tutorial v1.1_022)] A variable with type "port"
[View the diff ](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_02 1~1..v1.1_021 )
[View the diff ](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_02 2~1..v1.1_022 )
## Screenshot
## Screenshot
@ -29,7 +29,7 @@ pip install rougail-cli rougail-output-exporter rougail-output-doc rougail-user-
Then switch to the tutorial page:
Then switch to the tutorial page:
```shell
```shell
git switch --detach v1.1_021
git switch --detach v1.1_022
```
```
## Structure
## Structure
@ -37,10 +37,10 @@ git switch --detach v1.1_021
< p >
< p >
< a href = "https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_02 1 /./"> .< / a > < br / >
< a href = "https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_02 2 /./"> .< / a > < br / >
└── < a href = "https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_02 1 /./firefox/"> firefox< / a > < br / >
└── < a href = "https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_02 2 /./firefox/"> firefox< / a > < br / >
├── < a href = "https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_02 1 /./firefox/00-proxy.yml"> 00-proxy.yml< / a > < br / >
├── < a href = "https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_02 2 /./firefox/00-proxy.yml"> 00-proxy.yml< / a > < br / >
└── < a href = "https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_02 1 /./firefox/10-manual.yml"> 10-manual.yml< / a > < br / >
└── < a href = "https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_02 2 /./firefox/10-manual.yml"> 10-manual.yml< / a > < br / >
< br / > < br / > < / p >
< br / > < br / > < / p >
Contents of the firefox/10-manual.yml file
Contents of the firefox/10-manual.yml file
@ -59,6 +59,11 @@ manual: # Manual proxy configuration
type: domainname
type: domainname
params:
params:
allow_ip: true
allow_ip: true
port:
description: HTTP Port
type: port
default: 8080
...
...
```
```
@ -86,17 +91,18 @@ rougail -m firefox/ -o doc
| Variable | Description |
| 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.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
### Let's generate the changelog
```shell
```shell
rougail -m firefox/ -o doc --doc.contents changelog
rougail -m firefox/ -o doc --doc.contents changelog
```
```
#### Modified variable
#### New variable
| Variable | Description |
| 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 > |
| **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
## User datas
@ -108,6 +114,7 @@ rougail -m firefox/ -o doc --doc.contents changelog
```yml
```yml
---
---
proxy_mode: Manual proxy configuration
manual:
manual:
http_proxy:
http_proxy:
address: example.net
address: example.net
@ -117,15 +124,17 @@ manual:
```shell
```shell
rougail -m firefox/ -u yaml -yf config/01/config.yml
rougail -m firefox/ -u yaml -yf config/01/config.yml
```
```
< pre > ╭──────── Caption ────────╮
< pre > ╭────────────── Caption ─────── ────────╮
│ Variable < span style = "color: #ffd700 " > Default value</ span > │
│ Variable < span style = "color: #ffd700 " > Default value</ span > │
│ Modified value │
│ Modified value │
╰─────────────────────────╯
│ (< span style = "color: #00aa00 " > ⏳ Original default value</ span > ) │
╰──────────────────────────────────────╯
Variables:
Variables:
< span style = "color: #5c5cff " > ┣━━ </ span > 📓 Configure Proxy Access to the Internet: < span style = "color: # ffd7 00" > No proxy</ span >
< 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: # 00aa 00" > No proxy</ span > )
< span style = "color: #5c5cff " > ┗━━ </ span > 📂 Manual proxy configuration
< 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 > 📂 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 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 >
< / pre >
### Example 2
### Example 2
@ -134,39 +143,27 @@ Variables:
```yml
```yml
---
---
proxy_mode: Manual proxy configuration
manual:
manual:
http_proxy:
http_proxy:
address: 192.168.0.1
address: example.net
port: 3128
```
```
#### Output
#### Output
```shell
```shell
rougail -m firefox/ -u yaml -yf config/02/config.yml
rougail -m firefox/ -u yaml -yf config/02/config.yml
```
```
< pre > ╭──────── Caption ────────╮
< pre > ╭────────────── Caption ─────── ────────╮
│ Variable < span style = "color: #ffd700 " > Default value</ span > │
│ Variable Modified value │
│ Modified value │
│ (< span style = "color: #00aa00 " > ⏳ Original default value</ span > ) │
╰─────────────────────────╯
╰────────────────────────────────────── ╯
Variables:
Variables:
< span style = "color: #5c5cff " > ┣━━ </ span > 📓 Configure Proxy Access to the Internet: < span style = "color: # ffd7 00" > No proxy</ span >
< 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: # 00aa 00" > No proxy</ span > )
< span style = "color: #5c5cff " > ┗━━ </ span > 📂 Manual proxy configuration
< 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 > 📂 HTTP Proxy
< span style = "color: #5c5cff " > </ span >< span style = "color: #5c5cff " > </ span >< span style = "color: #5c5cff " > ┗━━ </ span > 📓 HTTP address: 192.168.0.1 ◀ 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 address: example.net ◀ loaded from the YAML file "config/02/config.yml"
< / pre >
< span style = "color: #5c5cff " > </ span >< span style = "color: #5c5cff " > </ span >< span style = "color: #5c5cff " > ┗━━ </ span > 📓 HTTP Port: 3128 ◀ loaded from the YAML file "config/02/config.yml" (⏳ < span style = "color: #00aa00 " > 8080</ span > )
#### Output when invalid user datas is an error
```shell
rougail -m firefox/ -u yaml -yf config/02/config.yml --cli.invalid_user_datas_error
```
< pre > ╭──────── Caption ────────╮
│ Variable < span style = "color: #ffd700 " > Default value</ span > │
│ Modified value │
╰─────────────────────────╯
Variables:
< span style = "color: #5c5cff " > ┣━━ </ span > 📓 Configure Proxy Access to the Internet: < span style = "color: #ffd700 " > 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: 192.168.0.1 ◀ loaded from the YAML file "config/02/config.yml"
< / pre >
< / pre >
### Example 3
### Example 3
@ -175,9 +172,11 @@ Variables:
```yml
```yml
---
---
proxy_mode: Manual proxy configuration
manual:
manual:
http_proxy:
http_proxy:
address: not a valid domain name
address: example.net
port: 100000
```
```
#### Output
#### Output
@ -185,12 +184,18 @@ manual:
rougail -m firefox/ -u yaml -yf config/03/config.yml
rougail -m firefox/ -u yaml -yf config/03/config.yml
```
```
< pre >< span style = "font-weight: bold; color: #ffff00 " > 🔔 WARNINGS</ span >
< pre >< span style = "font-weight: bold; color: #ffff00 " > 🔔 WARNINGS</ span >
< span style = "color: #ffff00 " > ┗━━ </ span > the value "not a valid domain name" is an invalid domain name for "manual.http_proxy.address" (HTTP address), must have dot, it will be ignored when loading from the YAML file "config/03/config.yml"
< span style = "color: #ffff00 " > ┗━━ </ span > the value "100000" is an invalid port for "manual.http_proxy.port" (HTTP Port), must be between 1 and 65535, it will be ignored when loading from the YAML file "config/03/config.yml"
< span style = "font-weight: bold; color: #ff0000 " > 🛑 ERRORS</ span >
╭────────────── Caption ───────────────╮
< span style = "color: #ff0000 " > ┗━━ </ span > The following variables are mandatory but have no value:
│ Variable < span style = "color: #ffd700 " > Default value</ span > │
< span style = "color: #ff0000 " > </ span >< span style = "color: #ff0000 " > ┗━━ </ span > Manual proxy configuration
│ Modified value │
< span style = "color: #ff0000 " > </ span >< span style = "color: #ff0000 " > </ span >< span style = "color: #ff0000 " > ┗━━ </ span > HTTP Proxy
│ (< span style = "color: #00aa00 " > ⏳ Original default value</ span > ) │
< span style = "color: #ff0000 " > </ span >< span style = "color: #ff0000 " > </ span >< span style = "color: #ff0000 " > </ span >< span style = "color: #ff0000 " > ┗━━ </ span > HTTP address
╰──────────────────────────────────────╯
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 >
< / pre >
#### Output when invalid user datas is an error
#### Output when invalid user datas is an error
@ -198,8 +203,8 @@ rougail -m firefox/ -u yaml -yf config/03/config.yml
rougail -m firefox/ -u yaml -yf config/03/config.yml --cli.invalid_user_datas_error
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 >
< pre >< span style = "font-weight: bold; color: #ff0000 " > 🛑 ERRORS</ span >
< span style = "color: #ff0000 " > ┗━━ </ span > the value "not a valid domain name" is an invalid domain name for "manual.http_proxy.address" (HTTP address), must have dot , it will be ignored when loading from the YAML file "config/03/config.yml"
< span style = "color: #ff0000 " > ┗━━ </ span > the value "100000" is an invalid port for "manual.http_proxy.port" (HTTP Port), must be between 1 and 65535 , it will be ignored when loading from the YAML file "config/03/config.yml"
< / pre >
< / pre >
- [[tutorial v1.1_022] A variable with type "port"](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_022/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_022~1..v1.1_022 ))
- [[tutorial v1.1_023] A variable with type "boolean"](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_023/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_023~1..v1.1_023 ))