2024-11-02 14:58:10 +01:00
- [Summary ](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md )
2024-11-02 14:58:34 +01:00
- [[tutorial 040] Family: a dynamic family](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_040/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_040~1..v1.1_040))
2024-11-02 14:58:10 +01:00
2024-11-02 14:58:34 +01:00
# [tutorial 041] A conditional hidden family with Jinja
2024-11-02 14:58:10 +01:00
2024-11-02 14:58:34 +01:00
[View the diff ](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_041~1..v1.1_041 )
2024-11-02 14:58:10 +01:00
2024-11-02 14:58:09 +01:00
## Screenshot
< img src = "firefox.png" width = 50% height = 50% alt = "Firefox Proxy setting" / >
## Structure
2024-11-02 14:58:10 +01:00
### firefox/00-proxy.yml
```yml
---
2024-11-02 14:58:12 +01:00
proxy_mode:
2024-11-02 14:58:13 +01:00
description: Configure Proxy Access to the Internet
2024-11-02 14:58:14 +01:00
choices:
- No proxy
- Auto-detect proxy settings for this network
- Use system proxy settings
- Manual proxy configuration
- Automatic proxy configuration URL
2024-11-02 14:58:13 +01:00
default: No proxy
2024-11-02 14:58:10 +01:00
```
2024-11-02 14:58:16 +01:00
### firefox/10-manual.yml
2024-11-02 14:58:12 +01:00
```yml
---
2024-11-02 14:58:16 +01:00
manual:
description: Manual proxy configuration
2024-11-02 14:58:24 +01:00
disabled:
variable: proxy_mode
when_not: 'Manual proxy configuration'
2024-11-02 14:58:12 +01:00
2024-11-02 14:58:17 +01:00
http_proxy:
description: HTTP Proxy
2024-11-02 14:58:18 +01:00
address:
description: HTTP address
2024-11-02 14:58:20 +01:00
type: domainname
2024-11-02 14:58:21 +01:00
params:
allow_ip: true
2024-11-02 14:58:18 +01:00
2024-11-02 14:58:22 +01:00
port:
description: HTTP Port
type: port
default: 8080
2024-11-02 14:58:26 +01:00
```
### firefox/20-manual.yml
```yml
---
manual:
use_for_https:
description: Also use this proxy for HTTPS
default: true
2024-11-02 14:58:33 +01:00
"{{ identifier }}_proxy":
description: "{{ identifier }} Proxy"
dynamic:
- HTTPS
- SOCKS
2024-11-02 14:58:30 +01:00
hidden:
2024-11-02 14:58:34 +01:00
jinja: |
{% if manual.use_for_https %}
HTTPS is same has HTTP
{% endif %}
2024-11-02 14:58:28 +01:00
address:
2024-11-02 14:58:33 +01:00
description: "{{ identifier }} address"
2024-11-02 14:58:31 +01:00
default:
variable: manual.http_proxy.address
2024-11-02 14:58:28 +01:00
port:
2024-11-02 14:58:33 +01:00
description: "{{ identifier }} port"
2024-11-02 14:58:31 +01:00
default:
variable: manual.http_proxy.port
2024-11-02 14:58:28 +01:00
2024-11-02 14:58:12 +01:00
```
2024-11-02 14:58:16 +01:00
### Generated documentation
2024-11-02 14:58:12 +01:00
```console
2024-11-02 14:58:16 +01:00
foo@bar:~$ rougail -v 1.1 -m firefox/ -o doc -do github
2024-11-02 14:58:12 +01:00
```
2024-11-02 14:58:16 +01:00
### Variables
2024-11-02 14:58:12 +01:00
2024-11-02 14:58:30 +01:00
| 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 |
2024-11-02 14:58:24 +01:00
#### Manual proxy configuration
_`disabled`_
**Disabled**: proxy_mode.
##### HTTP Proxy
2024-11-02 14:58:30 +01:00
| 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 /> **Default**: 8080 |
2024-11-02 14:58:28 +01:00
2024-11-02 14:58:30 +01:00
| 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 |
2024-11-02 14:58:33 +01:00
##### "*HTTPS* Proxy" or "*SOCKS* Proxy"
2024-11-02 14:58:30 +01:00
_`hidden`_
2024-11-02 14:58:34 +01:00
**Hidden**: depends on a calculation.
2024-11-02 14:58:30 +01:00
2024-11-02 14:58:33 +01:00
This family builds families dynamically.
**Identifiers**: < br / > - HTTPS< br / > - SOCKS
2024-11-02 14:58:30 +01:00
| Variable | Description |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
2024-11-02 14:58:33 +01:00
| **manual.https_proxy.address** or **manual.socks_proxy.address** < br /> [`domainname`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | "*HTTPS* address" 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** or **manual.socks_proxy.port** < br /> [`port`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | "*HTTPS* port" or "*SOCKS* port".< br /> **Default**: the value of the variable "manual.http_proxy.port". |
2024-11-02 14:58:18 +01:00
2024-11-02 14:58:26 +01:00
2024-11-02 14:58:34 +01:00
- [[tutorial 042] Jinja with a parameter](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_042/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_042~1..v1.1_042))