[tutorial 072] A non mandatory variable (config and doc)

This commit is contained in:
egarette@silique.fr 2024-11-02 14:58:44 +01:00
parent 65222d4c4d
commit b13e0d7673
9 changed files with 102 additions and 31 deletions

View file

@ -1,9 +1,9 @@
- [Summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md)
- [[tutorial 070] A variable with type "domainname", parameters type and disabled](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_070/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_070~1..v1.1_070))
- [[tutorial 071] A variable with multiple value](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_071/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_071~1..v1.1_071))
# [tutorial 071] A variable with multiple value
# [tutorial 072] A non mandatory variable
[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_071~1..v1.1_071)
[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_072~1..v1.1_072)
## Screenshot
@ -129,6 +129,7 @@ no_proxy:
allow_without_dot: true
allow_startswith_dot: true
multi: true
mandatory: false
disabled:
variable: proxy_mode
when: No proxy
@ -182,7 +183,7 @@ This family builds families dynamically.
| Variable                                                                                                                                                                                  | Description                                                                                                                                                                               |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **auto**<br/>[`web_address`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` _`disabled`_ | Automatic proxy configuration URL.<br/>**Disabled**: proxy_mode. |
| **no_proxy**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` _`disabled`_ `unique` `multiple` | Address for which proxy will be desactivated.<br/>**Validators**:<br/>- the domain name can starts by a dot<br/>- the domain name can be a hostname<br/>- the domain name can be an IP<br/>- the domain name can be network in CIDR format<br/>**Disabled**: proxy_mode. |
| **no_proxy**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) _`disabled`_ `unique` `multiple` | Address for which proxy will be desactivated.<br/>**Validators**:<br/>- the domain name can starts by a dot<br/>- the domain name can be a hostname<br/>- the domain name can be an IP<br/>- the domain name can be network in CIDR format<br/>**Disabled**: proxy_mode. |
## User data
@ -217,11 +218,7 @@ Variables:
```yml
---
proxy_mode: Automatic proxy configuration URL
auto: https://auto.proxy.net/wpad.dat
no_proxy:
- example.net
- 192.168.1.0/24
proxy_mode: No proxy
```
#### Output
@ -236,11 +233,7 @@ foo@bar:~$ rougail -v 1.1 -m firefox/ -u file -ff config/02/config.yaml
<span style="color: #ffaf00">Unmodifiable variable</span>
╰─────────────────────────────────────────────────────────────╯
Variables:
<span style="color: #5c5cff">┣━━ </span>📓 proxy_mode: Automatic proxy configuration URL (<span style="color: #00aa00">No proxy</span>)
<span style="color: #5c5cff">┣━━ </span>📓 auto: https://auto.proxy.net/wpad.dat
<span style="color: #5c5cff">┗━━ </span>📓 no_proxy :
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>example.net
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>192.168.1.0/24
<span style="color: #5c5cff">┗━━ </span>📓 proxy_mode: No proxy (<span style="color: #00aa00">No proxy</span>)
</pre>
### Example 3
@ -249,8 +242,7 @@ Variables:
```yml
---
proxy_mode: Automatic proxy configuration URL
auto: https://auto.proxy.net/wpad.dat
proxy_mode: Manual proxy configuration
```
#### Output
@ -260,8 +252,65 @@ foo@bar:~$ rougail -v 1.1 -m firefox/ -u file -ff config/03/config.yaml
```
<pre>🛑 ERRORS
<span style="color: #ff0000">┣━━ </span>The following variables are mandatory but have no value:
<span style="color: #ff0000">┗━━ </span> - no_proxy (Address for which proxy will be desactivated)
<span style="color: #ff0000">┣━━ </span> - manual.http_proxy.address (HTTP address)
<span style="color: #ff0000">┗━━ </span> - manual.socks_proxy.address (SOCKS address)
</pre>
### Example 4
#### config/04/config.yaml
```yml
---
proxy_mode: foo
```
#### Output
```console
foo@bar:~$ rougail -v 1.1 -m firefox/ -u file -ff config/04/config.yaml
```
<pre>🛑 ERRORS
<span style="color: #ff0000">┗━━ </span>"foo" is an invalid choice for "proxy_mode (Configure Proxy Access to the Internet)", only
<span style="color: #ff0000"> </span>"Auto-detect proxy settings for this network", "Automatic proxy configuration URL", "Manual proxy
<span style="color: #ff0000"> </span>configuration", "No proxy" and "Use system proxy settings" are allowed
╭────────────────────────── Caption ──────────────────────────╮
│ Variable <span style="color: #ffd700">Default value</span>
<span style="color: #5c5cff">Undocumented variable</span> Modified value │
<span style="color: #ff0000">Undocumented but modified variable</span> (<span style="color: #00aa00">Original default value</span>) │
<span style="color: #ffaf00">Unmodifiable variable</span>
╰─────────────────────────────────────────────────────────────╯
Variables:
<span style="color: #5c5cff">┗━━ </span>📓 proxy_mode: <span style="color: #ffd700">No proxy</span>
</pre>
### Example 5
#### config/05/config.yaml
```yml
---
proxy_mode: 1
```
#### Output
```console
foo@bar:~$ rougail -v 1.1 -m firefox/ -u file -ff config/05/config.yaml
```
<pre>🛑 ERRORS
<span style="color: #ff0000">┗━━ </span>"1" is an invalid choice for "proxy_mode (Configure Proxy Access to the Internet)", only "Auto-detect
<span style="color: #ff0000"> </span>proxy settings for this network", "Automatic proxy configuration URL", "Manual proxy configuration",
<span style="color: #ff0000"> </span>"No proxy" and "Use system proxy settings" are allowed
╭────────────────────────── Caption ──────────────────────────╮
│ Variable <span style="color: #ffd700">Default value</span>
<span style="color: #5c5cff">Undocumented variable</span> Modified value │
<span style="color: #ff0000">Undocumented but modified variable</span> (<span style="color: #00aa00">Original default value</span>) │
<span style="color: #ffaf00">Unmodifiable variable</span>
╰─────────────────────────────────────────────────────────────╯
Variables:
<span style="color: #5c5cff">┗━━ </span>📓 proxy_mode: <span style="color: #ffd700">No proxy</span>
</pre>
- [[tutorial 072] A non mandatory variable](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_072/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_072~1..v1.1_072))
- [[tutorial 073] Examples](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_073/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_073~1..v1.1_073))

View file

@ -1,6 +1,2 @@
---
proxy_mode: Automatic proxy configuration URL
auto: https://auto.proxy.net/wpad.dat
no_proxy:
- example.net
- 192.168.1.0/24
proxy_mode: No proxy

View file

@ -5,9 +5,5 @@
<span style="color: #ffaf00">Unmodifiable variable</span>
╰─────────────────────────────────────────────────────────────╯
Variables:
<span style="color: #5c5cff">┣━━ </span>📓 proxy_mode: Automatic proxy configuration URL (<span style="color: #00aa00">No proxy</span>)
<span style="color: #5c5cff">┣━━ </span>📓 auto: https://auto.proxy.net/wpad.dat
<span style="color: #5c5cff">┗━━ </span>📓 no_proxy :
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>example.net
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>192.168.1.0/24
<span style="color: #5c5cff">┗━━ </span>📓 proxy_mode: No proxy (<span style="color: #00aa00">No proxy</span>)
</pre>

View file

@ -1,3 +1,2 @@
---
proxy_mode: Automatic proxy configuration URL
auto: https://auto.proxy.net/wpad.dat
proxy_mode: Manual proxy configuration

View file

@ -1,4 +1,5 @@
<pre>🛑 ERRORS
<span style="color: #ff0000">┣━━ </span>The following variables are mandatory but have no value:
<span style="color: #ff0000">┗━━ </span> - no_proxy (Address for which proxy will be desactivated)
<span style="color: #ff0000">┣━━ </span> - manual.http_proxy.address (HTTP address)
<span style="color: #ff0000">┗━━ </span> - manual.socks_proxy.address (SOCKS address)
</pre>

2
config/04/config.yaml Normal file
View file

@ -0,0 +1,2 @@
---
proxy_mode: foo

13
config/04/output_ro.html Normal file
View file

@ -0,0 +1,13 @@
<pre>🛑 ERRORS
<span style="color: #ff0000">┗━━ </span>"foo" is an invalid choice for "proxy_mode (Configure Proxy Access to the Internet)", only
<span style="color: #ff0000"> </span>"Auto-detect proxy settings for this network", "Automatic proxy configuration URL", "Manual proxy
<span style="color: #ff0000"> </span>configuration", "No proxy" and "Use system proxy settings" are allowed
╭────────────────────────── Caption ──────────────────────────╮
│ Variable <span style="color: #ffd700">Default value</span>
<span style="color: #5c5cff">Undocumented variable</span> Modified value │
<span style="color: #ff0000">Undocumented but modified variable</span> (<span style="color: #00aa00">Original default value</span>) │
<span style="color: #ffaf00">Unmodifiable variable</span>
╰─────────────────────────────────────────────────────────────╯
Variables:
<span style="color: #5c5cff">┗━━ </span>📓 proxy_mode: <span style="color: #ffd700">No proxy</span>
</pre>

2
config/05/config.yaml Normal file
View file

@ -0,0 +1,2 @@
---
proxy_mode: 1

13
config/05/output_ro.html Normal file
View file

@ -0,0 +1,13 @@
<pre>🛑 ERRORS
<span style="color: #ff0000">┗━━ </span>"1" is an invalid choice for "proxy_mode (Configure Proxy Access to the Internet)", only "Auto-detect
<span style="color: #ff0000"> </span>proxy settings for this network", "Automatic proxy configuration URL", "Manual proxy configuration",
<span style="color: #ff0000"> </span>"No proxy" and "Use system proxy settings" are allowed
╭────────────────────────── Caption ──────────────────────────╮
│ Variable <span style="color: #ffd700">Default value</span>
<span style="color: #5c5cff">Undocumented variable</span> Modified value │
<span style="color: #ff0000">Undocumented but modified variable</span> (<span style="color: #00aa00">Original default value</span>) │
<span style="color: #ffaf00">Unmodifiable variable</span>
╰─────────────────────────────────────────────────────────────╯
Variables:
<span style="color: #5c5cff">┗━━ </span>📓 proxy_mode: <span style="color: #ffd700">No proxy</span>
</pre>