diff --git a/README.md b/README.md index b79a16b4..402bf0b0 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ - [Summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md) -- [[tutorial v1.1_080] HTTP Proxy with "proxy" type](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_080/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_081~1..v1.1_081)) +- [[tutorial v1.1_081] HTTPS and SOCKS Proxy](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_081/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_090~1..v1.1_090)) -# [tutorial v1.1_081] HTTPS and SOCKS Proxy +# [tutorial v1.1_090] A conditional disabled variable with type web_address -[Read the tutorial "HTTPS and SOCKS Proxy" in the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/jinja.html#https-and-socks-proxy) +[Read the tutorial "A conditional disabled variable with type web_address" in the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/jinja.html#a-conditional-disabled-variable-with-type-web_address) ## Screenshot @@ -29,7 +29,7 @@ pip install rougail-cli rougail-output-exporter rougail-output-doc rougail-user- Then switch to the tutorial page: ```shell -git switch --detach v1.1_081 +git switch --detach v1.1_090 ``` ## Structure @@ -37,51 +37,30 @@ git switch --detach v1.1_081

-.
- ├── firefox
- │   ├── 00-proxy.yml
- │   ├── 10-manual.yml
- │   └── 20-manual.yml
- └── types
-     └── proxy
-         └── 00_type.yml
+.
+ ├── firefox
+ │   ├── 00-proxy.yml
+ │   ├── 10-manual.yml
+ │   ├── 20-manual.yml
+ │   └── 30-auto.yml
+ └── types
+     └── proxy
+         └── 00_type.yml


-Contents of the firefox/20-manual.yml file +Contents of the firefox/30-auto.yml file ```yml %YAML 1.2 --- version: 1.1 -manual: - - use_for_https: true # Also use this proxy for HTTPS - - https_proxy: - description: HTTPS Proxy - type: proxy - hidden: - variable: _.use_for_https - - address: - default: - variable: __.http_proxy.address - - port: - default: - variable: __.http_proxy.port - - socks_proxy: - description: SOCKS Proxy - type: proxy - - version: - description: SOCKS host version used by proxy - choices: - - v4 - - v5 - default: v5 +auto: + description: Automatic proxy configuration URL + type: web_address + disabled: + variable: _.proxy_mode + when_not: Automatic proxy configuration URL ... ``` @@ -144,6 +123,10 @@ rougail -m firefox/ --types types/proxy -o doc | **manual.socks_proxy.port**
[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Proxy port.
**Validators**:
• well-known ports (1 to 1023) are allowed
• registred ports (1024 to 49151) are allowed
• private ports (greater than 49152) are allowed
**Default**: 8080 | | **manual.socks_proxy.version**
[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | SOCKS host version used by proxy.
**Choices**:
• v4
• v5 **← (default)** | +| Variable | Description | +|------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **auto**
[`web address`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` *`disabled`* | Automatic proxy configuration URL.
**Validators**:
• well-known ports (1 to 1023) are allowed
• registred ports (1024 to 49151) are allowed
• type domainname
• the domain name can be a hostname
**Disabled**: when the variable "[Configure Proxy Access to the Internet](#proxy_mode)" hasn't the value "Automatic proxy configuration URL" | + *** ### Let's generate the changelog @@ -151,24 +134,13 @@ rougail -m firefox/ --types types/proxy -o doc ```shell rougail -m firefox/ --types types/proxy -o doc --doc.contents changelog --doc.changelog.previous_json_file previous.yml ``` -#### New variables +#### New variable -| Variable | Description | -|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **manual.https_proxy.address**
[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Proxy address.
**Validators**:
• type domainname
• the domain name can be an IP
**Default**: the value of the variable "[Proxy address](#manual.http_proxy.address)" | -| **manual.https_proxy.port**
[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Proxy port.
**Validators**:
• well-known ports (1 to 1023) are allowed
• registred ports (1024 to 49151) are allowed
• private ports (greater than 49152) are allowed
**Default**: the value of the variable "[Proxy port](#manual.http_proxy.port)" | -| **manual.socks_proxy.address**
[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Proxy address.
**Validators**:
• type domainname
• the domain name can be an IP | -| **manual.socks_proxy.port**
[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Proxy port.
**Validators**:
• well-known ports (1 to 1023) are allowed
• registred ports (1024 to 49151) are allowed
• private ports (greater than 49152) are allowed
**Default**: 8080 | -| **manual.socks_proxy.version**
[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | SOCKS host version used by proxy.
**Choices**:
• v4
• v5 **← (default)** | - -#### Deleted variables +| Variable | Description | +|------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **auto**
[`web address`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` *`disabled`* | Automatic proxy configuration URL.
**Validators**:
• well-known ports (1 to 1023) are allowed
• registred ports (1024 to 49151) are allowed
• type domainname
• the domain name can be a hostname
**Disabled**: when the variable "[Configure Proxy Access to the Internet](#proxy_mode)" hasn't the value "Automatic proxy configuration URL" | -- manual.*https*_proxy.address -- manual.*socks*_proxy.address -- manual.*https*_proxy.port -- manual.*socks*_proxy.port -- manual.*socks*_proxy.version *** ## User datas @@ -179,14 +151,7 @@ rougail -m firefox/ --types types/proxy -o doc --doc.contents changelog --doc.ch ```yml --- -proxy_mode: Manual proxy configuration -manual: - http_proxy: - address: http.proxy.net - port: 3128 - use_for_https: false - https_proxy: - address: https.proxy.net +auto: https://auto.proxy.net/wpad.dat ``` *** @@ -195,13 +160,70 @@ manual: ```shell rougail -m firefox/ --types types/proxy -u yaml -yf config/01/config.yml ``` +> [!WARNING] +> +> - auto (Automatic proxy configuration URL): :bell: variable has property disabled, it will be ignored when loading from the YAML file "config/01/config.yml" + +> [!NOTE] +> +> **Caption:** +> - Variable +> - Default value + +Variables: +- :notebook: proxy_mode (Configure Proxy Access to the Internet): No proxy + +*** +### Example 2 + +#### config/02/config.yml + + +```yml +--- +proxy_mode: Automatic proxy configuration URL +``` + +*** +#### Output + +```shell +rougail -m firefox/ --types types/proxy -u yaml -yf config/02/config.yml +``` > [!CAUTION] > -> - manual (Manual proxy configuration) -> - socks_proxy (SOCKS Proxy) -> - address (Proxy address): :stop_sign: mandatory variable but has no value +> - auto (Automatic proxy configuration URL): :stop_sign: mandatory variable but has no value + +*** +### Example 3 + +#### config/03/config.yml + + +```yml +--- +proxy_mode: Automatic proxy configuration URL +auto: https://auto.proxy.net/wpad.dat +``` + +*** +#### Output + +```shell +rougail -m firefox/ --types types/proxy -u yaml -yf config/03/config.yml +``` +> [!NOTE] +> +> **Caption:** +> - Variable +> - Modified value +> - (:hourglass_flowing_sand: Original default value) + +Variables: +- :notebook: proxy_mode (Configure Proxy Access to the Internet): Automatic proxy configuration URL ← loaded from the YAML file "config/03/config.yml" (:hourglass_flowing_sand: No proxy) +- :notebook: auto (Automatic proxy configuration URL): https://auto.proxy.net/wpad.dat ← loaded from the YAML file "config/03/config.yml" *** -- [[tutorial v1.1_090] A conditional disabled variable with type web_address](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 v1.1_100] A conditional disabled variable with type domainname and parameters](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_100/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_100~1..v1.1_100)) diff --git a/config/01/config.yml b/config/01/config.yml index 84547faa..1edbe913 100644 --- a/config/01/config.yml +++ b/config/01/config.yml @@ -1,9 +1,2 @@ --- -proxy_mode: Manual proxy configuration -manual: - http_proxy: - address: http.proxy.net - port: 3128 - use_for_https: false - https_proxy: - address: https.proxy.net +auto: https://auto.proxy.net/wpad.dat diff --git a/config/01/output_ro.html b/config/01/output_ro.html index 26749f46..7f2d1085 100644 --- a/config/01/output_ro.html +++ b/config/01/output_ro.html @@ -1,5 +1,10 @@ -
🛑 Caution
-┗━━ manual (Manual proxy configuration)
-    ┗━━ socks_proxy (SOCKS Proxy)
-        ┗━━ address (Proxy address): 🛑 mandatory variable but has no value
+
🔔 Warning
+┗━━ auto (Automatic proxy configuration URL): 🔔 variable has property disabled,
+    it will be ignored when loading from the YAML file "config/01/config.yml"
+
+╭─────── Caption ────────╮
+│ Variable Default value │
+╰────────────────────────╯
+Variables:
+┗━━ 📓 proxy_mode (Configure Proxy Access to the Internet): No proxy
 
diff --git a/config/02/cmd_ro.txt b/config/02/cmd_ro.txt new file mode 100644 index 00000000..4a6cdd4e --- /dev/null +++ b/config/02/cmd_ro.txt @@ -0,0 +1 @@ +rougail -m firefox/ --types types/proxy -u yaml -yf config/02/config.yml \ No newline at end of file diff --git a/config/02/config.yml b/config/02/config.yml new file mode 100644 index 00000000..26df1306 --- /dev/null +++ b/config/02/config.yml @@ -0,0 +1,2 @@ +--- +proxy_mode: Automatic proxy configuration URL diff --git a/config/02/output_ro.html b/config/02/output_ro.html new file mode 100644 index 00000000..3f84fbd9 --- /dev/null +++ b/config/02/output_ro.html @@ -0,0 +1,4 @@ +
🛑 Caution
+┗━━ auto (Automatic proxy configuration URL): 🛑 mandatory variable but has no 
+    value
+
diff --git a/config/03/cmd_ro.txt b/config/03/cmd_ro.txt new file mode 100644 index 00000000..3c55adcb --- /dev/null +++ b/config/03/cmd_ro.txt @@ -0,0 +1 @@ +rougail -m firefox/ --types types/proxy -u yaml -yf config/03/config.yml \ No newline at end of file diff --git a/config/03/config.yml b/config/03/config.yml new file mode 100644 index 00000000..307e175b --- /dev/null +++ b/config/03/config.yml @@ -0,0 +1,3 @@ +--- +proxy_mode: Automatic proxy configuration URL +auto: https://auto.proxy.net/wpad.dat diff --git a/config/03/output_ro.html b/config/03/output_ro.html new file mode 100644 index 00000000..7fe00597 --- /dev/null +++ b/config/03/output_ro.html @@ -0,0 +1,11 @@ +
╭────────────── Caption ───────────────╮
+│ Variable Modified value              │
+│          (⏳ Original default value) │
+╰──────────────────────────────────────╯
+Variables:
+┣━━ 📓 proxy_mode (Configure Proxy Access to the Internet): Automatic proxy 
+configuration URL ◀ loaded from the YAML file "config/03/config.yml" (⏳ No 
+proxy)
+┗━━ 📓 auto (Automatic proxy configuration URL): https://auto.proxy.net/wpad.dat
+    ◀ loaded from the YAML file "config/03/config.yml"
+
diff --git a/firefox.png b/firefox.png index b7ca7aa0..d53e5138 100644 Binary files a/firefox.png and b/firefox.png differ diff --git a/tree.html b/tree.html index af46ccfb..d1e4d8f8 100644 --- a/tree.html +++ b/tree.html @@ -1,10 +1,11 @@

-.
- ├── firefox
- │   ├── 00-proxy.yml
- │   ├── 10-manual.yml
- │   └── 20-manual.yml
- └── types
-     └── proxy
-         └── 00_type.yml
+.
+ ├── firefox
+ │   ├── 00-proxy.yml
+ │   ├── 10-manual.yml
+ │   ├── 20-manual.yml
+ │   └── 30-auto.yml
+ └── types
+     └── proxy
+         └── 00_type.yml


\ No newline at end of file