[tutorial 090] Variable in same family (config and doc)

This commit is contained in:
egarette@silique.fr 2024-11-02 14:58:57 +01:00
parent 0a9139fdbe
commit 9ca5e78812
9 changed files with 18 additions and 184 deletions

146
README.md
View file

@ -1,9 +1,9 @@
- [Summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md)
- [[tutorial 082] A web_address variable ](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_082/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_082~1..v1.1_082))
- [[tutorial 083] A variable with custom validation](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_083/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_083~1..v1.1_083))
# [tutorial 083] A variable with custom validation
# [tutorial 090] Variable in same family
[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_083~1..v1.1_083)
[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_090~1..v1.1_090)
## Screenshot
@ -39,7 +39,7 @@ proxy_mode:
manual:
description: Manual proxy configuration
disabled:
variable: proxy_mode
variable: _.proxy_mode
when_not: 'Manual proxy configuration'
http_proxy: # HTTP Proxy
@ -72,7 +72,7 @@ manual:
- SOCKS
hidden:
jinja: |
{% if my_identifier == 'HTTPS' and manual.use_for_https %}
{% if my_identifier == 'HTTPS' and _.use_for_https %}
HTTPS is same has HTTP
{% endif %}
params:
@ -111,7 +111,7 @@ auto:
description: Automatic proxy configuration URL
type: web_address
disabled:
variable: proxy_mode
variable: _.proxy_mode
when_not: Automatic proxy configuration URL
```
@ -131,7 +131,7 @@ no_proxy:
multi: true
mandatory: false
disabled:
variable: proxy_mode
variable: _.proxy_mode
when: No proxy
examples:
- .mozilla.org
@ -149,7 +149,7 @@ prompt_authentication:
description: Prompt for authentication if password is saved
default: true
disabled:
variable: proxy_mode
variable: _.proxy_mode
when: No proxy
```
@ -164,9 +164,9 @@ proxy_dns_socks5:
mode: advanced
disabled:
jinja: |
{% if manual.socks_proxy.version is propertyerror %}
{% if _.manual.socks_proxy.version is propertyerror %}
the proxy mode is not manual
{% elif manual.socks_proxy.version == 'v4' %}
{% elif _.manual.socks_proxy.version == 'v4' %}
socks version is v4
{% endif %}
description: |
@ -191,7 +191,7 @@ dns_over_https: # DNS over HTTPS
- Custom
default: Cloudflare
disabled:
variable: dns_over_https.enable_dns_over_https
variable: _.enable_dns_over_https
when: false
custom_dns_url:
@ -199,7 +199,7 @@ dns_over_https: # DNS over HTTPS
type: web_address
disabled:
jinja: |
{% if dns_over_https.provider is propertyerror or dns_over_https.provider != 'Custom' %}
{% if _.provider is propertyerror or _.provider != 'Custom' %}
provider is not custom
{% endif %}
description: if "dns_over_https.provider" is not "Custom"
@ -226,7 +226,7 @@ foo@bar:~$ rougail -v 1.1 -m firefox/ --modes_level basic standard advanced -o d
`basic` _`disabled`_
**Disabled**: proxy_mode.
**Disabled**: when the variable "proxy_mode" hasn't the value "Manual proxy configuration".
##### HTTP Proxy
@ -260,9 +260,9 @@ This family builds families dynamically.
| Variable                                                                                                                  | Description                                                                                                               |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **auto**<br/>[`web_address`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` _`disabled`_ | Automatic proxy configuration URL.<br/>**Disabled**: proxy_mode. |
| **no_proxy**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` _`disabled`_ `unique` `multiple` | Address for which proxy will be desactivated.<br/>Connections to localhost, 127.0.0.1/8 and ::1 are never proxied.<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/>**Examples**: <br/>- .mozilla.org<br/>- .net.nz<br/>- 192.168.1.0/24<br/>**Disabled**: proxy_mode. |
| **prompt_authentication**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` _`disabled`_ | Prompt for authentication if password is saved.<br/>**Default**: True<br/>**Disabled**: proxy_mode. |
| **auto**<br/>[`web_address`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` _`disabled`_ | Automatic proxy configuration URL.<br/>**Disabled**: when the variable "proxy_mode" hasn't the value "Automatic proxy configuration URL". |
| **no_proxy**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` _`disabled`_ `unique` `multiple` | Address for which proxy will be desactivated.<br/>Connections to localhost, 127.0.0.1/8 and ::1 are never proxied.<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/>**Examples**: <br/>- .mozilla.org<br/>- .net.nz<br/>- 192.168.1.0/24<br/>**Disabled**: when the variable "proxy_mode" has the value "No proxy". |
| **prompt_authentication**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` _`disabled`_ | Prompt for authentication if password is saved.<br/>**Default**: True<br/>**Disabled**: when the variable "proxy_mode" has the value "No proxy". |
#### DNS over HTTPS
@ -271,120 +271,10 @@ This family builds families dynamically.
| Variable&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **dns_over_https.enable_dns_over_https**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | Enable DNS over HTTPS.<br/>**Default**: False |
| **dns_over_https.provider**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` _`disabled`_ | Use Provider.<br/>**Choices**: <br/>- Cloudflare ← (default)<br/>- NextDNS<br/>- Custom<br/>**Disabled**: dns_over_https.enable_dns_over_https. |
| **dns_over_https.provider**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` _`disabled`_ | Use Provider.<br/>**Choices**: <br/>- Cloudflare ← (default)<br/>- NextDNS<br/>- Custom<br/>**Disabled**: when the variable "dns_over_https.enable_dns_over_https" has the value "False". |
| **dns_over_https.custom_dns_url**<br/>[`web_address`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` _`disabled`_ | Custom DNS URL.<br/>**Validator**: must starts with 'https://' only.<br/>**Disabled**: if "dns_over_https.provider" is not "Custom". |
## User data
### Example 1
#### config/01/config.yaml
```yml
---
```
#### Output
```console
foo@bar:~$ rougail -v 1.1 -m firefox/ --modes_level basic standard advanced -u file -ff config/01/config.yaml
```
<pre>╭────────────────────────── 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>
<span style="color: #5c5cff">┗━━ </span>📂 dns_over_https
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 enable_dns_over_https: <span style="color: #ffd700">False</span>
</pre>
### Example 2
#### config/02/config.yaml
```yml
---
dns_over_https:
enable_dns_over_https: true
```
#### Output
```console
foo@bar:~$ rougail -v 1.1 -m firefox/ --modes_level basic standard advanced -u file -ff config/02/config.yaml
```
<pre>╭────────────────────────── 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>
<span style="color: #5c5cff">┗━━ </span>📂 dns_over_https
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 enable_dns_over_https: True
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 provider: <span style="color: #ffd700">Cloudflare</span>
</pre>
### Example 3
#### config/03/config.yaml
```yml
---
dns_over_https:
enable_dns_over_https: true
provider: Custom
custom_dns_url: http://dns.net
```
#### Output
```console
foo@bar:~$ rougail -v 1.1 -m firefox/ --modes_level basic standard advanced -u file -ff config/03/config.yaml
```
<pre>🛑 ERRORS
<span style="color: #ff0000">┣━━ </span>"http://dns.net" is an invalid URL for "dns_over_https.custom_dns_url (Custom DNS URL)", only https
<span style="color: #ff0000"></span>is allowed
<span style="color: #ff0000">┣━━ </span>The following variables are mandatory but have no value:
<span style="color: #ff0000">┗━━ </span> - dns_over_https.custom_dns_url (Custom DNS URL)
</pre>
### Example 4
#### config/04/config.yaml
```yml
---
dns_over_https:
enable_dns_over_https: true
provider: Custom
custom_dns_url: https://dns.net
```
#### Output
```console
foo@bar:~$ rougail -v 1.1 -m firefox/ --modes_level basic standard advanced -u file -ff config/04/config.yaml
```
<pre>╭────────────────────────── 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>
<span style="color: #5c5cff">┗━━ </span>📂 dns_over_https
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 enable_dns_over_https: True
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 provider: Custom (<span style="color: #00aa00">Cloudflare</span>)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 custom_dns_url: https://dns.net
</pre>
- [[tutorial 090] Variable in same family](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_090/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_090~1..v1.1_090))
- [[tutorial 091] Variable in parent family](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_091/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_091~1..v1.1_091))

View file

@ -1 +0,0 @@
---

View file

@ -1,11 +0,0 @@
<pre>╭────────────────────────── 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>
<span style="color: #5c5cff">┗━━ </span>📂 dns_over_https
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 enable_dns_over_https: <span style="color: #ffd700">False</span>
</pre>

View file

@ -1,3 +0,0 @@
---
dns_over_https:
enable_dns_over_https: true

View file

@ -1,12 +0,0 @@
<pre>╭────────────────────────── 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>
<span style="color: #5c5cff">┗━━ </span>📂 dns_over_https
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 enable_dns_over_https: True
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 provider: <span style="color: #ffd700">Cloudflare</span>
</pre>

View file

@ -1,5 +0,0 @@
---
dns_over_https:
enable_dns_over_https: true
provider: Custom
custom_dns_url: http://dns.net

View file

@ -1,6 +0,0 @@
<pre>🛑 ERRORS
<span style="color: #ff0000">┣━━ </span>"http://dns.net" is an invalid URL for "dns_over_https.custom_dns_url (Custom DNS URL)", only https
<span style="color: #ff0000"></span>is allowed
<span style="color: #ff0000">┣━━ </span>The following variables are mandatory but have no value:
<span style="color: #ff0000">┗━━ </span> - dns_over_https.custom_dns_url (Custom DNS URL)
</pre>

View file

@ -1,5 +0,0 @@
---
dns_over_https:
enable_dns_over_https: true
provider: Custom
custom_dns_url: https://dns.net

View file

@ -1,13 +0,0 @@
<pre>╭────────────────────────── 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>
<span style="color: #5c5cff">┗━━ </span>📂 dns_over_https
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 enable_dns_over_https: True
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📓 provider: Custom (<span style="color: #00aa00">Cloudflare</span>)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 custom_dns_url: https://dns.net
</pre>