Practice

Objectives

Now it’s your turn again. Try making some Rougail. At the same time, if you get stuck, you have the solutions in the Rougail tutorial code repository.

There is nothing new in the three next Firefox variables. So it is the time to practice what we’ve learned until now.

This page is divided in two parts for each variable:

  • Explain what we want to implement

  • Propose to you a solution

The best for you is to do this job on your own and compare your work to our propositions.

Here are the two first variables in the Firefox configuration’s widget:

../_images/practice_threevars.png

The third appears only if we enable DNS over HTTPS with a custom providers, we have to set a Custom DNS URL.

These three variables are highlighted here in the lower part of the Firefox configuration’s widget:

../_images/firefox160.png

Prerequisites

  • We assume that Rougail’s library is installed on your computer.

  • It is possible to retrieve the current state of the various Rougail files manipulated in this tutorial step by checking out the corresponding tag of the rougail-tutorials git repository. Each tag corresponds to a stage of progress in the tutorial. Of course, you can also decide to copy/paste or download the tutorial files contents while following the tutorial steps.

If you want to follow this tutorial with the help of the corresponding rougail-tutorials git repository, this workshop page corresponds to the tags 1.1_160 to 1.1_162 in the repository.

git clone https://forge.cloud.silique.fr/stove/rougail-tutorials.git
git switch --detach 1.1_160

A boolean variable

What do we want to be implemented

Exercice

You need to think about:

  • choose a file name that respect the file naming and organizing convention

  • define an appropriate family and variable name, have a look at our variable naming convention

  • we will set the variable in a family (with others variable later) to separate this purpose

  • the family and variable description parameter will be the Firefox description

  • the variable is a boolean with the default value false (unchecked option)

  • the family and variable are always available, it’s not directly related to the proxy choice

Our solution

Please unroll the “Solution” widget to see our solution:

A choice variable

What do we want to be implemented

Exercice

You need to think about:

  • this variable will be in the same file as the first one

  • define an appropriate variable name, have a look at our variable naming convention

  • we will set the variable in the previous family

  • the variable description parameter will be the Firefox description

  • the variable is a choice with the following proposal: Cloudflare, NextDNS and Custom

  • this variable shall be disabled if the enable_dns_over_https variable is false.

Our solution

For those who follow the tutorial with the help of the git repository

Now you need to checkout the v1.1_161 version:

git switch --detach v1.1_161

Please unroll the “Solution” widget to see our solution:

A web_address variable

What do we want to be implemented

Exercice

You need to think about:

  • this variable will be in the same file as the two others

  • define an appropriate variable name, have a look at our variable naming convention

  • we will set the variable in the previous family

  • the variable description parameter will be the Firefox description

  • the variable is a web_address

  • this variable shall be disabled if the provider variable is not Custom

  • the variable provider could be disabled too

Our solution

For those who follow the tutorial with the help of the git repository

Now you need to checkout the v1.1_162 version:

git switch --detach v1.1_162

Please unroll the “Solution” widget to see our solution: