commentaires jusqu'au 15

This commit is contained in:
gwen 2026-01-19 22:05:27 +01:00
parent a346e23af6
commit 1e6331f477

View file

@ -45,6 +45,9 @@ Let's begin with defining what a property is:
of a family, a subfamily or a variable. of a family, a subfamily or a variable.
These properties change the usual behavior of a variable or family. These properties change the usual behavior of a variable or family.
A disabled family
------------------
Here we are going to assign the `disabled` property to the `manual` family: Here we are going to assign the `disabled` property to the `manual` family:
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_050/firefox/10-manual.yml .. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_050/firefox/10-manual.yml
@ -152,7 +155,8 @@ Otherwise, **we need to disable them when they are not used**.
In a practical point of view, if we fill them in, Rougail CLI will output a warning and the :term:`operator` will see it. In a practical point of view, if we fill them in, Rougail CLI will output a warning and the :term:`operator` will see it.
He will wonder : "oh, what am I doing?", I shall fill and use in these variables only in the `Manual proxy configuration` context. He will wonder : "oh, what am I doing?", I shall fill and use in these variables only in the `Manual proxy configuration` context.
.. type-along:: The `disabling` property is usefull in our use case A conditional disabled family
------------------------------
Let's look again at our use case. We have a choice between five options Let's look again at our use case. We have a choice between five options
in order to set the proxy mode: in order to set the proxy mode:
@ -174,9 +178,6 @@ four out of our five use cases.
.. important:: We need to **disable** variables or families that are not used .. important:: We need to **disable** variables or families that are not used
in a given usage context. in a given usage context.
A disabled family
------------------
Disabling variables one by one can be replaced by disabling a whole family. Disabling variables one by one can be replaced by disabling a whole family.
If we don't choose the manual mode, we need to **disable** the whole `manual` family, it will disable If we don't choose the manual mode, we need to **disable** the whole `manual` family, it will disable
all the subfamilies and the variables in it. all the subfamilies and the variables in it.
@ -213,9 +214,6 @@ Notice the `disabled: true` parameter set in the `manual` family:
type: port type: port
default: 8080 default: 8080
A conditional disabled family
------------------------------
.. type-along:: For those who follow the tutorial with the help of the git repository .. type-along:: For those who follow the tutorial with the help of the git repository
Now you need to checkout the `v1.1_051` version:: Now you need to checkout the `v1.1_051` version::
@ -395,15 +393,6 @@ Let's introduce a new property here:
- with the `disabled` property, the variables are *deactivated* - with the `disabled` property, the variables are *deactivated*
- with the `hidden` property, the variables are just not seen when loading the user data. - with the `hidden` property, the variables are just not seen when loading the user data.
.. questions:: Question: shall we use the `disabled` property here?
Is it relevant to use the :term:`disabled property <disabled>` here?
**answer**: No! Because we *need* to use these variables at any :term:`context` of the proxy's manual configuration use case,
we simply have to point their values in one direction or another depending on this or that context,
that's why it is absolutely not a question of disabling them. The `manual.https_proxy.address`
and the `manual.http_proxy.port` variables shall not be disabled in the manual mode.
Now we can set a `hidden` property to the `https_proxy` family: Now we can set a `hidden` property to the `https_proxy` family:
Here is our new :file:`20-manual.yml` structure file: Here is our new :file:`20-manual.yml` structure file:
@ -437,8 +426,6 @@ Here is our new :file:`20-manual.yml` structure file:
variable: __.http_proxy.port variable: __.http_proxy.port
... ...
We have added two other variables for the HTTPS use only:
.. confval:: https_proxy.address .. confval:: https_proxy.address
:type: `domainname` :type: `domainname`
@ -452,6 +439,89 @@ We have added two other variables for the HTTPS use only:
We have now a `hidden` property assigned to the `https_proxy` family, which is We have now a `hidden` property assigned to the `https_proxy` family, which is
hiding these two variables. hiding these two variables.
If we launch the Rougail CLI on the this user data
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_052/config/01/config.yml
:linenos:
:language: yaml
:caption: The :file:`config/01/config.yml` user data file with the `hidden` property on the `https_proxy` family.
..
---
proxy_mode: Manual proxy configuration
manual:
http_proxy:
address: http.proxy.net
port: 3128
use_for_https: false
https_proxy:
address: https.proxy.net
Let's launch the Rougail in read only (`RO`) mode first:
.. raw:: html
:url: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_052/config/01/cmd_ro.txt
:class: terminal
..
rougail -m firefox/ -u yaml -yf config/01/config.yml
We have this output:
.. raw:: html
:url: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_052/config/01/output_ro.html
:class: output
..
<pre><span style="font-weight: bold; color: #ffff00">🔔 Warning</span>
<span style="color: #ffff00">┗━━ </span>manual (Manual proxy configuration)
<span style="color: #ffff00"> </span><span style="color: #ffff00">┗━━ </span>https_proxy (HTTPS Proxy)
<span style="color: #ffff00"> </span><span style="color: #ffff00"> </span><span style="color: #ffff00">┗━━ </span>address (HTTPS address): <span style="color: #ffff00">🔔 family "https_proxy" (HTTPS Proxy) has </span>
<span style="color: #ffff00"> </span><span style="color: #ffff00"> </span><span style="color: #ffff00"> </span><span style="color: #ffff00">property hidden, so cannot access to "address" (HTTPS address), it </span>
<span style="color: #ffff00"> </span><span style="color: #ffff00"> </span><span style="color: #ffff00"> </span><span style="color: #ffff00">will be ignored when loading from the YAML file </span>
<span style="color: #ffff00"> </span><span style="color: #ffff00"> </span><span style="color: #ffff00"> </span><span style="color: #ffff00">"config/01/config.yml"</span>
╭────────────── Caption ───────────────╮
│ Variable <span style="color: #00aa00">Modified value</span> │
│ (⏳ Original default value) │
╰──────────────────────────────────────╯
Variables:
<span style="color: #5c5cff">┣━━ </span>📓 proxy_mode (Configure Proxy Access to the Internet): <span style="color: #00aa00">Manual proxy </span>
<span style="color: #5c5cff">┃ </span><span style="color: #00aa00">configuration</span> ◀ loaded from the YAML file "config/01/config.yml" (⏳ No
<span style="color: #5c5cff">┃ </span>proxy)
<span style="color: #5c5cff">┗━━ </span>📂 manual (Manual proxy configuration)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┣━━ </span>📂 http_proxy (HTTP Proxy)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┃ </span><span style="color: #5c5cff">┣━━ </span>📓 address (HTTP address): <span style="color: #00aa00">http.proxy.net</span> ◀ loaded from the YAML
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┃ </span><span style="color: #5c5cff">┃ </span>file "config/01/config.yml"
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┃ </span><span style="color: #5c5cff">┗━━ </span>📓 port (HTTP Port): <span style="color: #00aa00">3128</span> ◀ loaded from the YAML file
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┃ </span><span style="color: #5c5cff"> </span>"config/01/config.yml" (⏳ 8080)
<span style="color: #5c5cff"> </span><span style="color: #5c5cff">┗━━ </span>📓 use_for_https (Also use this proxy for HTTPS): <span style="color: #00aa00">false</span> ◀ loaded from
<span style="color: #5c5cff"> </span><span style="color: #5c5cff"> </span>the YAML file "config/01/config.yml" (⏳ true)
</pre>
Now let's launch the Rougail CLI in read write mode (`RW`) on the same user data:
.. raw:: html
:url: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_052/config/01/cmd_rw.txt
:class: terminal
We have this output:
.. raw:: html
:url: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_052/config/01/output_rw.html
:class: output
FIXME
.. questions:: Question: shall we use the `disabled` property here?
Is it relevant to use the :term:`disabled property <disabled>` here?
**answer**: No! Because we *need* to use these variables at any :term:`context` of the proxy's manual configuration use case,
we simply have to point their values in one direction or another depending on this or that context,
that's why it is absolutely not a question of disabling them. The `manual.https_proxy.address`
and the `manual.http_proxy.port` variables shall not be disabled in the manual mode.
A conditional hidden family A conditional hidden family
---------------------------- ----------------------------