158 lines
5.4 KiB
Markdown
158 lines
5.4 KiB
Markdown
- [List of all the tutorial steps](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md)
|
||
- [[Previous tutorial v1.1_073] Jinja could returns a boolean](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_073/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_080~1..v1.1_080))
|
||
|
||
# [tutorial v1.1_080] HTTP Proxy with "proxy" type
|
||
|
||
- [Read the tutorial "HTTP Proxy with "proxy" type" in the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/customtype.html#http-proxy-with-proxy-type)
|
||
- [View the changes in the files](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_080~1..v1.1_080)
|
||
|
||
|
||
## 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_080
|
||
```
|
||
|
||
## Structure
|
||
|
||
<p>
|
||
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_080/./">.</a><br/>
|
||
├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_080/./firefox/">firefox</a><br/>
|
||
│ ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_080/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
|
||
│ ├── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_080/./firefox/10-manual.yml">10-manual.yml</a><br/>
|
||
│ └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_080/./firefox/20-manual.yml">20-manual.yml</a><br/>
|
||
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_080/./types/">types</a><br/>
|
||
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_080/./types/proxy/">proxy</a><br/>
|
||
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_080/./types/proxy/00-type.yml">00-type.yml</a><br/>
|
||
<br/><br/></p>
|
||
|
||
Contents of the types/proxy/00-type.yml type file
|
||
|
||
```yml
|
||
%YAML 1.2
|
||
---
|
||
version: 1.1
|
||
|
||
proxy:
|
||
|
||
address:
|
||
description: Proxy address
|
||
type: domainname
|
||
params:
|
||
allow_ip: true
|
||
|
||
port:
|
||
description: Proxy port
|
||
type: port
|
||
default: 8080
|
||
...
|
||
|
||
```
|
||
|
||
***
|
||
Contents of the firefox/10-manual.yml file
|
||
|
||
```yml
|
||
%YAML 1.2
|
||
---
|
||
version: 1.1
|
||
|
||
manual:
|
||
description: Manual proxy configuration
|
||
disabled:
|
||
variable: _.proxy_mode
|
||
when_not: Manual proxy configuration
|
||
|
||
http_proxy:
|
||
description: HTTP Proxy
|
||
type: proxy
|
||
...
|
||
|
||
```
|
||
|
||
***
|
||
### Let's generate the documentation
|
||
|
||
```shell
|
||
rougail -m firefox/ --types types/proxy -o doc
|
||
```
|
||
[View the documentation file](DOCUMENTATION.md)
|
||
|
||
|
||
***
|
||
### Let's generate the changelog
|
||
|
||
```shell
|
||
rougail -m firefox/ --types types/proxy -o doc --doc.contents changelog --doc.changelog.previous_json_file previous.yml
|
||
```
|
||
[View the changelog file](CHANGELOG.md)
|
||
|
||
***
|
||
## User datas
|
||
|
||
### Example 1
|
||
|
||
#### config/01/config.yml
|
||
|
||
|
||
```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
|
||
```
|
||
|
||
***
|
||
#### Output
|
||
|
||
```shell
|
||
rougail -m firefox/ --types types/proxy -u yaml -yf config/01/config.yml
|
||
```
|
||
> [!NOTE]
|
||
>
|
||
> **Caption:**
|
||
> - Variable
|
||
> - <span style="color: #B8860B">Default value</span>
|
||
> - <span style="color: #006400">Modified value</span>
|
||
> - (:hourglass_flowing_sand: Original default value)
|
||
|
||
Variables:
|
||
- :notebook: proxy_mode (Configure Proxy Access to the Internet): <span style="color: #006400">Manual proxy configuration</span> ← loaded from the YAML file "config/01/config.yml" (:hourglass_flowing_sand: No proxy)
|
||
- :open_file_folder: manual (Manual proxy configuration)
|
||
- :open_file_folder: http_proxy (HTTP Proxy)
|
||
- :notebook: address (Proxy address): <span style="color: #006400">http.proxy.net</span> ← loaded from the YAML file "config/01/config.yml"
|
||
- :notebook: port (Proxy port): <span style="color: #006400">3128</span> ← loaded from the YAML file "config/01/config.yml" (:hourglass_flowing_sand: 8080)
|
||
- :notebook: use_for_https (Also use this proxy for HTTPS): <span style="color: #006400">false</span> ← loaded from the YAML file "config/01/config.yml" (:hourglass_flowing_sand: true)
|
||
- :open_file_folder: https_proxy (HTTPS Proxy)
|
||
- :notebook: address (HTTPS address): <span style="color: #006400">https.proxy.net</span> ← loaded from the YAML file "config/01/config.yml" (:hourglass_flowing_sand: http.proxy.net)
|
||
- :notebook: port (HTTPS port): <span style="color: #B8860B">3128</span>
|
||
- :open_file_folder: socks_proxy (SOCKS Proxy)
|
||
- :notebook: address (SOCKS address): <span style="color: #B8860B">http.proxy.net</span>
|
||
- :notebook: port (SOCKS port): <span style="color: #B8860B">3128</span>
|
||
- :notebook: version (SOCKS host version used by proxy): <span style="color: #B8860B">v5</span>
|
||
|
||
***
|
||
|
||
|
||
- [[Next tutorial v1.1_081] HTTPS and SOCKS Proxy with "proxy" type](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_081~1..v1.1_081))
|