proxymode

This commit is contained in:
gwen 2025-02-21 07:23:52 +01:00
parent 2da85eb0e8
commit a932d7e1c3
4 changed files with 112 additions and 8 deletions

View file

@ -53,6 +53,7 @@
width: fit-content; /* Ajuste la largeur au contenu */
border-radius: 5px; /* Coins arrondis */
display: inline-block; /* Pour que la boîte s'ajuste au contenu */
margin-bottom: 20px;
}
.error-box pre, .output pre {

View file

@ -27,7 +27,7 @@ Let's dive into this **configuration options validation** use case.
The values entered by the user have to be
- validated
- consitent.
- consitent
At first glance we can see that we have a selection of five configuration options values that we need to fill in (they are highlighted here in this screenshot):

View file

@ -1,4 +1,4 @@
The `proxy` family
The `manual` family
====================
.. objectives:: Objectives
@ -133,15 +133,106 @@ So we have now an `address` variable.
This is the HTTP address of the proxy
.. note:: We encountered a new type of variable there: the `domainname` type
.. note:: We encountered here a new type of variable there: the `domainname` type
Assigning a user value
------------------------------------
Now we need to set a value for the :confval:`address` variable,
otherwise we will get an error if we try to access this variable:
.. raw:: html
:url: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_024/config/01/output_rw.html
:class: error-box
..
<pre>🛑 ERRORS
<span style="color: #ff0000">┣━━ </span>The following variables are mandatory but have no value:
<span style="color: #ff0000">┗━━ </span> - manual.http_proxy.address (HTTP address)
</pre>
Because this variable is mandatory.
.. glossary::
mandatory
A variable is defined as mandatory if it **must** have a value.
.. type-along:: user files are where the user values lives
And we need to set the values in separate files too, called `user files`.
.. glossary::
user file
A user file is a file where users can set values, called user values --
that is variable's values that have been set by an :term:`operator`\ .
Let's set user values in user files
Here is a user file sample:
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_024/config/03/config.yaml
:language: yaml
:caption: A user file named :file:`config/config.yaml` with a value set for the `address` variable
:name: RougailAddresseVariableUserValue
..
---
proxy_mode: Manual proxy configuration
manual:
http_proxy:
address: example.net
.. glossary::
configuration
We call configuration the whole system structure and user values,
and when we speak of consistency, it is in relation to this whole set.
Let's validate the consitency of the configuration:
.. code-block:: text
:class: terminal
rougail -v 1.1 -m firefox/ -u file -ff config/config.yaml
Everything is OK:
.. raw:: html
:url: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_024/config/03/output_rw.html
:class: output
..
<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>) │
╰─────────────────────────────────────────────────────────────╯
Variables:
<span style="color: #5c5cff">┣━━ </span>📓 proxy_mode: Manual proxy configuration (<span style="color: #00aa00">No proxy</span>)
<span style="color: #5c5cff">┗━━ </span>📂 manual
<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>📓 address: example.net
</pre>
- the `proxy_mode` value is in green because its value is set by default
- the `address` value is in black because its value has been set by a user
.. keypoints:: Key points progress
**Keywords**
- :term:`family`, and sub families
- :term:`variable`\ s defined inside of a family
- we know how to define :term:`variable`\ s inside of a family
- we now know what a :term:`mandatory` variable is
- we kwow how to set a variable's user value (in a :term:`user file`)
- we have the big picture : the :term:`configuration`, which is (the structure files + the user files)
**Progress**
- we have a :term:`family` named `manual` and a sub family named `http_proxy`
- And we have now two variables: :confval:`proxy_mode` and :confval:`address`.

View file

@ -1,5 +1,17 @@
The Firefox proxy: the manual configuration
------------------------------------------------
==============================================
.. objectives:: Objectives
We will learn how to:
.. prerequisites:: Reminders
- We have two variables: :confval:`proxy_mode` and :confval:`address`.
.. type-along:: So we have this choice type variable in the structure file
The manual mode
------------------