From cfb6017f32344ba4aaee87cef35273aa206ee9b7 Mon Sep 17 00:00:00 2001 From: gwen Date: Fri, 21 Feb 2025 17:14:30 +0100 Subject: [PATCH] proxymode --- docs/tutorial/index.rst | 1 + docs/tutorial/proxymode.rst | 94 +++++++++++++++++++++++++++++++++++++ docs/tutorial/tutorial.rst | 14 +++--- 3 files changed, 102 insertions(+), 7 deletions(-) diff --git a/docs/tutorial/index.rst b/docs/tutorial/index.rst index dd8e048c8..b6e54c3f8 100644 --- a/docs/tutorial/index.rst +++ b/docs/tutorial/index.rst @@ -41,5 +41,6 @@ At first glance we can see that we have a selection of five configuration option preliminary proxymode + porttype tutorial diff --git a/docs/tutorial/proxymode.rst b/docs/tutorial/proxymode.rst index 026a61f68..0e82992b0 100644 --- a/docs/tutorial/proxymode.rst +++ b/docs/tutorial/proxymode.rst @@ -223,14 +223,108 @@ Everything is OK: - 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 +Variables can have parameters +--------------------------------- + +.. questions:: Question + + **question**: Does our `address` domain name variable accepts IP addresses ? + + **answer**: Well it depends. + +We need to specify whether our variable accepts to be filled using an IP or a domain name only. +This is where the ability to parameterize our variable comes in. + +.. + --- + manual: + description: Manual proxy configuration + + http_proxy: + description: HTTP Proxy + + address: + description: HTTP address + type: domainname + params: + allow_ip: true + +.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_025/firefox/10-manual.yml + :language: yaml + :caption: The `address` has a parameter set in the :file:`firefox/10-manual.yml` structure file + :name: RougailAddressParameter + :linenos: +.. + --- + manual: + description: Manual proxy configuration + + http_proxy: + description: HTTP Proxy + + address: + description: HTTP address + type: domainname + params: + allow_ip: true + +We can see line 11 and 12 that the params allow the domain name `address` variable to be set +with IPs. + +.. type-along:: One more variable + +Let's create a `port` variable in the `http_proxy` family: + +.. confval:: port + :type: `port` + :default: 8080 + + The HTTP Port + +Here is the new :file:`firefox/10-manual.yml` structure file: + +.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_026/firefox/10-manual.yml + :language: yaml + :caption: A rougail structure description file with a hierarchy. + :name: RogailPortVariable + :linenos: + +.. + --- + manual: + description: Manual proxy configuration + + http_proxy: + description: HTTP Proxy + + address: + description: HTTP address + type: domainname + params: + allow_ip: true + + port: + description: HTTP Port + type: port + default: 8080 + +Take a look at lines 14 to 17. + +.. glossary:: + + parameter + + A parameter is a property of a variable that can refine its behavior .. keypoints:: Key points progress **Keywords** + - 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) + - we can add :term:`parameters` to variables to refine their behavior **Progress** diff --git a/docs/tutorial/tutorial.rst b/docs/tutorial/tutorial.rst index d7f457f1c..25b04709a 100644 --- a/docs/tutorial/tutorial.rst +++ b/docs/tutorial/tutorial.rst @@ -1,22 +1,22 @@ The Firefox proxy: the manual configuration -============================================== +============================================= + .. objectives:: Objectives - We will learn how to: + We will learn how to: FIXME .. 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 + FIXME The manual mode ------------------ -.. questions:: OK then. What happens when you select the "Manual proxy configuration"? +.. questions:: Question + + **question**: OK then. What happens when you select the "Manual proxy configuration"? A good configuration design is to place all the proxy's manual configuration in a :term:`family`. Let's create the :file:`dict/02-proxy_manual.yml` dictionary: