From a932d7e1c3cbb6a5a956447f3dea86bf8e47dc63 Mon Sep 17 00:00:00 2001 From: gwen Date: Fri, 21 Feb 2025 07:23:52 +0100 Subject: [PATCH] proxymode --- docs/_static/terminal.css | 1 + docs/tutorial/index.rst | 2 +- docs/tutorial/proxymode.rst | 103 +++++++++++++++++++++++++++++++++--- docs/tutorial/tutorial.rst | 14 ++++- 4 files changed, 112 insertions(+), 8 deletions(-) diff --git a/docs/_static/terminal.css b/docs/_static/terminal.css index 3561e702a..401d3b7e0 100644 --- a/docs/_static/terminal.css +++ b/docs/_static/terminal.css @@ -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 { diff --git a/docs/tutorial/index.rst b/docs/tutorial/index.rst index 46a5b758f..dd8e048c8 100644 --- a/docs/tutorial/index.rst +++ b/docs/tutorial/index.rst @@ -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): diff --git a/docs/tutorial/proxymode.rst b/docs/tutorial/proxymode.rst index df566d37c..026a61f68 100644 --- a/docs/tutorial/proxymode.rst +++ b/docs/tutorial/proxymode.rst @@ -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 + +.. +
๐Ÿ›‘ ERRORS
+    โ”ฃโ”โ” The following variables are mandatory but have no value:
+    โ”—โ”โ”   - manual.http_proxy.address (HTTP address)
+    
+ +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 + +.. +
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Caption โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
+    โ”‚ Variable                           Default value            โ”‚
+    โ”‚ Undocumented variable              Modified value           โ”‚
+    โ”‚ Undocumented but modified variable (Original default value) โ”‚
+    โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
+    Variables:
+    โ”ฃโ”โ” ๐Ÿ““ proxy_mode: Manual proxy configuration (No proxy)
+    โ”—โ”โ” ๐Ÿ“‚ manual
+        โ”—โ”โ” ๐Ÿ“‚ http_proxy
+            โ”—โ”โ” ๐Ÿ““ address: example.net
+    
+ +- 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`. diff --git a/docs/tutorial/tutorial.rst b/docs/tutorial/tutorial.rst index b50fd8bee..d7f457f1c 100644 --- a/docs/tutorial/tutorial.rst +++ b/docs/tutorial/tutorial.rst @@ -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 ------------------