143 lines
30 KiB
Markdown
143 lines
30 KiB
Markdown
- [Summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md)
|
||
- [[tutorial v1.1_091] A variable with multiple value](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_091/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_091~1..v1.1_091))
|
||
|
||
# [tutorial v1.1_092)] A non mandatory variable
|
||
|
||
[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_092~1..v1.1_092)
|
||
|
||
[Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/calculation.html#a-non-mandatory-variable)
|
||
|
||
|
||
## Screenshot
|
||
|
||
|
||
<img src="firefox.png" width=50% height=50% alt="Firefox Proxy setting"/>
|
||
|
||
|
||
## Clone and install
|
||
|
||
|
||
|
||
To test this tutorial, you need to download this repository and install Rougail:
|
||
|
||
```shell
|
||
git clone -b 1.1 https://forge.cloud.silique.fr/stove/rougail-tutorials.git
|
||
cd rougail-tutorials
|
||
python -m venv venv_rougail
|
||
. venv_rougail/bin/activate
|
||
pip install rougail-cli rougail-output-exporter rougail-output-doc rougail-user-data-yaml
|
||
```
|
||
|
||
Then switch to the tutorial page:
|
||
|
||
```shell
|
||
git switch --detach v1.1_092
|
||
```
|
||
|
||
## Structure
|
||
|
||
|
||
|
||
<p>
|
||
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_092/./">.</a><br/>
|
||
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_092/./firefox/">firefox</a><br/>
|
||
├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_092/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
|
||
├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_092/./firefox/10-manual.yml">10-manual.yml</a><br/>
|
||
├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_092/./firefox/20-manual.yml">20-manual.yml</a><br/>
|
||
├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_092/./firefox/30-auto.yml">30-auto.yml</a><br/>
|
||
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_092/./firefox/40-no_proxy.yml">40-no_proxy.yml</a><br/>
|
||
<br/><br/></p>
|
||
|
||
Contents of the firefox/40-no_proxy.yml file
|
||
|
||
```yml
|
||
%YAML 1.2
|
||
---
|
||
version: 1.1
|
||
|
||
no_proxy:
|
||
description: Address for which proxy will be desactivated
|
||
type: domainname
|
||
params:
|
||
allow_ip: true
|
||
allow_cidr_network: true
|
||
allow_without_dot: true
|
||
allow_startswith_dot: true
|
||
multi: true
|
||
mandatory: false
|
||
disabled:
|
||
variable: _.proxy_mode
|
||
when: No proxy
|
||
...
|
||
|
||
```
|
||
### Let's generate the documentation
|
||
|
||
```shell
|
||
rougail -m firefox/ -o doc
|
||
```
|
||
| Variable | Description |
|
||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||
| **proxy_mode**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Configure Proxy Access to the Internet.<br/>**Choices**: <br/>- No proxy **← (default)**<br/>- Auto-detect proxy settings for this network<br/>- Use system proxy settings<br/>- Manual proxy configuration<br/>- Automatic proxy configuration URL |
|
||
|
||
#### Manual proxy configuration
|
||
|
||
**manual**
|
||
|
||
*`disabled`*
|
||
|
||
**Disabled**: when the variable "proxy_mode" hasn't the value "Manual proxy configuration"
|
||
|
||
##### HTTP Proxy
|
||
|
||
**manual.http_proxy**
|
||
|
||
|
||
|
||
| Variable | Description |
|
||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||
| **manual.http_proxy.address**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP address.<br/>**Validator**: the domain name can be an IP |
|
||
| **manual.http_proxy.port**<br/>[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | HTTP Port.<br/>**Validators**: <br/>- well-known ports (1 to 1023) are allowed<br/>- registred ports (1024 to 49151) are allowed<br/>- private ports (greater than 49152) are allowed<br/>**Default**: 8080 |
|
||
|
||
| Variable | Description |
|
||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||
| **manual.use_for_https**<br/>[`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Also use this proxy for HTTPS.<br/>**Default**: true |
|
||
|
||
##### *HTTPS* Proxy or *SOCKS* Proxy
|
||
|
||
This family builds families dynamically
|
||
|
||
**manual.*https*_proxy**<br/>**manual.*socks*_proxy**
|
||
|
||
*`hidden`*
|
||
|
||
**Hidden**: in HTTPS case if "_.use_for_https" is set to "true"
|
||
|
||
**Identifiers**: <br/>- HTTPS<br/>- SOCKS
|
||
|
||
| Variable | Description |
|
||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||
| **manual.*https*_proxy.address**<br/>**manual.*socks*_proxy.address**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | *HTTPS* or *SOCKS* address.<br/>**Validator**: the domain name can be an IP<br/>**Default**: the value of the variable "manual.http_proxy.address" |
|
||
| **manual.*https*_proxy.port**<br/>**manual.*socks*_proxy.port**<br/>[`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | *HTTPS* or *SOCKS* port.<br/>**Validators**: <br/>- well-known ports (1 to 1023) are allowed<br/>- registred ports (1024 to 49151) are allowed<br/>- private ports (greater than 49152) are allowed<br/>**Default**: the value of the variable "manual.http_proxy.port" |
|
||
| **manual.*https*_proxy.version**<br/>**manual.*socks*_proxy.version**<br/>[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` *`disabled`* | SOCKS host version used by proxy.<br/>**Choices**: <br/>- v4<br/>- v5 **← (default)**<br/>**Disabled**: when the identifier is "HTTPS" |
|
||
|
||
| Variable | Description |
|
||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||
| **auto**<br/>[`web_address`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` *`disabled`* | Automatic proxy configuration URL.<br/>**Validator**: the domain name in web address can be only a hostname<br/>**Disabled**: when the variable "proxy_mode" hasn't the value "Automatic proxy configuration URL" |
|
||
| **no_proxy**<br/>[`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) *`disabled`* `unique` `multiple` | Address for which proxy will be desactivated.<br/>**Validators**: <br/>- the domain name can starts by a dot<br/>- the domain name can be a hostname<br/>- the domain name can be an IP<br/>- the domain name can be network in CIDR format<br/>**Disabled**: when the variable "proxy_mode" has the value "No proxy" |
|
||
|
||
### Let's generate the changelog
|
||
|
||
```shell
|
||
rougail -m firefox/ -o doc --doc.contents changelog
|
||
```
|
||
#### Modified variable
|
||
|
||
| Variable | Description |
|
||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||
| **no_proxy**<br/>~~`mandatory`~~ [`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) *`disabled`* `unique` `multiple` | Address for which proxy will be desactivated.<br/>**Validators**: <br/>- the domain name can starts by a dot<br/>- the domain name can be a hostname<br/>- the domain name can be an IP<br/>- the domain name can be network in CIDR format<br/>**Disabled**: when the variable "proxy_mode" has the value "No proxy" |
|
||
|
||
|
||
|
||
|
||
- [[tutorial v1.1_093] Examples](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_093/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_093~1..v1.1_093))
|