diff --git a/build.py b/build.py index acda5e9..97c9eab 100755 --- a/build.py +++ b/build.py @@ -1,28 +1,34 @@ #!/usr/bin/env python3 +import sys from pathlib import Path from ruamel.yaml import YAML from ansi2html import Ansi2HTMLConverter -from rougail import RougailConfig, Rougail +from rougail import Rougail +from rougail.config import get_rougail_config from rougail.output_exporter import RougailOutputExporter from rougail.user_data_file import RougailUserDataFile from rougail.output_doc import RougailOutputDoc -NUM="50" - - if __name__ == "__main__": - rougailconfig = RougailConfig.copy() + version = sys.argv[1] +# rougailconfig = RougailConfig.copy() + rougailconfig = get_rougail_config(backward_compatibility=False, add_extra_options=False) rougailconfig['main_dictionaries'] = ['firefox'] - rougailconfig['default_dictionary_format_version'] = '1.1' - if Path('foxyproxy').is_dir(): + rougailconfig['default_dictionary_format_version'] = version + if Path('config/namespace').is_file(): + has_namespace = True has_foxyproxy = False + elif Path('foxyproxy').is_dir(): + has_foxyproxy = True + has_namespace = True rougailconfig['main_namespace'] = 'Firefox' rougailconfig['extra_dictionaries'] = {'FoxyProxy': ['foxyproxy']} else: - has_foxyproxy = True + has_foxyproxy = False + has_namespace = False rougailconfig['main_namespace'] = None # rougailconfig['tiramisu_cache'] = "cache.py" # rougail = Rougail(rougailconfig) @@ -31,19 +37,33 @@ if __name__ == "__main__": rougailconfig['step.output'] = 'doc' rougailconfig['doc.output_format'] = 'github' rougailconfig['doc.title_level'] = 3 - inventory = RougailOutputDoc(rougailconfig=rougailconfig) + if Path('mode').is_file(): + rougailconfig['modes_level'] = ['basic', 'standard', 'advanced'] + has_mode = True + else: + has_mode = False + inventory = RougailOutputDoc(rougailconfig=rougailconfig.copy()) rougailconfig['step.output'] = 'exporter' header = inventory.formater.header() - doc = '' + summary = Path('summary_before.md') + if summary.is_file(): + with summary.open('r') as sfh: + doc = sfh.read() + '\n\n' + else: + doc = '' yaml = YAML() namespace = 'firefox' file_found = False - subdoc = '' if rougailconfig['main_namespace']: all_dirs = [[rougailconfig['main_dictionaries']], rougailconfig['extra_dictionaries'].values()] else: all_dirs = [[rougailconfig['main_dictionaries']]] + doc += inventory.formater.title('Screenshot', 2) + '\n' + doc += f'{namespace.capitalize()} Proxy setting\n\n' +# with doc_file.open('r') as docfh: +# doc += docfh.read() + doc += '\n' + inventory.formater.title('Structure', 2) + '\n' for r in all_dirs: for dirs in r: for d in dirs: @@ -53,80 +73,97 @@ if __name__ == "__main__": namespace = f.parent.name file_found = True if f.name.endswith('.yml') or f.name.endswith('.yaml'): - subdoc += inventory.formater.title(str(f), 2) + doc += inventory.formater.title(str(f), 3) + doc += '\n```yml\n' with f.open(encoding="utf8") as file_fh: - objects = yaml.load(file_fh) - subdoc += inventory.formater.yaml(objects) -# doc += f'![{namespace.capitalize()} Proxy setting]({namespace}.png)\n' - doc += f'{namespace.capitalize()} Proxy setting\n\n' - with Path('summary.md').open('r') as sfh: - summary = sfh.read() - doc_file = Path('README.md') - doc = header + inventory.formater.title('Summary', 1) + '\n' + summary + '\n\n' + inventory.formater.title('Structural files', 1) + doc + '\n' + subdoc - with doc_file.open('r') as docfh: - doc += inventory.formater.title('Description', 2) + docfh.read() - if file_found: - doc += inventory.formater.title('Generated documentation', 2) + doc += file_fh.read() + doc += '\n```\n' + inv_doc = inventory.gen_doc() + if file_found and inv_doc: + doc += inventory.formater.title('Generated documentation', 3) + CMD = f"foo@bar:~$ rougail -v {version} -m firefox/ " + if has_namespace: + CMD += "-s Firefox " if has_foxyproxy: - cmd = f"foo@bar:~$ rougail -v 1.1 -m firefox -o doc -do github" - else: - cmd = f"foo@bar:~$ rougail -v 1.1 -m firefox -n Firefox -e FoxyProxy -d 1 foxyproxy -o doc -do github" + CMD += "-xn FoxyProxy -xd 0 foxyproxy/ " + if has_mode: + CMD += "--modes_level basic standard advanced " + cmd = CMD + "-o doc -do github" doc += f'```console\n{cmd}\n```\n' - doc += inventory.gen_doc() + doc += inv_doc # config = Path('config') if config.is_dir(): - doc += inventory.formater.title('User data', 1) + doc += inventory.formater.title('User data', 2) configs = list(config.iterdir()) configs.sort() for idx, dirname in enumerate(configs): + if dirname.is_file(): + continue for filename in dirname.iterdir(): if filename.name.endswith('.yml') or filename.name.endswith('.yaml'): - doc += inventory.formater.title(f'Example {idx + 1}', 2) + doc += inventory.formater.title(f'Example {idx + 1}', 3) + doc += inventory.formater.title(str(filename), 4) + doc += '\n```yml\n' with filename.open(encoding="utf8") as file_fh: - objects = yaml.load(file_fh) - doc += inventory.formater.title(str(filename), 3) - doc += inventory.formater.yaml(objects) - readme = dirname / 'README.md' - if readme.is_file(): - doc += inventory.formater.title('Description', 3) - with readme.open() as fh: - doc += fh.read() + '\n\n' + doc += file_fh.read() + doc += '\n```\n' +# with filename.open(encoding="utf8") as file_fh: +# objects = yaml.load(file_fh) +# doc += inventory.formater.yaml(objects) + #readme = dirname / 'README.md' + #if readme.is_file(): + # doc += inventory.formater.title('Description', 4) + # with readme.open() as fh: + # doc += fh.read() + '\n\n' rougail = Rougail(rougailconfig) tiramisu_config = rougail.get_config() rougailconfig['step.user_data'] = ['file'] - rougailconfig['file.filename'] = str(filename.absolute()) + rougailconfig['file.filename'] = [str(filename.absolute())] data = RougailUserDataFile(tiramisu_config, rougailconfig=rougailconfig) - data.read() - export = RougailOutputExporter(tiramisu_config, rougailconfig=rougailconfig) - export.errors = data.errors - export.warnings = data.warnings + ret = data.run() + errors = rougail.user_datas(ret) + export = RougailOutputExporter(tiramisu_config, + rougailconfig=rougailconfig, + user_data_errors=errors['errors'], + user_data_warnings=errors['warnings'], + ) export.exporter() with export.formater.console.capture() as capture: export.print() conv = Ansi2HTMLConverter(inline=True) - doc += inventory.formater.title('Output', 3) - if has_foxyproxy: - cmd = f"foo@bar:~$ rougail -v 1.1 -m firefox -u file -ff {filename}" - else: - cmd = f"foo@bar:~$ rougail -v 1.1 -m firefox -n Firefox -e FoxyProxy -d 1 foxyproxy -u file -ff {filename}" + doc += inventory.formater.title('Output', 4) + cmd = CMD + f"-u file -ff {filename}" doc += f"```console\n{cmd}\n```\n" - doc += '
' + conv.convert(capture.get(), full=False) + "
\n" - if (dirname / 'read_write').is_file(): + conv_data = '
' + conv.convert(capture.get(), full=False) + "
\n" + doc += conv_data + with open(dirname / 'output_ro.html', 'w') as fh_output: + fh_output.write(conv_data) + if (config / 'read_write').is_file(): rougailconfig['exporter.read_write'] = True - export = RougailOutputExporter(tiramisu_config, rougailconfig=rougailconfig) + export = RougailOutputExporter(tiramisu_config, + rougailconfig=rougailconfig, + user_data_errors=data.errors, + user_data_warnings=data.warnings, + ) export.exporter() with export.formater.console.capture() as capture: export.print() conv = Ansi2HTMLConverter(inline=True) - doc += inventory.formater.title('Output in read write mode', 3) - if has_foxyproxy: - cmd = f"foo@bar:~$ rougail -v 1.1 -m firefox -u file -ff {filename} --exporter.read_write" - else: - cmd = f"foo@bar:~$ rougail -v 1.1 -m firefox -n Firefox -e FoxyProxy -d 1 foxyproxy -u file -ff {filename} --exporter.read_write" + doc += inventory.formater.title('Output in read write mode', 4) + cmd = cmd + " --exporter.read_write" doc += f"```console\n{cmd}\n```\n" - doc += '
' + conv.convert(capture.get(), full=False) + "
\n" + conv_data = '
' + conv.convert(capture.get(), full=False) + "
\n" + doc += '
' + conv_data + "
\n" + with open(dirname / 'output_rw.html', 'w') as fh_output: + fh_output.write(conv_data) # + summary = Path('summary_after.md') + if summary.is_file(): + with summary.open('r') as sfh: + doc += '\n\n' + sfh.read() + # + doc_file = Path('README.md') with doc_file.open('w') as docfh: docfh.write(doc) with doc_file.open('w') as docfh: diff --git a/build.sh b/build.sh index 55e550a..ed95bb1 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,8 @@ #!/bin/bash -e + +#----------------------- +VERSION=1.1 +#----------------------- set -x DEST=../rougail-tutorials @@ -13,6 +17,8 @@ BUILDER="$(pwd)" mkdir -p $DEST/firefox rm -f summary.md touch summary.md +rm -f summary_total.md +touch summary_total.md cd "$DEST" DEST="$(pwd)" @@ -21,20 +27,40 @@ cp "$BUILDER"/firefox.png . cp "$BUILDER"/foxyproxy.png . cp "$BUILDER"/summary.md . touch README.md -"$BUILDER"/build.py +"$BUILDER"/build.py "$VERSION" rm -rf summary.md +rm -rf summary_total.md rm -rf jinja_caches -git init -b 1.1 +git init -b "$VERSION" git add . git commit -am"$(cat $BUILDER/TITLE)" +#old_commit_id="$(git rev-parse HEAD)" cd - > /dev/null for i in $(ls -d "examples"/* | sort); do + num=$(echo $(basename "$i")) + echo "$num" + commit_id="v$VERSION_$num" + summary="[tutorial $(basename $i)] $(head -n 1 $i/README.md)" + echo "- [$summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/$commit_id/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/${commit_id}~1..$commit_id))" >> summary_total.md +done + +for i in $(ls -d "examples"/* | sort); do + if [ -f "$i/TITLE.md" ]; then + echo "- $(head -n 1 $i/TITLE.md)" >> summary.md + fi + if [ -f "$i/SUBTITLE.md" ]; then + echo " - $(head -n 1 $i/SUBTITLE.md)" >> summary.md + fi if [ -f "$i/README.md" ]; then - rm -rf "$DEST/config" - cp "summary.md" "$DEST" - echo $(basename "$i") - # + rm -rf "$DEST/config" + num=$(echo $(basename "$i")) + echo "$num" + commit_id="v$VERSION_$num" + summary="[tutorial $(basename $i)] $(head -n 1 $i/README.md)" + diff_url="https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/${commit_id}~1..$commit_id" + echo " - [$summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/$commit_id/README.md) ([diff]($diff_url))" >> summary.md + cp "summary_total.md" "$DEST" cd "$i/dictionaries" if [ -d firefox ]; then for j in $(ls firefox/*.yml 2>/dev/null); do @@ -52,20 +78,52 @@ for i in $(ls -d "examples"/* | sort); do cp -aL ../config "$DEST" fi msg="[tutorial $(basename $i)] $(cat ../README.md)" - summary="[tutorial $(basename $i)] $(head -n 1 ../README.md)" [ -e ../firefox.png ] && cp ../firefox.png "$DEST" [ -e ../foxyproxy.png ] && cp ../foxyproxy.png "$DEST" cd - > /dev/null cd "$DEST" - echo "- $summary" >> summary.md - "$BUILDER"/build.py - rm -rf config/*/README.md config/*/read_write - rm -rf jinja_caches summary.md + # + before=$(grep "commit/$commit_id/README.md" summary_total.md -B1 | wc -l) + echo "- [Summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/$VERSION/README.md)" > summary_before.md + if [ "$before" = "2" ]; then + echo $(grep "commit/$commit_id/README.md" summary_total.md -B1 | head -n 1) >> summary_before.md + fi + echo "" >> summary_before.md + echo "# $summary" >> summary_before.md + echo "" >> summary_before.md + echo "[View the diff]($diff_url)" >> summary_before.md + after=$(grep "commit/$commit_id/README.md" summary_total.md -A1 | wc -l) + if [ "$after" = "2" ]; then + echo $(grep "commit/$commit_id/README.md" summary_total.md -A1 | tail -n 1) > summary_after.md + fi + # + if [ -f config/mode ]; then + mv config/mode mode + fi + "$BUILDER"/build.py "$VERSION" + rm -rf config/*/README.md config/read_write config/namespace + rm -rf jinja_caches summary.md summary_before.md summary_after.md summary_total.md + if [ -f mode ]; then + MODE=1 + rm -f mode + else + MODE=0 + fi + git add *.png README.md + if [ -d config ]; then + git add config + else + git status |grep -q config && git add config + fi + git commit -m"$summary (config and doc)" git add . git commit -am"$msg" - commit_id="$(git rev-parse HEAD)" + git tag -a "$commit_id" -m"format version $VERSION: $num" + if [ "$MODE" = 1 ]; then + touch mode + fi cd - > /dev/null - echo "- [$summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/$commit_id/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/commit/$commit_id))" >> summary.md +# old_commit_id="$commit_id" fi done cd "$DEST" @@ -85,18 +143,30 @@ This is what the page looks like: ![Foxyproxy Proxy setting](foxyproxy.png) " > README.md +echo '# Installation + +```bash +# python -m venv rougail +# . rougail/bin/activate +# pip install rougail-cli rougail-output-exporter rougail-output-doc rougail-user-data-file +``` +' >> README.md echo "# Summary Each step is a separerate commit. You can navigate to history to discover different aspect to the Rougail format. " >> README.md +cp "$BUILDER"/firefox.png . +cp "$BUILDER"/foxyproxy.png . cat "$BUILDER"/summary.md >> README.md echo >> README.md +rm -rf firefox foxyproxy mode git add . -rm -rf firefox foxyproxy git commit -am"Summary" # git remote add origin ssh://git@forge.cloud.silique.fr:2222/stove/rougail-tutorials.git -git push --set-upstream origin 1.1 --force +git push --set-upstream origin $VERSION --force +git push --tag --force +rm -f summary.md summary_total.md echo "FAIT" exit 0 diff --git a/examples/000/README.md b/examples/000/README.md new file mode 100644 index 0000000..184d736 --- /dev/null +++ b/examples/000/README.md @@ -0,0 +1 @@ +A structured file with format version diff --git a/examples/000/SUBTITLE.md b/examples/000/SUBTITLE.md new file mode 100644 index 0000000..bd5e267 --- /dev/null +++ b/examples/000/SUBTITLE.md @@ -0,0 +1 @@ +Structural file diff --git a/examples/000/TITLE.md b/examples/000/TITLE.md new file mode 100644 index 0000000..e5d1207 --- /dev/null +++ b/examples/000/TITLE.md @@ -0,0 +1 @@ +Getting started diff --git a/examples/000/dictionaries/firefox/00-proxy.yml b/examples/000/dictionaries/firefox/00-proxy.yml new file mode 100644 index 0000000..525ab79 --- /dev/null +++ b/examples/000/dictionaries/firefox/00-proxy.yml @@ -0,0 +1,2 @@ +--- +version: 1.1 diff --git a/examples/001/README.md b/examples/001/README.md index b75adba..21f4eae 100644 --- a/examples/001/README.md +++ b/examples/001/README.md @@ -1,10 +1 @@ -A first variable - -In the Firefox configuration, it is possible to define several configuration modes, -from no proxy at all ("No proxy") to a kind of automatic configuration mode from a file -("Automatic proxy configuration URL"). - -We’re gonna create a first variable called "proxy_mode": - -- accepts only a string as value -- requires a value (that is, None is not an option) +The format version in commandline diff --git a/examples/001/dictionaries/firefox/00-proxy.yml b/examples/001/dictionaries/firefox/00-proxy.yml index e468d85..ed97d53 100644 --- a/examples/001/dictionaries/firefox/00-proxy.yml +++ b/examples/001/dictionaries/firefox/00-proxy.yml @@ -1,2 +1 @@ --- -proxy_mode: diff --git a/examples/001/firefox.png b/examples/001/firefox.png deleted file mode 100644 index 45725ac..0000000 Binary files a/examples/001/firefox.png and /dev/null differ diff --git a/examples/002/README.md b/examples/002/README.md deleted file mode 100644 index bd15787..0000000 --- a/examples/002/README.md +++ /dev/null @@ -1,9 +0,0 @@ -The variable description - -We can add a description to this first variable. - -This information is useful for: - -- documentation -- error message -- help user to known which value to set to this variable (for example with [the user data plugin Questionary](https://forge.cloud.silique.fr/gnunux/rougail-user-data-questionary)). diff --git a/examples/002/config b/examples/002/config deleted file mode 120000 index 6cf3df8..0000000 --- a/examples/002/config +++ /dev/null @@ -1 +0,0 @@ -../001/config \ No newline at end of file diff --git a/examples/003/README.md b/examples/003/README.md deleted file mode 100644 index 2931300..0000000 --- a/examples/003/README.md +++ /dev/null @@ -1,7 +0,0 @@ -A default value - -Now we can define the default value of this variable. - -If the user doesn't touch this variable's value, the value is "No proxy" - -As user intervention is no more required, so the variable change it's default mode too (from "basic" to "standard"). diff --git a/examples/003/config b/examples/003/config deleted file mode 120000 index 6cf3df8..0000000 --- a/examples/003/config +++ /dev/null @@ -1 +0,0 @@ -../001/config \ No newline at end of file diff --git a/examples/004/README.md b/examples/004/README.md deleted file mode 100644 index 529e7d6..0000000 --- a/examples/004/README.md +++ /dev/null @@ -1,7 +0,0 @@ -A variable with type choice - -"Foo" should not be an option to the "proxy_mode" variable. - -Now the "proxy_mode" type is "choice", that means that there is a list of available values that can be selected. - -We say that the "proxy_mode" variable is constrained (by choices): this variable accept, in fact, only a list of choices. diff --git a/examples/004/config b/examples/004/config deleted file mode 120000 index 6cf3df8..0000000 --- a/examples/004/config +++ /dev/null @@ -1 +0,0 @@ -../001/config \ No newline at end of file diff --git a/examples/005/README.md b/examples/005/README.md deleted file mode 100644 index 4f83f97..0000000 --- a/examples/005/README.md +++ /dev/null @@ -1,3 +0,0 @@ -Choice type is optional - -The type is optional in choice type (if we have choices attributes, it's a choice option). diff --git a/examples/005/config b/examples/005/config deleted file mode 120000 index 6cf3df8..0000000 --- a/examples/005/config +++ /dev/null @@ -1 +0,0 @@ -../001/config \ No newline at end of file diff --git a/examples/010/README.md b/examples/010/README.md index 6a27bc7..5abcd36 100644 --- a/examples/010/README.md +++ b/examples/010/README.md @@ -1,14 +1 @@ -A family - -The "manual" mode structural descriptions are write in a new files to separate things. But Rougail will concatenate variables and families. - -We create a family, which will contain other variables. - -This family has: - -- a description -- a type - -As there is no variable inside this family, the type is mandatory. Without it, Rougail will create a variable. - -In fact, this family will be deleted by Rougail too because it is empty. +A first variable with only a name diff --git a/examples/010/SUBTITLE.md b/examples/010/SUBTITLE.md new file mode 100644 index 0000000..50b3d6b --- /dev/null +++ b/examples/010/SUBTITLE.md @@ -0,0 +1 @@ +Variable: choice the proxy mode diff --git a/examples/001/config/01/README.md b/examples/010/config/01/README.md similarity index 100% rename from examples/001/config/01/README.md rename to examples/010/config/01/README.md diff --git a/examples/001/config/01/config.yaml b/examples/010/config/01/config.yaml similarity index 100% rename from examples/001/config/01/config.yaml rename to examples/010/config/01/config.yaml diff --git a/examples/001/config/02/config.yaml b/examples/010/config/02/config.yaml similarity index 100% rename from examples/001/config/02/config.yaml rename to examples/010/config/02/config.yaml diff --git a/examples/001/config/03/config.yaml b/examples/010/config/03/config.yaml similarity index 100% rename from examples/001/config/03/config.yaml rename to examples/010/config/03/config.yaml diff --git a/examples/001/config/04/README.md b/examples/010/config/04/README.md similarity index 100% rename from examples/001/config/04/README.md rename to examples/010/config/04/README.md diff --git a/examples/001/config/04/config.yaml b/examples/010/config/04/config.yaml similarity index 100% rename from examples/001/config/04/config.yaml rename to examples/010/config/04/config.yaml diff --git a/examples/001/config/05/README.md b/examples/010/config/05/README.md similarity index 100% rename from examples/001/config/05/README.md rename to examples/010/config/05/README.md diff --git a/examples/001/config/05/config.yaml b/examples/010/config/05/config.yaml similarity index 100% rename from examples/001/config/05/config.yaml rename to examples/010/config/05/config.yaml diff --git a/examples/010/dictionaries/firefox/00-proxy.yml b/examples/010/dictionaries/firefox/00-proxy.yml new file mode 100644 index 0000000..e468d85 --- /dev/null +++ b/examples/010/dictionaries/firefox/00-proxy.yml @@ -0,0 +1,2 @@ +--- +proxy_mode: diff --git a/examples/010/firefox.png b/examples/010/firefox.png index 2dea193..45725ac 100644 Binary files a/examples/010/firefox.png and b/examples/010/firefox.png differ diff --git a/examples/010/firefox.xcf b/examples/010/firefox.xcf index d73e03e..1101ae9 100644 Binary files a/examples/010/firefox.xcf and b/examples/010/firefox.xcf differ diff --git a/examples/011/README.md b/examples/011/README.md index 8072d5b..bd15787 100644 --- a/examples/011/README.md +++ b/examples/011/README.md @@ -1,5 +1,9 @@ -Conditional desactived family +The variable description -This family will be desactived if "proxy_mode" is not "manual proxy configuration". +We can add a description to this first variable. -Desactived a variable or a family means that this variable will never be accessible. +This information is useful for: + +- documentation +- error message +- help user to known which value to set to this variable (for example with [the user data plugin Questionary](https://forge.cloud.silique.fr/gnunux/rougail-user-data-questionary)). diff --git a/examples/011/config b/examples/011/config new file mode 120000 index 0000000..160a2a6 --- /dev/null +++ b/examples/011/config @@ -0,0 +1 @@ +../010/config \ No newline at end of file diff --git a/examples/002/dictionaries/firefox/00-proxy.yml b/examples/011/dictionaries/firefox/00-proxy.yml similarity index 100% rename from examples/002/dictionaries/firefox/00-proxy.yml rename to examples/011/dictionaries/firefox/00-proxy.yml diff --git a/examples/011/dictionaries/firefox/10-manual.yml b/examples/011/dictionaries/firefox/10-manual.yml deleted file mode 100644 index 29ea6a3..0000000 --- a/examples/011/dictionaries/firefox/10-manual.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -manual: - description: Manual proxy configuration - type: family - disabled: - type: variable - variable: proxy_mode - when_not: 'Manual proxy configuration' diff --git a/examples/012/README.md b/examples/012/README.md index 3a2fca9..2931300 100644 --- a/examples/012/README.md +++ b/examples/012/README.md @@ -1,7 +1,7 @@ -A sub family +A default value -Inside a family, we can have variables or families. +Now we can define the default value of this variable. -The "type" for family "manual" became unecessary because container an other family, so it's not a variable. +If the user doesn't touch this variable's value, the value is "No proxy" -In disabled attribute, it's better tu use relative path (we will see the reason in an other slide). +As user intervention is no more required, so the variable change it's default mode too (from "basic" to "standard"). diff --git a/examples/012/config b/examples/012/config new file mode 120000 index 0000000..160a2a6 --- /dev/null +++ b/examples/012/config @@ -0,0 +1 @@ +../010/config \ No newline at end of file diff --git a/examples/003/dictionaries/firefox/00-proxy.yml b/examples/012/dictionaries/firefox/00-proxy.yml similarity index 100% rename from examples/003/dictionaries/firefox/00-proxy.yml rename to examples/012/dictionaries/firefox/00-proxy.yml diff --git a/examples/013/README.md b/examples/013/README.md index 8aac5a2..5f84ecf 100644 --- a/examples/013/README.md +++ b/examples/013/README.md @@ -1,5 +1,7 @@ -Family in "shorthand" mode +A variable with type "choice" -The sub family is now in "shorthand" mode. In this mode we can only define "name" and "description" attributes. +"Foo" should not be an option to the "proxy_mode" variable. -Inside the sub family we add two variables (with domainname and port types). +Now the "proxy_mode" type is "choice", that means that there is a list of available values that can be selected. + +We say that the "proxy_mode" variable is constrained (by choices): this variable accept, in fact, only a list of choices. diff --git a/examples/013/config b/examples/013/config new file mode 120000 index 0000000..160a2a6 --- /dev/null +++ b/examples/013/config @@ -0,0 +1 @@ +../010/config \ No newline at end of file diff --git a/examples/004/dictionaries/firefox/00-proxy.yml b/examples/013/dictionaries/firefox/00-proxy.yml similarity index 100% rename from examples/004/dictionaries/firefox/00-proxy.yml rename to examples/013/dictionaries/firefox/00-proxy.yml diff --git a/examples/014/README.md b/examples/014/README.md index 02e52b2..4f83f97 100644 --- a/examples/014/README.md +++ b/examples/014/README.md @@ -1,3 +1,3 @@ -A boolean variable +Choice type is optional -Let's create a boolean variable. +The type is optional in choice type (if we have choices attributes, it's a choice option). diff --git a/examples/014/config b/examples/014/config new file mode 120000 index 0000000..160a2a6 --- /dev/null +++ b/examples/014/config @@ -0,0 +1 @@ +../010/config \ No newline at end of file diff --git a/examples/005/dictionaries/firefox/00-proxy.yml b/examples/014/dictionaries/firefox/00-proxy.yml similarity index 100% rename from examples/005/dictionaries/firefox/00-proxy.yml rename to examples/014/dictionaries/firefox/00-proxy.yml diff --git a/examples/015/README.md b/examples/015/README.md deleted file mode 100644 index bb1058e..0000000 --- a/examples/015/README.md +++ /dev/null @@ -1,3 +0,0 @@ -Bases type is optional if default value - -The type is deduct with the default value type. This is only true for "string", "number", "float" or "boolean" variables. diff --git a/examples/015/config b/examples/015/config deleted file mode 120000 index 6bb267f..0000000 --- a/examples/015/config +++ /dev/null @@ -1 +0,0 @@ -../014/config \ No newline at end of file diff --git a/examples/016/README.md b/examples/016/README.md deleted file mode 100644 index 1ca6797..0000000 --- a/examples/016/README.md +++ /dev/null @@ -1,9 +0,0 @@ -A variable in "shorthand" mode - -Transform it in "shorthand" mode. - -In this notation we can only define: - -- name -- default value (so deduct the type) -- description diff --git a/examples/016/config b/examples/016/config deleted file mode 120000 index 6bb267f..0000000 --- a/examples/016/config +++ /dev/null @@ -1 +0,0 @@ -../014/config \ No newline at end of file diff --git a/examples/017/README.md b/examples/017/README.md deleted file mode 100644 index 887f4cd..0000000 --- a/examples/017/README.md +++ /dev/null @@ -1,9 +0,0 @@ -Conditional hidden family and calculated default value - -Add a sub family "https_proxy" which will be hidden if "use_for_https" is True. - -Hidden means that we cannot change value, but we can access to it in read only mode. Inside, we add two variable with calculated default value (with variable type). - -So, if user set "use_for_https" to True, the default values of HTTPS configuration will be a copy of HTTP values. The use can change HTTPS values if needed. - -If user set "use_for_https" to False, the default values of HTTPS configuration will only be a copy of HTTP values. diff --git a/examples/017/config/01/README.md b/examples/017/config/01/README.md deleted file mode 100644 index 7dbc051..0000000 --- a/examples/017/config/01/README.md +++ /dev/null @@ -1 +0,0 @@ -If "use_for_https" is true, HTTPS variables are visible in read only mode, but not in read write mode. diff --git a/examples/017/dictionaries/firefox/10-manual.yml b/examples/017/dictionaries/firefox/10-manual.yml deleted file mode 100644 index cec0b2f..0000000 --- a/examples/017/dictionaries/firefox/10-manual.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -manual: - description: Manual proxy configuration - disabled: - type: variable - variable: _.proxy_mode - when_not: 'Manual proxy configuration' - - http_proxy: # HTTP Proxy - - address: - description: HTTP address - type: domainname - params: - allow_ip: true - - port: - description: HTTP Port - type: port - default: 8080 - - use_for_https: true # Also use this proxy for HTTPS - - https_proxy: - description: HTTPS Proxy - hidden: - type: variable - variable: _.use_for_https - - address: - description: HTTPS address - type: domainname - params: - allow_ip: true - default: - type: variable - variable: __.http_proxy.address - - port: - description: HTTPS Port - type: port - default: - type: variable - variable: __.http_proxy.port diff --git a/examples/018/README.md b/examples/018/README.md deleted file mode 100644 index bef3f23..0000000 --- a/examples/018/README.md +++ /dev/null @@ -1,15 +0,0 @@ -A dynamic family - -HTTPS and socks proxy are very similar. It could be interesting to do on dynamic family instead of duplicate family and variable description. - -First of all, we add a dynamic attribute to the family. Dynamic is here a static list of suffix. It could be a variable or jinja informations too. - -The dynamic family is only hidden in the HTTPs case. -Hidden is now a Jinja calculation with a parameter named "suffix". - -The suffix is use in: - -- family name -- family description -- variables name -- variables description diff --git a/examples/018/dictionaries/firefox/10-manual.yml b/examples/018/dictionaries/firefox/10-manual.yml deleted file mode 100644 index 6c69ea7..0000000 --- a/examples/018/dictionaries/firefox/10-manual.yml +++ /dev/null @@ -1,54 +0,0 @@ ---- -manual: - description: Manual proxy configuration - disabled: - type: variable - variable: _.proxy_mode - when_not: 'Manual proxy configuration' - - http_proxy: # HTTP Proxy - - address: - description: HTTP address - type: domainname - params: - allow_ip: true - - port: - description: HTTP Port - type: port - default: 8080 - - use_for_https: true # Also use this proxy for HTTPS - - "{{ suffix }}_proxy": - description: "{{ suffix }} Proxy" - type: dynamic - dynamic: - - HTTPS - - SOCKS - hidden: - type: jinja - jinja: | - {% if suffix == 'HTTPS' and _.use_for_https %} - HTTPS is same has HTTP - {% endif %} - params: - suffix: - type: suffix - - address: - description: "{{ suffix }} address" - type: domainname - params: - allow_ip: true - default: - type: variable - variable: __.http_proxy.address - - port: - description: "{{ suffix }} port" - type: port - default: - type: variable - variable: __.http_proxy.port diff --git a/examples/019/README.md b/examples/019/README.md deleted file mode 100644 index 215a16d..0000000 --- a/examples/019/README.md +++ /dev/null @@ -1,5 +0,0 @@ -Description of Jinja calculation - -By default, the Jinja calculation is generic in documentation. We can add a useful description. - -We add a new variable "version" only accessible in "Socks" family. diff --git a/examples/019/dictionaries/firefox/10-manual.yml b/examples/019/dictionaries/firefox/10-manual.yml deleted file mode 100644 index 93650d9..0000000 --- a/examples/019/dictionaries/firefox/10-manual.yml +++ /dev/null @@ -1,70 +0,0 @@ ---- -manual: - description: Manual proxy configuration - disabled: - type: variable - variable: _.proxy_mode - when_not: 'Manual proxy configuration' - - http_proxy: # HTTP Proxy - - address: - description: HTTP address - type: domainname - params: - allow_ip: true - - port: - description: HTTP Port - type: port - default: 8080 - - use_for_https: true # Also use this proxy for HTTPS - - "{{ suffix }}_proxy": - description: "{{ suffix }} Proxy" - type: dynamic - dynamic: - - HTTPS - - SOCKS - hidden: - type: jinja - jinja: | - {% if suffix == 'HTTPS' and _.use_for_https %} - HTTPS is same has HTTP - {% endif %} - params: - suffix: - type: suffix - description: | - if "use_for_https" is set to True - - address: - description: "{{ suffix }} address" - default: - type: variable - variable: __.http_proxy.address - - port: - description: "{{ suffix }} port" - default: - type: variable - variable: __.http_proxy.port - - version: - description: SOCKS host version used by proxy - choices: - - v4 - - v5 - default: v5 - disabled: - type: jinja - jinja: | - {% if suffix == 'HTTPS' %} - if HTTPS - {% endif %} - params: - suffix: - type: suffix - description: | - if not SOCKS diff --git a/examples/020/README.md b/examples/020/README.md index 2f96325..6a27bc7 100644 --- a/examples/020/README.md +++ b/examples/020/README.md @@ -1,3 +1,14 @@ -A conditional disabled variable +A family -Add a new "auto" variable. +The "manual" mode structural descriptions are write in a new files to separate things. But Rougail will concatenate variables and families. + +We create a family, which will contain other variables. + +This family has: + +- a description +- a type + +As there is no variable inside this family, the type is mandatory. Without it, Rougail will create a variable. + +In fact, this family will be deleted by Rougail too because it is empty. diff --git a/examples/020/SUBTITLE.md b/examples/020/SUBTITLE.md new file mode 100644 index 0000000..cb4592b --- /dev/null +++ b/examples/020/SUBTITLE.md @@ -0,0 +1 @@ +Family: proxy manual diff --git a/examples/010/dictionaries/firefox/10-manual.yml b/examples/020/dictionaries/firefox/10-manual.yml similarity index 100% rename from examples/010/dictionaries/firefox/10-manual.yml rename to examples/020/dictionaries/firefox/10-manual.yml diff --git a/examples/020/firefox.png b/examples/020/firefox.png index 20701e2..e40ce96 100644 Binary files a/examples/020/firefox.png and b/examples/020/firefox.png differ diff --git a/examples/020/firefox.xcf b/examples/020/firefox.xcf index 89c7f4b..a2160e6 100644 Binary files a/examples/020/firefox.xcf and b/examples/020/firefox.xcf differ diff --git a/examples/021/README.md b/examples/021/README.md new file mode 100644 index 0000000..3a2fca9 --- /dev/null +++ b/examples/021/README.md @@ -0,0 +1,7 @@ +A sub family + +Inside a family, we can have variables or families. + +The "type" for family "manual" became unecessary because container an other family, so it's not a variable. + +In disabled attribute, it's better tu use relative path (we will see the reason in an other slide). diff --git a/examples/012/dictionaries/firefox/10-manual.yml b/examples/021/dictionaries/firefox/10-manual.yml similarity index 53% rename from examples/012/dictionaries/firefox/10-manual.yml rename to examples/021/dictionaries/firefox/10-manual.yml index e875aa8..44560e6 100644 --- a/examples/012/dictionaries/firefox/10-manual.yml +++ b/examples/021/dictionaries/firefox/10-manual.yml @@ -1,10 +1,7 @@ --- manual: description: Manual proxy configuration - disabled: - type: variable - variable: _.proxy_mode - when_not: 'Manual proxy configuration' + type: family http_proxy: description: HTTP Proxy diff --git a/examples/022/README.md b/examples/022/README.md new file mode 100644 index 0000000..830d642 --- /dev/null +++ b/examples/022/README.md @@ -0,0 +1 @@ +A variable inside sub family diff --git a/examples/013/config/01/config.yaml b/examples/022/config/01/config.yaml similarity index 100% rename from examples/013/config/01/config.yaml rename to examples/022/config/01/config.yaml diff --git a/examples/013/config/02/config.yaml b/examples/022/config/02/config.yaml similarity index 100% rename from examples/013/config/02/config.yaml rename to examples/022/config/02/config.yaml diff --git a/examples/013/config/03/config.yaml b/examples/022/config/03/config.yaml similarity index 100% rename from examples/013/config/03/config.yaml rename to examples/022/config/03/config.yaml diff --git a/examples/013/config/04/config.yaml b/examples/022/config/04/config.yaml similarity index 100% rename from examples/013/config/04/config.yaml rename to examples/022/config/04/config.yaml diff --git a/examples/017/config/02/README.md b/examples/022/config/05/README.md similarity index 100% rename from examples/017/config/02/README.md rename to examples/022/config/05/README.md diff --git a/examples/017/config/02/config.yaml b/examples/022/config/05/config.yaml similarity index 100% rename from examples/017/config/02/config.yaml rename to examples/022/config/05/config.yaml diff --git a/examples/017/config/01/read_write b/examples/022/config/read_write similarity index 100% rename from examples/017/config/01/read_write rename to examples/022/config/read_write diff --git a/examples/022/dictionaries/firefox/10-manual.yml b/examples/022/dictionaries/firefox/10-manual.yml new file mode 100644 index 0000000..b71f9ce --- /dev/null +++ b/examples/022/dictionaries/firefox/10-manual.yml @@ -0,0 +1,11 @@ +--- +manual: + description: Manual proxy configuration + type: family + + http_proxy: + description: HTTP Proxy + type: family + + address: + description: HTTP address diff --git a/examples/023/README.md b/examples/023/README.md new file mode 100644 index 0000000..fa78fb2 --- /dev/null +++ b/examples/023/README.md @@ -0,0 +1 @@ +Family type is optional diff --git a/examples/023/config b/examples/023/config new file mode 120000 index 0000000..160a2a6 --- /dev/null +++ b/examples/023/config @@ -0,0 +1 @@ +../010/config \ No newline at end of file diff --git a/examples/023/dictionaries/firefox/10-manual.yml b/examples/023/dictionaries/firefox/10-manual.yml new file mode 100644 index 0000000..5a37092 --- /dev/null +++ b/examples/023/dictionaries/firefox/10-manual.yml @@ -0,0 +1,9 @@ +--- +manual: + description: Manual proxy configuration + + http_proxy: + description: HTTP Proxy + + address: + description: HTTP address diff --git a/examples/024/README.md b/examples/024/README.md new file mode 100644 index 0000000..d3326ec --- /dev/null +++ b/examples/024/README.md @@ -0,0 +1 @@ +A variable with type "domainname" diff --git a/examples/024/SUBTITLE.md b/examples/024/SUBTITLE.md new file mode 100644 index 0000000..cf6541b --- /dev/null +++ b/examples/024/SUBTITLE.md @@ -0,0 +1 @@ +Variable: type and type parameters diff --git a/examples/024/TITLE.md b/examples/024/TITLE.md new file mode 100644 index 0000000..7ff24c3 --- /dev/null +++ b/examples/024/TITLE.md @@ -0,0 +1 @@ +HTTP Manual mode diff --git a/examples/030/config/01/config.yaml b/examples/024/config/01/config.yaml similarity index 100% rename from examples/030/config/01/config.yaml rename to examples/024/config/01/config.yaml diff --git a/examples/024/config/02/config.yaml b/examples/024/config/02/config.yaml new file mode 100644 index 0000000..74edb22 --- /dev/null +++ b/examples/024/config/02/config.yaml @@ -0,0 +1,2 @@ +--- +proxy_mode: Manual proxy configuration diff --git a/examples/024/config/03/config.yaml b/examples/024/config/03/config.yaml new file mode 100644 index 0000000..e3db924 --- /dev/null +++ b/examples/024/config/03/config.yaml @@ -0,0 +1,5 @@ +--- +proxy_mode: Manual proxy configuration +manual: + http_proxy: + address: example.net diff --git a/examples/024/config/04/config.yaml b/examples/024/config/04/config.yaml new file mode 100644 index 0000000..c8d73af --- /dev/null +++ b/examples/024/config/04/config.yaml @@ -0,0 +1,6 @@ +--- +proxy_mode: Manual proxy configuration +manual: + http_proxy: + address: example.net + port: '3128' diff --git a/examples/024/config/05/README.md b/examples/024/config/05/README.md new file mode 100644 index 0000000..765a56e --- /dev/null +++ b/examples/024/config/05/README.md @@ -0,0 +1,2 @@ +If "use_for_https" is false, HTTPS variables are visible in read only mode and in read write mode. + diff --git a/examples/024/config/05/config.yaml b/examples/024/config/05/config.yaml new file mode 100644 index 0000000..4a1f789 --- /dev/null +++ b/examples/024/config/05/config.yaml @@ -0,0 +1,9 @@ +--- +proxy_mode: Manual proxy configuration +manual: + http_proxy: + address: http.proxy.net + port: '3128' + use_for_https: false + https_proxy: + address: https.proxy.net diff --git a/examples/017/config/02/read_write b/examples/024/config/read_write similarity index 100% rename from examples/017/config/02/read_write rename to examples/024/config/read_write diff --git a/examples/024/dictionaries/firefox/10-manual.yml b/examples/024/dictionaries/firefox/10-manual.yml new file mode 100644 index 0000000..01c7ae0 --- /dev/null +++ b/examples/024/dictionaries/firefox/10-manual.yml @@ -0,0 +1,10 @@ +--- +manual: + description: Manual proxy configuration + + http_proxy: + description: HTTP Proxy + + address: + description: HTTP address + type: domainname diff --git a/examples/025/README.md b/examples/025/README.md new file mode 100644 index 0000000..57a7fb3 --- /dev/null +++ b/examples/025/README.md @@ -0,0 +1 @@ +A variable with type's parameters diff --git a/examples/025/config b/examples/025/config new file mode 120000 index 0000000..de1b26f --- /dev/null +++ b/examples/025/config @@ -0,0 +1 @@ +../022/config \ No newline at end of file diff --git a/examples/025/dictionaries/firefox/10-manual.yml b/examples/025/dictionaries/firefox/10-manual.yml new file mode 100644 index 0000000..a199bc6 --- /dev/null +++ b/examples/025/dictionaries/firefox/10-manual.yml @@ -0,0 +1,12 @@ +--- +manual: + description: Manual proxy configuration + + http_proxy: + description: HTTP Proxy + + address: + description: HTTP address + type: domainname + params: + allow_ip: true diff --git a/examples/026/README.md b/examples/026/README.md new file mode 100644 index 0000000..da8667a --- /dev/null +++ b/examples/026/README.md @@ -0,0 +1 @@ +A variable with type "port" diff --git a/examples/026/config b/examples/026/config new file mode 120000 index 0000000..de1b26f --- /dev/null +++ b/examples/026/config @@ -0,0 +1 @@ +../022/config \ No newline at end of file diff --git a/examples/026/dictionaries/firefox/10-manual.yml b/examples/026/dictionaries/firefox/10-manual.yml new file mode 100644 index 0000000..3cfe16c --- /dev/null +++ b/examples/026/dictionaries/firefox/10-manual.yml @@ -0,0 +1,17 @@ +--- +manual: + description: Manual proxy configuration + + http_proxy: + description: HTTP Proxy + + address: + description: HTTP address + type: domainname + params: + allow_ip: true + + port: + description: HTTP Port + type: port + default: 8080 diff --git a/examples/027/README.md b/examples/027/README.md new file mode 100644 index 0000000..553282f --- /dev/null +++ b/examples/027/README.md @@ -0,0 +1 @@ +A disabled family diff --git a/examples/027/SUBTITLE.md b/examples/027/SUBTITLE.md new file mode 100644 index 0000000..bf25510 --- /dev/null +++ b/examples/027/SUBTITLE.md @@ -0,0 +1 @@ +Property: disabled diff --git a/examples/027/config b/examples/027/config new file mode 120000 index 0000000..de1b26f --- /dev/null +++ b/examples/027/config @@ -0,0 +1 @@ +../022/config \ No newline at end of file diff --git a/examples/027/dictionaries/firefox/10-manual.yml b/examples/027/dictionaries/firefox/10-manual.yml new file mode 100644 index 0000000..0b16451 --- /dev/null +++ b/examples/027/dictionaries/firefox/10-manual.yml @@ -0,0 +1,18 @@ +--- +manual: + description: Manual proxy configuration + disabled: true + + http_proxy: + description: HTTP Proxy + + address: + description: HTTP address + type: domainname + params: + allow_ip: true + + port: + description: HTTP Port + type: port + default: 8080 diff --git a/examples/028/README.md b/examples/028/README.md new file mode 100644 index 0000000..dbdd290 --- /dev/null +++ b/examples/028/README.md @@ -0,0 +1 @@ +A conditional disabled family with a variable diff --git a/examples/028/config b/examples/028/config new file mode 120000 index 0000000..de1b26f --- /dev/null +++ b/examples/028/config @@ -0,0 +1 @@ +../022/config \ No newline at end of file diff --git a/examples/015/dictionaries/firefox/10-manual.yml b/examples/028/dictionaries/firefox/10-manual.yml similarity index 69% rename from examples/015/dictionaries/firefox/10-manual.yml rename to examples/028/dictionaries/firefox/10-manual.yml index 5021504..695773e 100644 --- a/examples/015/dictionaries/firefox/10-manual.yml +++ b/examples/028/dictionaries/firefox/10-manual.yml @@ -3,10 +3,11 @@ manual: description: Manual proxy configuration disabled: type: variable - variable: _.proxy_mode + variable: proxy_mode when_not: 'Manual proxy configuration' - http_proxy: # HTTP Proxy + http_proxy: + description: HTTP Proxy address: description: HTTP address @@ -18,7 +19,3 @@ manual: description: HTTP Port type: port default: 8080 - - use_for_https: - description: Also use this proxy for HTTPS - default: true diff --git a/examples/029/README.md b/examples/029/README.md new file mode 100644 index 0000000..e84df81 --- /dev/null +++ b/examples/029/README.md @@ -0,0 +1 @@ +Type variable is optional diff --git a/examples/014/dictionaries/firefox/10-manual.yml b/examples/029/dictionaries/firefox/10-manual.yml similarity index 62% rename from examples/014/dictionaries/firefox/10-manual.yml rename to examples/029/dictionaries/firefox/10-manual.yml index 9047f5f..aff6ecc 100644 --- a/examples/014/dictionaries/firefox/10-manual.yml +++ b/examples/029/dictionaries/firefox/10-manual.yml @@ -2,11 +2,11 @@ manual: description: Manual proxy configuration disabled: - type: variable - variable: _.proxy_mode + variable: proxy_mode when_not: 'Manual proxy configuration' - http_proxy: # HTTP Proxy + http_proxy: + description: HTTP Proxy address: description: HTTP address @@ -18,8 +18,3 @@ manual: description: HTTP Port type: port default: 8080 - - use_for_https: - description: Also use this proxy for HTTPS - type: boolean - default: true diff --git a/examples/030/README.md b/examples/030/README.md index 760e014..fe24996 100644 --- a/examples/030/README.md +++ b/examples/030/README.md @@ -1,4 +1 @@ -A conditional disabled variable - -Add a new "no\_proxy" variable. - +A variable with type "boolean" diff --git a/examples/030/TITLE.md b/examples/030/TITLE.md new file mode 100644 index 0000000..3730688 --- /dev/null +++ b/examples/030/TITLE.md @@ -0,0 +1 @@ +HTTP proxy provides HTTPS proxy diff --git a/examples/030/config b/examples/030/config new file mode 120000 index 0000000..dce6a43 --- /dev/null +++ b/examples/030/config @@ -0,0 +1 @@ +../013/config \ No newline at end of file diff --git a/examples/030/dictionaries/firefox/20-manual.yml b/examples/030/dictionaries/firefox/20-manual.yml new file mode 100644 index 0000000..7419635 --- /dev/null +++ b/examples/030/dictionaries/firefox/20-manual.yml @@ -0,0 +1,7 @@ +--- +manual: + + use_for_https: + description: Also use this proxy for HTTPS + type: boolean + default: true diff --git a/examples/030/firefox.png b/examples/030/firefox.png new file mode 100644 index 0000000..b7ca7aa Binary files /dev/null and b/examples/030/firefox.png differ diff --git a/examples/030/firefox.xcf b/examples/030/firefox.xcf new file mode 100644 index 0000000..77c610e Binary files /dev/null and b/examples/030/firefox.xcf differ diff --git a/examples/031/README.md b/examples/031/README.md index a2074cb..17ab1fd 100644 --- a/examples/031/README.md +++ b/examples/031/README.md @@ -1,3 +1 @@ -A variable multi - -This variable accept multiple value. +Bases type is optional if default value diff --git a/examples/031/config b/examples/031/config new file mode 120000 index 0000000..dce6a43 --- /dev/null +++ b/examples/031/config @@ -0,0 +1 @@ +../013/config \ No newline at end of file diff --git a/examples/031/dictionaries/firefox/20-manual.yml b/examples/031/dictionaries/firefox/20-manual.yml new file mode 100644 index 0000000..e9f8e81 --- /dev/null +++ b/examples/031/dictionaries/firefox/20-manual.yml @@ -0,0 +1,6 @@ +--- +manual: + + use_for_https: + description: Also use this proxy for HTTPS + default: true diff --git a/examples/032/README.md b/examples/032/README.md index d83ef1b..7d9b8be 100644 --- a/examples/032/README.md +++ b/examples/032/README.md @@ -1 +1 @@ -A non mandatory variable +Copy HTTP manual proxy to HTTPS manual proxy diff --git a/examples/032/SUBTITLE.md b/examples/032/SUBTITLE.md new file mode 100644 index 0000000..4da43d8 --- /dev/null +++ b/examples/032/SUBTITLE.md @@ -0,0 +1 @@ +Property: hidden diff --git a/examples/032/TITLE.md b/examples/032/TITLE.md new file mode 100644 index 0000000..b033e3d --- /dev/null +++ b/examples/032/TITLE.md @@ -0,0 +1 @@ +HTTPS Manual mode diff --git a/examples/032/config b/examples/032/config index 51b7987..dce6a43 120000 --- a/examples/032/config +++ b/examples/032/config @@ -1 +1 @@ -../031/config \ No newline at end of file +../013/config \ No newline at end of file diff --git a/examples/032/dictionaries/firefox/20-manual.yml b/examples/032/dictionaries/firefox/20-manual.yml new file mode 100644 index 0000000..2192056 --- /dev/null +++ b/examples/032/dictionaries/firefox/20-manual.yml @@ -0,0 +1,20 @@ +--- +manual: + + use_for_https: + description: Also use this proxy for HTTPS + default: true + + https_proxy: + description: HTTPS Proxy + + address: + description: HTTPS address + type: domainname + params: + allow_ip: true + + port: + description: HTTPS Port + type: port + default: 8080 diff --git a/examples/033/README.md b/examples/033/README.md index da36ca2..be99f7f 100644 --- a/examples/033/README.md +++ b/examples/033/README.md @@ -1,3 +1 @@ -Examples - -We can add example (only for documentation). +An hidden family diff --git a/examples/033/config b/examples/033/config index 51b7987..dce6a43 120000 --- a/examples/033/config +++ b/examples/033/config @@ -1 +1 @@ -../031/config \ No newline at end of file +../013/config \ No newline at end of file diff --git a/examples/033/dictionaries/firefox/20-manual.yml b/examples/033/dictionaries/firefox/20-manual.yml new file mode 100644 index 0000000..ec13d9a --- /dev/null +++ b/examples/033/dictionaries/firefox/20-manual.yml @@ -0,0 +1,21 @@ +--- +manual: + + use_for_https: + description: Also use this proxy for HTTPS + default: true + + https_proxy: + description: HTTPS Proxy + hidden: true + + address: + description: HTTPS address + type: domainname + params: + allow_ip: true + + port: + description: HTTPS Port + type: port + default: 8080 diff --git a/examples/034/README.md b/examples/034/README.md index a2a2030..7e740c0 100644 --- a/examples/034/README.md +++ b/examples/034/README.md @@ -1,3 +1 @@ -Help - -We can add help informations for documentation. +A conditional hidden family with a variable diff --git a/examples/034/config b/examples/034/config new file mode 120000 index 0000000..dce6a43 --- /dev/null +++ b/examples/034/config @@ -0,0 +1 @@ +../013/config \ No newline at end of file diff --git a/examples/034/dictionaries/firefox/20-manual.yml b/examples/034/dictionaries/firefox/20-manual.yml new file mode 100644 index 0000000..0540407 --- /dev/null +++ b/examples/034/dictionaries/firefox/20-manual.yml @@ -0,0 +1,22 @@ +--- +manual: + + use_for_https: + description: Also use this proxy for HTTPS + default: true + + https_proxy: + description: HTTPS Proxy + hidden: + variable: manual.use_for_https + + address: + description: HTTPS address + type: domainname + params: + allow_ip: true + + port: + description: HTTPS Port + type: port + default: 8080 diff --git a/examples/035/README.md b/examples/035/README.md new file mode 100644 index 0000000..1be0e6e --- /dev/null +++ b/examples/035/README.md @@ -0,0 +1 @@ +A calculated default value diff --git a/examples/035/SUBTITLE.md b/examples/035/SUBTITLE.md new file mode 100644 index 0000000..9f51301 --- /dev/null +++ b/examples/035/SUBTITLE.md @@ -0,0 +1 @@ +Variable: calculated default value diff --git a/examples/035/config b/examples/035/config new file mode 120000 index 0000000..dce6a43 --- /dev/null +++ b/examples/035/config @@ -0,0 +1 @@ +../013/config \ No newline at end of file diff --git a/examples/035/dictionaries/firefox/20-manual.yml b/examples/035/dictionaries/firefox/20-manual.yml new file mode 100644 index 0000000..6c2507e --- /dev/null +++ b/examples/035/dictionaries/firefox/20-manual.yml @@ -0,0 +1,25 @@ +--- +manual: + + use_for_https: + description: Also use this proxy for HTTPS + default: true + + https_proxy: + description: HTTPS Proxy + hidden: + variable: manual.use_for_https + + address: + description: HTTPS address + type: domainname + params: + allow_ip: true + default: + variable: manual.http_proxy.address + + port: + description: HTTPS Port + type: port + default: + variable: manual.http_proxy.port diff --git a/examples/036/README.md b/examples/036/README.md new file mode 100644 index 0000000..26a03cf --- /dev/null +++ b/examples/036/README.md @@ -0,0 +1 @@ +Variable type and parameters type are copied with default value diff --git a/examples/018/config b/examples/036/config similarity index 100% rename from examples/018/config rename to examples/036/config diff --git a/examples/036/dictionaries/firefox/20-manual.yml b/examples/036/dictionaries/firefox/20-manual.yml new file mode 100644 index 0000000..0a73db6 --- /dev/null +++ b/examples/036/dictionaries/firefox/20-manual.yml @@ -0,0 +1,21 @@ +--- +manual: + + use_for_https: + description: Also use this proxy for HTTPS + default: true + + https_proxy: + description: HTTPS Proxy + hidden: + variable: manual.use_for_https + + address: + description: HTTPS address + default: + variable: manual.http_proxy.address + + port: + description: HTTPS Port + default: + variable: manual.http_proxy.port diff --git a/examples/040/README.md b/examples/040/README.md index c19e709..e245b81 100644 --- a/examples/040/README.md +++ b/examples/040/README.md @@ -1 +1 @@ -A variable in avanced mode +Family: a dynamic family diff --git a/examples/040/SUBTITLE.md b/examples/040/SUBTITLE.md new file mode 100644 index 0000000..9ec8d33 --- /dev/null +++ b/examples/040/SUBTITLE.md @@ -0,0 +1 @@ +Family: dynamic diff --git a/examples/040/TITLE.md b/examples/040/TITLE.md new file mode 100644 index 0000000..c9a10b1 --- /dev/null +++ b/examples/040/TITLE.md @@ -0,0 +1 @@ +SOCKS Manual mode diff --git a/examples/019/config b/examples/040/config similarity index 100% rename from examples/019/config rename to examples/040/config diff --git a/examples/040/dictionaries/firefox/20-manual.yml b/examples/040/dictionaries/firefox/20-manual.yml new file mode 100644 index 0000000..d0947b2 --- /dev/null +++ b/examples/040/dictionaries/firefox/20-manual.yml @@ -0,0 +1,24 @@ +--- +manual: + + use_for_https: + description: Also use this proxy for HTTPS + default: true + + "{{ identifier }}_proxy": + description: "{{ identifier }} Proxy" + dynamic: + - HTTPS + - SOCKS + hidden: + variable: manual.use_for_https + + address: + description: "{{ identifier }} address" + default: + variable: manual.http_proxy.address + + port: + description: "{{ identifier }} port" + default: + variable: manual.http_proxy.port diff --git a/examples/040/dictionaries/firefox/40-prompt_authentication.yml b/examples/040/dictionaries/firefox/40-prompt_authentication.yml deleted file mode 100644 index 494578d..0000000 --- a/examples/040/dictionaries/firefox/40-prompt_authentication.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -prompt_authentication: - description: Prompt for authentication if password is saved - default: true - disabled: - type: jinja - jinja: | - {% if _.proxy_mode == 'No proxy' %} - proxy mode is no proxy - {% endif %} - description: if "firefox.proxy_mode" is "No proxy" diff --git a/examples/040/dictionaries/firefox/50-proxy_dns_socks5.yml b/examples/040/dictionaries/firefox/50-proxy_dns_socks5.yml deleted file mode 100644 index 5b5d92b..0000000 --- a/examples/040/dictionaries/firefox/50-proxy_dns_socks5.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -proxy_dns_socks5: - description: Use proxy DNS when using SOCKS v5 - default: false - mode: advanced - disabled: - type: jinja - jinja: | - {% if _.proxy_mode != 'Manual proxy configuration' %} - the proxy mode is not manual - {% elif socks_version == 'v4' %} - socks version is v4 - {% endif %} - params: - socks_version: - type: variable - variable: _.manual.socks_proxy.version - propertyerror: false - description: | - if "firefox.proxy_mode" is not "Manual proxy configuration" or "firefox.manual.socks_proxy.version" is "v4" diff --git a/examples/041/README.md b/examples/041/README.md new file mode 100644 index 0000000..3a47ef4 --- /dev/null +++ b/examples/041/README.md @@ -0,0 +1 @@ +A conditional hidden family with Jinja diff --git a/examples/041/SUBTITLE.md b/examples/041/SUBTITLE.md new file mode 100644 index 0000000..f479e14 --- /dev/null +++ b/examples/041/SUBTITLE.md @@ -0,0 +1 @@ +Property: Jinja and identifier condition diff --git a/examples/041/config b/examples/041/config new file mode 120000 index 0000000..3bac45d --- /dev/null +++ b/examples/041/config @@ -0,0 +1 @@ +../018/config \ No newline at end of file diff --git a/examples/041/dictionaries/firefox/20-manual.yml b/examples/041/dictionaries/firefox/20-manual.yml new file mode 100644 index 0000000..416ac75 --- /dev/null +++ b/examples/041/dictionaries/firefox/20-manual.yml @@ -0,0 +1,27 @@ +--- +manual: + + use_for_https: + description: Also use this proxy for HTTPS + default: true + + "{{ identifier }}_proxy": + description: "{{ identifier }} Proxy" + dynamic: + - HTTPS + - SOCKS + hidden: + jinja: | + {% if manual.use_for_https %} + HTTPS is same has HTTP + {% endif %} + + address: + description: "{{ identifier }} address" + default: + variable: manual.http_proxy.address + + port: + description: "{{ identifier }} port" + default: + variable: manual.http_proxy.port diff --git a/examples/042/README.md b/examples/042/README.md new file mode 100644 index 0000000..4c236df --- /dev/null +++ b/examples/042/README.md @@ -0,0 +1 @@ +Jinja with a parameter diff --git a/examples/042/config b/examples/042/config new file mode 120000 index 0000000..3bac45d --- /dev/null +++ b/examples/042/config @@ -0,0 +1 @@ +../018/config \ No newline at end of file diff --git a/examples/042/dictionaries/firefox/20-manual.yml b/examples/042/dictionaries/firefox/20-manual.yml new file mode 100644 index 0000000..5d2ae21 --- /dev/null +++ b/examples/042/dictionaries/firefox/20-manual.yml @@ -0,0 +1,30 @@ +--- +manual: + + use_for_https: + description: Also use this proxy for HTTPS + default: true + + "{{ identifier }}_proxy": + description: "{{ identifier }} Proxy" + dynamic: + - HTTPS + - SOCKS + hidden: + jinja: | + {% if my_identifier == 'HTTPS' and manual.use_for_https %} + HTTPS is same has HTTP + {% endif %} + params: + my_identifier: + type: identifier + + address: + description: "{{ identifier }} address" + default: + variable: manual.http_proxy.address + + port: + description: "{{ identifier }} port" + default: + variable: manual.http_proxy.port diff --git a/examples/043/README.md b/examples/043/README.md new file mode 100644 index 0000000..3723340 --- /dev/null +++ b/examples/043/README.md @@ -0,0 +1 @@ +Jinja with a description diff --git a/examples/043/config b/examples/043/config new file mode 120000 index 0000000..3bac45d --- /dev/null +++ b/examples/043/config @@ -0,0 +1 @@ +../018/config \ No newline at end of file diff --git a/examples/043/dictionaries/firefox/20-manual.yml b/examples/043/dictionaries/firefox/20-manual.yml new file mode 100644 index 0000000..26c6d09 --- /dev/null +++ b/examples/043/dictionaries/firefox/20-manual.yml @@ -0,0 +1,32 @@ +--- +manual: + + use_for_https: + description: Also use this proxy for HTTPS + default: true + + "{{ identifier }}_proxy": + description: "{{ identifier }} Proxy" + dynamic: + - HTTPS + - SOCKS + hidden: + jinja: | + {% if my_identifier == 'HTTPS' and manual.use_for_https %} + HTTPS is same has HTTP + {% endif %} + params: + my_identifier: + type: identifier + description: | + in HTTPS case if "manual.use_for_https" is set to True + + address: + description: "{{ identifier }} address" + default: + variable: manual.http_proxy.address + + port: + description: "{{ identifier }} port" + default: + variable: manual.http_proxy.port diff --git a/examples/044/README.md b/examples/044/README.md new file mode 100644 index 0000000..4326a26 --- /dev/null +++ b/examples/044/README.md @@ -0,0 +1 @@ +A conditional disabled variable with identifier diff --git a/examples/044/config b/examples/044/config new file mode 120000 index 0000000..3bac45d --- /dev/null +++ b/examples/044/config @@ -0,0 +1 @@ +../018/config \ No newline at end of file diff --git a/examples/044/dictionaries/firefox/20-manual.yml b/examples/044/dictionaries/firefox/20-manual.yml new file mode 100644 index 0000000..7ea057b --- /dev/null +++ b/examples/044/dictionaries/firefox/20-manual.yml @@ -0,0 +1,42 @@ +--- +manual: + + use_for_https: + description: Also use this proxy for HTTPS + default: true + + "{{ identifier }}_proxy": + description: "{{ identifier }} Proxy" + dynamic: + - HTTPS + - SOCKS + hidden: + jinja: | + {% if my_identifier == 'HTTPS' and manual.use_for_https %} + HTTPS is same has HTTP + {% endif %} + params: + my_identifier: + type: identifier + description: | + in HTTPS case if "manual.use_for_https" is set to True + + address: + description: "{{ identifier }} address" + default: + variable: manual.http_proxy.address + + port: + description: "{{ identifier }} port" + default: + variable: manual.http_proxy.port + + version: + description: SOCKS host version used by proxy + choices: + - v4 + - v5 + default: v5 + disabled: + type: identifier + when: 'HTTPS' diff --git a/examples/050/README.md b/examples/050/README.md new file mode 100644 index 0000000..eaa8f87 --- /dev/null +++ b/examples/050/README.md @@ -0,0 +1 @@ +Family: "shorthand" mode diff --git a/examples/050/TITLE.md b/examples/050/TITLE.md new file mode 100644 index 0000000..8775c7e --- /dev/null +++ b/examples/050/TITLE.md @@ -0,0 +1 @@ +Shorthand mode diff --git a/examples/050/config b/examples/050/config new file mode 120000 index 0000000..160a2a6 --- /dev/null +++ b/examples/050/config @@ -0,0 +1 @@ +../010/config \ No newline at end of file diff --git a/examples/016/dictionaries/firefox/10-manual.yml b/examples/050/dictionaries/firefox/10-manual.yml similarity index 75% rename from examples/016/dictionaries/firefox/10-manual.yml rename to examples/050/dictionaries/firefox/10-manual.yml index 3277b12..b9b95dd 100644 --- a/examples/016/dictionaries/firefox/10-manual.yml +++ b/examples/050/dictionaries/firefox/10-manual.yml @@ -2,8 +2,7 @@ manual: description: Manual proxy configuration disabled: - type: variable - variable: _.proxy_mode + variable: proxy_mode when_not: 'Manual proxy configuration' http_proxy: # HTTP Proxy @@ -18,5 +17,3 @@ manual: description: HTTP Port type: port default: 8080 - - use_for_https: true # Also use this proxy for HTTPS diff --git a/examples/051/README.md b/examples/051/README.md new file mode 100644 index 0000000..7441d43 --- /dev/null +++ b/examples/051/README.md @@ -0,0 +1 @@ +Variable: "shorthand" mode diff --git a/examples/051/config b/examples/051/config new file mode 120000 index 0000000..dce6a43 --- /dev/null +++ b/examples/051/config @@ -0,0 +1 @@ +../013/config \ No newline at end of file diff --git a/examples/051/dictionaries/firefox/20-manual.yml b/examples/051/dictionaries/firefox/20-manual.yml new file mode 100644 index 0000000..53fb550 --- /dev/null +++ b/examples/051/dictionaries/firefox/20-manual.yml @@ -0,0 +1,40 @@ +--- +manual: + + use_for_https: true # Also use this proxy for HTTPS + + "{{ identifier }}_proxy": + description: "{{ identifier }} Proxy" + dynamic: + - HTTPS + - SOCKS + hidden: + jinja: | + {% if my_identifier == 'HTTPS' and manual.use_for_https %} + HTTPS is same has HTTP + {% endif %} + params: + my_identifier: + type: identifier + description: | + in HTTPS case if "manual.use_for_https" is set to True + + address: + description: "{{ identifier }} address" + default: + variable: manual.http_proxy.address + + port: + description: "{{ identifier }} port" + default: + variable: manual.http_proxy.port + + version: + description: SOCKS host version used by proxy + choices: + - v4 + - v5 + default: v5 + disabled: + type: identifier + when: 'HTTPS' diff --git a/examples/060/README.md b/examples/060/README.md index 4207bc8..3306546 100644 --- a/examples/060/README.md +++ b/examples/060/README.md @@ -1 +1 @@ -A boolean variable +A variable with type "web_address" diff --git a/examples/060/TITLE.md b/examples/060/TITLE.md new file mode 100644 index 0000000..f8448e5 --- /dev/null +++ b/examples/060/TITLE.md @@ -0,0 +1 @@ +Automatic proxy diff --git a/examples/060/config/01/README.md b/examples/060/config/01/README.md new file mode 100644 index 0000000..2e2d78a --- /dev/null +++ b/examples/060/config/01/README.md @@ -0,0 +1 @@ +We cannot configure "auto" if "proxy_mode" is not "Automatic proxy configuration URL". diff --git a/examples/060/config/01/config.yaml b/examples/060/config/01/config.yaml index ed97d53..1edbe91 100644 --- a/examples/060/config/01/config.yaml +++ b/examples/060/config/01/config.yaml @@ -1 +1,2 @@ --- +auto: https://auto.proxy.net/wpad.dat diff --git a/examples/020/config/01/config.yaml b/examples/060/config/02/config.yaml similarity index 100% rename from examples/020/config/01/config.yaml rename to examples/060/config/02/config.yaml diff --git a/examples/020/config/02/config.yaml b/examples/060/config/03/config.yaml similarity index 100% rename from examples/020/config/02/config.yaml rename to examples/060/config/03/config.yaml diff --git a/examples/060/dictionaries/firefox/30-auto.yml b/examples/060/dictionaries/firefox/30-auto.yml new file mode 100644 index 0000000..e31729a --- /dev/null +++ b/examples/060/dictionaries/firefox/30-auto.yml @@ -0,0 +1,4 @@ +--- +auto: + description: Automatic proxy configuration URL + type: web_address diff --git a/examples/060/firefox.png b/examples/060/firefox.png index d368003..20701e2 100644 Binary files a/examples/060/firefox.png and b/examples/060/firefox.png differ diff --git a/examples/060/firefox.xcf b/examples/060/firefox.xcf index c362607..89c7f4b 100644 Binary files a/examples/060/firefox.xcf and b/examples/060/firefox.xcf differ diff --git a/examples/061/README.md b/examples/061/README.md index 9215d09..7c3c2fe 100644 --- a/examples/061/README.md +++ b/examples/061/README.md @@ -1 +1 @@ -A choice variable +A conditional disabled variable diff --git a/examples/061/config/01/README.md b/examples/061/config/01/README.md new file mode 100644 index 0000000..2e2d78a --- /dev/null +++ b/examples/061/config/01/README.md @@ -0,0 +1 @@ +We cannot configure "auto" if "proxy_mode" is not "Automatic proxy configuration URL". diff --git a/examples/061/config/01/config.yaml b/examples/061/config/01/config.yaml index ed97d53..1edbe91 100644 --- a/examples/061/config/01/config.yaml +++ b/examples/061/config/01/config.yaml @@ -1 +1,2 @@ --- +auto: https://auto.proxy.net/wpad.dat diff --git a/examples/061/config/02/config.yaml b/examples/061/config/02/config.yaml index aee4796..26df130 100644 --- a/examples/061/config/02/config.yaml +++ b/examples/061/config/02/config.yaml @@ -1,3 +1,2 @@ --- -dns_over_https: - enable_dns_over_https: true +proxy_mode: Automatic proxy configuration URL diff --git a/examples/031/config/03/config.yaml b/examples/061/config/03/config.yaml similarity index 100% rename from examples/031/config/03/config.yaml rename to examples/061/config/03/config.yaml diff --git a/examples/061/dictionaries/firefox/30-auto.yml b/examples/061/dictionaries/firefox/30-auto.yml new file mode 100644 index 0000000..130fae0 --- /dev/null +++ b/examples/061/dictionaries/firefox/30-auto.yml @@ -0,0 +1,7 @@ +--- +auto: + description: Automatic proxy configuration URL + type: web_address + disabled: + variable: proxy_mode + when_not: Automatic proxy configuration URL diff --git a/examples/062/dictionaries/firefox/60-dns_over_https.yml b/examples/062/dictionaries/firefox/60-dns_over_https.yml deleted file mode 100644 index de0e11a..0000000 --- a/examples/062/dictionaries/firefox/60-dns_over_https.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -dns_over_https: # DNS over HTTPS - - enable_dns_over_https: false # Enable DNS over HTTPS - - provider: - description: Use Provider - choices: - - Cloudflare - - NextDNS - - Custom - default: Cloudflare - disabled: - type: jinja - jinja: | - {% if not _.enable_dns_over_https %} - Enable DNS over HTTPS is False - {% endif %} - description: | - if "firefox.dns_over_https.enable_dns_over_https" is not False - - custom_dns_url: - description: Custom DNS URL - type: web_address - disabled: - type: jinja - jinja: | - {% if provider is not defined or provider != 'Custom' %} - provider is not custom - {% endif %} - params: - provider: - type: variable - variable: _.provider - propertyerror: false - description: if "firefox.dns_over_https.provider" is not "Custom" - validators: - - type: jinja - jinja: | - {% if _.custom_dns_url.startswith('http://') %} - only https is allowed - {% endif %} - description: must starts with 'https://' only diff --git a/examples/070/README.md b/examples/070/README.md new file mode 100644 index 0000000..057f856 --- /dev/null +++ b/examples/070/README.md @@ -0,0 +1 @@ +A variable with type "domainname", parameters type and disabled diff --git a/examples/070/SUBTITLE.md b/examples/070/SUBTITLE.md new file mode 100644 index 0000000..8a9df99 --- /dev/null +++ b/examples/070/SUBTITLE.md @@ -0,0 +1 @@ +Variable: multi and non mandatory diff --git a/examples/070/TITLE.md b/examples/070/TITLE.md new file mode 100644 index 0000000..90ad7d2 --- /dev/null +++ b/examples/070/TITLE.md @@ -0,0 +1 @@ +Address for which proxy will be desactivated diff --git a/examples/031/config/01/config.yaml b/examples/070/config/01/config.yaml similarity index 100% rename from examples/031/config/01/config.yaml rename to examples/070/config/01/config.yaml diff --git a/examples/030/config/02/config.yaml b/examples/070/config/02/config.yaml similarity index 100% rename from examples/030/config/02/config.yaml rename to examples/070/config/02/config.yaml diff --git a/examples/030/dictionaries/firefox/30-no_proxy.yml b/examples/070/dictionaries/firefox/40-no_proxy.yml similarity index 56% rename from examples/030/dictionaries/firefox/30-no_proxy.yml rename to examples/070/dictionaries/firefox/40-no_proxy.yml index 16f160b..b166d7d 100644 --- a/examples/030/dictionaries/firefox/30-no_proxy.yml +++ b/examples/070/dictionaries/firefox/40-no_proxy.yml @@ -8,9 +8,5 @@ no_proxy: allow_without_dot: true allow_startswith_dot: true disabled: - type: jinja - jinja: | - {% if _.proxy_mode == 'No proxy' %} - proxy mode is no proxy - {% endif %} - description: if "firefox.proxy_mode" is "No proxy" + variable: proxy_mode + when: No proxy diff --git a/examples/070/firefox.png b/examples/070/firefox.png new file mode 100644 index 0000000..16f5931 Binary files /dev/null and b/examples/070/firefox.png differ diff --git a/examples/070/firefox.xcf b/examples/070/firefox.xcf new file mode 100644 index 0000000..5cc54d7 Binary files /dev/null and b/examples/070/firefox.xcf differ diff --git a/examples/071/README.md b/examples/071/README.md new file mode 100644 index 0000000..130d225 --- /dev/null +++ b/examples/071/README.md @@ -0,0 +1 @@ +A variable with multiple value diff --git a/examples/034/config/01/config.yaml b/examples/071/config/01/config.yaml similarity index 100% rename from examples/034/config/01/config.yaml rename to examples/071/config/01/config.yaml diff --git a/examples/031/config/02/config.yaml b/examples/071/config/02/config.yaml similarity index 100% rename from examples/031/config/02/config.yaml rename to examples/071/config/02/config.yaml diff --git a/examples/034/config/02/config.yaml b/examples/071/config/03/config.yaml similarity index 100% rename from examples/034/config/02/config.yaml rename to examples/071/config/03/config.yaml diff --git a/examples/031/dictionaries/firefox/30-no_proxy.yml b/examples/071/dictionaries/firefox/40-no_proxy.yml similarity index 57% rename from examples/031/dictionaries/firefox/30-no_proxy.yml rename to examples/071/dictionaries/firefox/40-no_proxy.yml index 066b55d..ccc5689 100644 --- a/examples/031/dictionaries/firefox/30-no_proxy.yml +++ b/examples/071/dictionaries/firefox/40-no_proxy.yml @@ -2,16 +2,12 @@ no_proxy: description: Address for which proxy will be desactivated type: "domainname" - multi: true params: allow_ip: true allow_cidr_network: true allow_without_dot: true allow_startswith_dot: true + multi: true disabled: - type: jinja - jinja: | - {% if _.proxy_mode == 'No proxy' %} - proxy mode is no proxy - {% endif %} - description: if "firefox.proxy_mode" is "No proxy" + variable: proxy_mode + when: No proxy diff --git a/examples/072/README.md b/examples/072/README.md new file mode 100644 index 0000000..d83ef1b --- /dev/null +++ b/examples/072/README.md @@ -0,0 +1 @@ +A non mandatory variable diff --git a/examples/072/config b/examples/072/config new file mode 120000 index 0000000..51b7987 --- /dev/null +++ b/examples/072/config @@ -0,0 +1 @@ +../031/config \ No newline at end of file diff --git a/examples/032/dictionaries/firefox/30-no_proxy.yml b/examples/072/dictionaries/firefox/40-no_proxy.yml similarity index 59% rename from examples/032/dictionaries/firefox/30-no_proxy.yml rename to examples/072/dictionaries/firefox/40-no_proxy.yml index f8a68ab..c03b793 100644 --- a/examples/032/dictionaries/firefox/30-no_proxy.yml +++ b/examples/072/dictionaries/firefox/40-no_proxy.yml @@ -10,9 +10,5 @@ no_proxy: multi: true mandatory: false disabled: - type: jinja - jinja: | - {% if _.proxy_mode == 'No proxy' %} - proxy mode is no proxy - {% endif %} - description: if "firefox.proxy_mode" is "No proxy" + variable: proxy_mode + when: No proxy diff --git a/examples/073/README.md b/examples/073/README.md new file mode 100644 index 0000000..ad6b7fb --- /dev/null +++ b/examples/073/README.md @@ -0,0 +1 @@ +Examples diff --git a/examples/073/SUBTITLE.md b/examples/073/SUBTITLE.md new file mode 100644 index 0000000..5edfb9c --- /dev/null +++ b/examples/073/SUBTITLE.md @@ -0,0 +1 @@ +Variable: extra description diff --git a/examples/073/config b/examples/073/config new file mode 120000 index 0000000..51b7987 --- /dev/null +++ b/examples/073/config @@ -0,0 +1 @@ +../031/config \ No newline at end of file diff --git a/examples/033/dictionaries/firefox/30-no_proxy.yml b/examples/073/dictionaries/firefox/40-no_proxy.yml similarity index 63% rename from examples/033/dictionaries/firefox/30-no_proxy.yml rename to examples/073/dictionaries/firefox/40-no_proxy.yml index 788a1a1..477521d 100644 --- a/examples/033/dictionaries/firefox/30-no_proxy.yml +++ b/examples/073/dictionaries/firefox/40-no_proxy.yml @@ -10,13 +10,9 @@ no_proxy: multi: true mandatory: false disabled: - type: jinja - jinja: | - {% if _.proxy_mode == 'No proxy' %} - proxy mode is no proxy - {% endif %} - description: if "firefox.proxy_mode" is "No proxy" - test: + variable: proxy_mode + when: No proxy + examples: - .mozilla.org - .net.nz - 192.168.1.0/24 diff --git a/examples/074/README.md b/examples/074/README.md new file mode 100644 index 0000000..f7e3770 --- /dev/null +++ b/examples/074/README.md @@ -0,0 +1 @@ +Help diff --git a/examples/040/config/01/config.yaml b/examples/074/config/01/config.yaml similarity index 100% rename from examples/040/config/01/config.yaml rename to examples/074/config/01/config.yaml diff --git a/examples/074/config/02/config.yaml b/examples/074/config/02/config.yaml new file mode 100644 index 0000000..307e175 --- /dev/null +++ b/examples/074/config/02/config.yaml @@ -0,0 +1,3 @@ +--- +proxy_mode: Automatic proxy configuration URL +auto: https://auto.proxy.net/wpad.dat diff --git a/examples/034/config/03/config.yaml b/examples/074/config/03/config.yaml similarity index 100% rename from examples/034/config/03/config.yaml rename to examples/074/config/03/config.yaml diff --git a/examples/034/dictionaries/firefox/30-no_proxy.yml b/examples/074/dictionaries/firefox/40-no_proxy.yml similarity index 67% rename from examples/034/dictionaries/firefox/30-no_proxy.yml rename to examples/074/dictionaries/firefox/40-no_proxy.yml index b44565e..bcb05be 100644 --- a/examples/034/dictionaries/firefox/30-no_proxy.yml +++ b/examples/074/dictionaries/firefox/40-no_proxy.yml @@ -10,13 +10,9 @@ no_proxy: multi: true mandatory: false disabled: - type: jinja - jinja: | - {% if _.proxy_mode == 'No proxy' %} - proxy mode is no proxy - {% endif %} - description: if "firefox.proxy_mode" is "No proxy" - test: + variable: proxy_mode + when: No proxy + examples: - .mozilla.org - .net.nz - 192.168.1.0/24 diff --git a/examples/075/README.md b/examples/075/README.md new file mode 100644 index 0000000..d2a15d5 --- /dev/null +++ b/examples/075/README.md @@ -0,0 +1 @@ +A variable diff --git a/examples/075/TITLE.md b/examples/075/TITLE.md new file mode 100644 index 0000000..78cfd01 --- /dev/null +++ b/examples/075/TITLE.md @@ -0,0 +1 @@ +Prompt for authentication if password is saved diff --git a/examples/062/config/01/config.yaml b/examples/075/config/01/config.yaml similarity index 100% rename from examples/062/config/01/config.yaml rename to examples/075/config/01/config.yaml diff --git a/examples/017/config/01/config.yaml b/examples/075/config/02/config.yaml similarity index 100% rename from examples/017/config/01/config.yaml rename to examples/075/config/02/config.yaml diff --git a/examples/040/config/03/config.yaml b/examples/075/config/03/config.yaml similarity index 100% rename from examples/040/config/03/config.yaml rename to examples/075/config/03/config.yaml diff --git a/examples/040/config/04/config.yaml b/examples/075/config/04/config.yaml similarity index 100% rename from examples/040/config/04/config.yaml rename to examples/075/config/04/config.yaml diff --git a/examples/075/dictionaries/firefox/50-prompt_authentication.yml b/examples/075/dictionaries/firefox/50-prompt_authentication.yml new file mode 100644 index 0000000..3ea393c --- /dev/null +++ b/examples/075/dictionaries/firefox/50-prompt_authentication.yml @@ -0,0 +1,7 @@ +--- +prompt_authentication: + description: Prompt for authentication if password is saved + default: true + disabled: + variable: proxy_mode + when: No proxy diff --git a/examples/040/firefox.png b/examples/075/firefox.png similarity index 100% rename from examples/040/firefox.png rename to examples/075/firefox.png diff --git a/examples/040/firefox.xcf b/examples/075/firefox.xcf similarity index 100% rename from examples/040/firefox.xcf rename to examples/075/firefox.xcf diff --git a/examples/076/README.md b/examples/076/README.md new file mode 100644 index 0000000..d2a15d5 --- /dev/null +++ b/examples/076/README.md @@ -0,0 +1 @@ +A variable diff --git a/examples/076/TITLE.md b/examples/076/TITLE.md new file mode 100644 index 0000000..1776034 --- /dev/null +++ b/examples/076/TITLE.md @@ -0,0 +1 @@ +Use proxy DNS when using SOCKS v5 diff --git a/examples/101/config/01/config.yaml b/examples/076/config/01/config.yaml similarity index 100% rename from examples/101/config/01/config.yaml rename to examples/076/config/01/config.yaml diff --git a/examples/040/config/02/config.yaml b/examples/076/config/02/config.yaml similarity index 100% rename from examples/040/config/02/config.yaml rename to examples/076/config/02/config.yaml diff --git a/examples/076/config/03/config.yaml b/examples/076/config/03/config.yaml new file mode 100644 index 0000000..d04e72c --- /dev/null +++ b/examples/076/config/03/config.yaml @@ -0,0 +1,6 @@ +--- +proxy_mode: Manual proxy configuration +manual: + http_proxy: + address: http.proxy.net +proxy_dns_socks5: true diff --git a/examples/076/config/04/config.yaml b/examples/076/config/04/config.yaml new file mode 100644 index 0000000..8ceca7b --- /dev/null +++ b/examples/076/config/04/config.yaml @@ -0,0 +1,7 @@ +--- +proxy_mode: Manual proxy configuration +manual: + http_proxy: + address: http.proxy.net + socks_proxy: + version: v4 diff --git a/examples/076/dictionaries/firefox/55-proxy_dns_socks5.yml b/examples/076/dictionaries/firefox/55-proxy_dns_socks5.yml new file mode 100644 index 0000000..c228dd4 --- /dev/null +++ b/examples/076/dictionaries/firefox/55-proxy_dns_socks5.yml @@ -0,0 +1,4 @@ +--- +proxy_dns_socks5: + description: Use proxy DNS when using SOCKS v5 + default: false diff --git a/examples/077/README.md b/examples/077/README.md new file mode 100644 index 0000000..89e0450 --- /dev/null +++ b/examples/077/README.md @@ -0,0 +1 @@ +Jinja calculation for an hidden variable with a potential inaccessible varible diff --git a/examples/102/config/01/config.yaml b/examples/077/config/01/config.yaml similarity index 100% rename from examples/102/config/01/config.yaml rename to examples/077/config/01/config.yaml diff --git a/examples/077/config/02/config.yaml b/examples/077/config/02/config.yaml new file mode 100644 index 0000000..135d8b3 --- /dev/null +++ b/examples/077/config/02/config.yaml @@ -0,0 +1,5 @@ +--- +proxy_mode: Manual proxy configuration +manual: + http_proxy: + address: http.proxy.net diff --git a/examples/077/config/03/config.yaml b/examples/077/config/03/config.yaml new file mode 100644 index 0000000..d04e72c --- /dev/null +++ b/examples/077/config/03/config.yaml @@ -0,0 +1,6 @@ +--- +proxy_mode: Manual proxy configuration +manual: + http_proxy: + address: http.proxy.net +proxy_dns_socks5: true diff --git a/examples/077/config/04/config.yaml b/examples/077/config/04/config.yaml new file mode 100644 index 0000000..8ceca7b --- /dev/null +++ b/examples/077/config/04/config.yaml @@ -0,0 +1,7 @@ +--- +proxy_mode: Manual proxy configuration +manual: + http_proxy: + address: http.proxy.net + socks_proxy: + version: v4 diff --git a/examples/077/dictionaries/firefox/55-proxy_dns_socks5.yml b/examples/077/dictionaries/firefox/55-proxy_dns_socks5.yml new file mode 100644 index 0000000..a52a95e --- /dev/null +++ b/examples/077/dictionaries/firefox/55-proxy_dns_socks5.yml @@ -0,0 +1,14 @@ +--- +proxy_dns_socks5: + description: Use proxy DNS when using SOCKS v5 + default: false + disabled: + jinja: | + {% if manual.socks_proxy.version is propertyerror %} + the proxy mode is not manual + {% elif manual.socks_proxy.version == 'v4' %} + socks version is v4 + {% endif %} + description: | + if "firefox.proxy_mode" is not "Manual proxy configuration" + or "firefox.manual.socks_proxy.version" is "v4" diff --git a/examples/078/README.md b/examples/078/README.md new file mode 100644 index 0000000..c19e709 --- /dev/null +++ b/examples/078/README.md @@ -0,0 +1 @@ +A variable in avanced mode diff --git a/examples/103/config/01/config.yaml b/examples/078/config/01/config.yaml similarity index 100% rename from examples/103/config/01/config.yaml rename to examples/078/config/01/config.yaml diff --git a/examples/078/config/02/config.yaml b/examples/078/config/02/config.yaml new file mode 100644 index 0000000..135d8b3 --- /dev/null +++ b/examples/078/config/02/config.yaml @@ -0,0 +1,5 @@ +--- +proxy_mode: Manual proxy configuration +manual: + http_proxy: + address: http.proxy.net diff --git a/examples/078/config/03/config.yaml b/examples/078/config/03/config.yaml new file mode 100644 index 0000000..d04e72c --- /dev/null +++ b/examples/078/config/03/config.yaml @@ -0,0 +1,6 @@ +--- +proxy_mode: Manual proxy configuration +manual: + http_proxy: + address: http.proxy.net +proxy_dns_socks5: true diff --git a/examples/078/config/04/config.yaml b/examples/078/config/04/config.yaml new file mode 100644 index 0000000..8ceca7b --- /dev/null +++ b/examples/078/config/04/config.yaml @@ -0,0 +1,7 @@ +--- +proxy_mode: Manual proxy configuration +manual: + http_proxy: + address: http.proxy.net + socks_proxy: + version: v4 diff --git a/examples/078/config/mode b/examples/078/config/mode new file mode 100644 index 0000000..e69de29 diff --git a/examples/078/dictionaries/firefox/55-proxy_dns_socks5.yml b/examples/078/dictionaries/firefox/55-proxy_dns_socks5.yml new file mode 100644 index 0000000..469c654 --- /dev/null +++ b/examples/078/dictionaries/firefox/55-proxy_dns_socks5.yml @@ -0,0 +1,15 @@ +--- +proxy_dns_socks5: + description: Use proxy DNS when using SOCKS v5 + default: false + mode: advanced + disabled: + jinja: | + {% if manual.socks_proxy.version is propertyerror %} + the proxy mode is not manual + {% elif manual.socks_proxy.version == 'v4' %} + socks version is v4 + {% endif %} + description: | + if "firefox.proxy_mode" is not "Manual proxy configuration" + or "firefox.manual.socks_proxy.version" is "v4" diff --git a/examples/080/README.md b/examples/080/README.md new file mode 100644 index 0000000..4207bc8 --- /dev/null +++ b/examples/080/README.md @@ -0,0 +1 @@ +A boolean variable diff --git a/examples/080/TITLE.md b/examples/080/TITLE.md new file mode 100644 index 0000000..fc1521c --- /dev/null +++ b/examples/080/TITLE.md @@ -0,0 +1 @@ +DNS over HTTPS diff --git a/examples/080/config/01/config.yaml b/examples/080/config/01/config.yaml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/examples/080/config/01/config.yaml @@ -0,0 +1 @@ +--- diff --git a/examples/060/dictionaries/firefox/60-dns_over_https.yml b/examples/080/dictionaries/firefox/60-dns_over_https.yml similarity index 100% rename from examples/060/dictionaries/firefox/60-dns_over_https.yml rename to examples/080/dictionaries/firefox/60-dns_over_https.yml diff --git a/examples/080/firefox.png b/examples/080/firefox.png new file mode 100644 index 0000000..d368003 Binary files /dev/null and b/examples/080/firefox.png differ diff --git a/examples/001/firefox.xcf b/examples/080/firefox.xcf similarity index 64% rename from examples/001/firefox.xcf rename to examples/080/firefox.xcf index 1101ae9..c362607 100644 Binary files a/examples/001/firefox.xcf and b/examples/080/firefox.xcf differ diff --git a/examples/081/README.md b/examples/081/README.md new file mode 100644 index 0000000..9215d09 --- /dev/null +++ b/examples/081/README.md @@ -0,0 +1 @@ +A choice variable diff --git a/examples/081/config/01/config.yaml b/examples/081/config/01/config.yaml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/examples/081/config/01/config.yaml @@ -0,0 +1 @@ +--- diff --git a/examples/062/config/02/config.yaml b/examples/081/config/02/config.yaml similarity index 100% rename from examples/062/config/02/config.yaml rename to examples/081/config/02/config.yaml diff --git a/examples/061/dictionaries/firefox/60-dns_over_https.yml b/examples/081/dictionaries/firefox/60-dns_over_https.yml similarity index 51% rename from examples/061/dictionaries/firefox/60-dns_over_https.yml rename to examples/081/dictionaries/firefox/60-dns_over_https.yml index 4fa7edd..c121470 100644 --- a/examples/061/dictionaries/firefox/60-dns_over_https.yml +++ b/examples/081/dictionaries/firefox/60-dns_over_https.yml @@ -11,10 +11,5 @@ dns_over_https: # DNS over HTTPS - Custom default: Cloudflare disabled: - type: jinja - jinja: | - {% if not _.enable_dns_over_https %} - Enable DNS over HTTPS is False - {% endif %} - description: | - if "firefox.dns_over_https.enable_dns_over_https" is not False + variable: dns_over_https.enable_dns_over_https + when: false diff --git a/examples/082/README.md b/examples/082/README.md new file mode 100644 index 0000000..972da98 --- /dev/null +++ b/examples/082/README.md @@ -0,0 +1 @@ +A web_address variable diff --git a/examples/082/config/01/config.yaml b/examples/082/config/01/config.yaml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/examples/082/config/01/config.yaml @@ -0,0 +1 @@ +--- diff --git a/examples/082/config/02/config.yaml b/examples/082/config/02/config.yaml new file mode 100644 index 0000000..aee4796 --- /dev/null +++ b/examples/082/config/02/config.yaml @@ -0,0 +1,3 @@ +--- +dns_over_https: + enable_dns_over_https: true diff --git a/examples/062/config/03/config.yaml b/examples/082/config/03/config.yaml similarity index 100% rename from examples/062/config/03/config.yaml rename to examples/082/config/03/config.yaml diff --git a/examples/062/config/04/config.yaml b/examples/082/config/04/config.yaml similarity index 100% rename from examples/062/config/04/config.yaml rename to examples/082/config/04/config.yaml diff --git a/examples/082/dictionaries/firefox/60-dns_over_https.yml b/examples/082/dictionaries/firefox/60-dns_over_https.yml new file mode 100644 index 0000000..cd5be39 --- /dev/null +++ b/examples/082/dictionaries/firefox/60-dns_over_https.yml @@ -0,0 +1,25 @@ +--- +dns_over_https: # DNS over HTTPS + + enable_dns_over_https: false # Enable DNS over HTTPS + + provider: + description: Use Provider + choices: + - Cloudflare + - NextDNS + - Custom + default: Cloudflare + disabled: + variable: dns_over_https.enable_dns_over_https + when: false + + custom_dns_url: + description: Custom DNS URL + type: web_address + disabled: + jinja: | + {% if dns_over_https.provider is propertyerror or dns_over_https.provider != 'Custom' %} + provider is not custom + {% endif %} + description: if "dns_over_https.provider" is not "Custom" diff --git a/examples/062/README.md b/examples/083/README.md similarity index 100% rename from examples/062/README.md rename to examples/083/README.md diff --git a/examples/083/config/01/config.yaml b/examples/083/config/01/config.yaml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/examples/083/config/01/config.yaml @@ -0,0 +1 @@ +--- diff --git a/examples/083/config/02/config.yaml b/examples/083/config/02/config.yaml new file mode 100644 index 0000000..aee4796 --- /dev/null +++ b/examples/083/config/02/config.yaml @@ -0,0 +1,3 @@ +--- +dns_over_https: + enable_dns_over_https: true diff --git a/examples/083/config/03/config.yaml b/examples/083/config/03/config.yaml new file mode 100644 index 0000000..2497fc1 --- /dev/null +++ b/examples/083/config/03/config.yaml @@ -0,0 +1,5 @@ +--- +dns_over_https: + enable_dns_over_https: true + provider: Custom + custom_dns_url: http://dns.net diff --git a/examples/083/config/04/config.yaml b/examples/083/config/04/config.yaml new file mode 100644 index 0000000..7f28b0d --- /dev/null +++ b/examples/083/config/04/config.yaml @@ -0,0 +1,5 @@ +--- +dns_over_https: + enable_dns_over_https: true + provider: Custom + custom_dns_url: https://dns.net diff --git a/examples/083/dictionaries/firefox/60-dns_over_https.yml b/examples/083/dictionaries/firefox/60-dns_over_https.yml new file mode 100644 index 0000000..0c9cc15 --- /dev/null +++ b/examples/083/dictionaries/firefox/60-dns_over_https.yml @@ -0,0 +1,31 @@ +--- +dns_over_https: # DNS over HTTPS + + enable_dns_over_https: false # Enable DNS over HTTPS + + provider: + description: Use Provider + choices: + - Cloudflare + - NextDNS + - Custom + default: Cloudflare + disabled: + variable: dns_over_https.enable_dns_over_https + when: false + + custom_dns_url: + description: Custom DNS URL + type: web_address + disabled: + jinja: | + {% if dns_over_https.provider is propertyerror or dns_over_https.provider != 'Custom' %} + provider is not custom + {% endif %} + description: if "dns_over_https.provider" is not "Custom" + validators: + - jinja: | + {% if dns_over_https.custom_dns_url.startswith('http://') %} + only https is allowed + {% endif %} + description: must starts with 'https://' only diff --git a/examples/090/README.md b/examples/090/README.md new file mode 100644 index 0000000..8025287 --- /dev/null +++ b/examples/090/README.md @@ -0,0 +1 @@ +Variable in same family diff --git a/examples/090/SUBTITLE.md b/examples/090/SUBTITLE.md new file mode 100644 index 0000000..a3fa3f8 --- /dev/null +++ b/examples/090/SUBTITLE.md @@ -0,0 +1 @@ +Relative path diff --git a/examples/090/TITLE.md b/examples/090/TITLE.md new file mode 100644 index 0000000..86ff802 --- /dev/null +++ b/examples/090/TITLE.md @@ -0,0 +1 @@ +Namespace diff --git a/examples/090/dictionaries/firefox/00-proxy.yml b/examples/090/dictionaries/firefox/00-proxy.yml new file mode 100644 index 0000000..41f5978 --- /dev/null +++ b/examples/090/dictionaries/firefox/00-proxy.yml @@ -0,0 +1,10 @@ +--- +proxy_mode: + description: Configure Proxy Access to the Internet + choices: + - No proxy + - Auto-detect proxy settings for this network + - Use system proxy settings + - Manual proxy configuration + - Automatic proxy configuration URL + default: No proxy diff --git a/examples/013/dictionaries/firefox/10-manual.yml b/examples/090/dictionaries/firefox/10-manual.yml similarity index 94% rename from examples/013/dictionaries/firefox/10-manual.yml rename to examples/090/dictionaries/firefox/10-manual.yml index ce0d428..80bcc54 100644 --- a/examples/013/dictionaries/firefox/10-manual.yml +++ b/examples/090/dictionaries/firefox/10-manual.yml @@ -2,7 +2,6 @@ manual: description: Manual proxy configuration disabled: - type: variable variable: _.proxy_mode when_not: 'Manual proxy configuration' diff --git a/examples/090/dictionaries/firefox/20-manual.yml b/examples/090/dictionaries/firefox/20-manual.yml new file mode 100644 index 0000000..63e9f4a --- /dev/null +++ b/examples/090/dictionaries/firefox/20-manual.yml @@ -0,0 +1,40 @@ +--- +manual: + + use_for_https: true # Also use this proxy for HTTPS + + "{{ identifier }}_proxy": + description: "{{ identifier }} Proxy" + dynamic: + - HTTPS + - SOCKS + hidden: + jinja: | + {% if my_identifier == 'HTTPS' and _.use_for_https %} + HTTPS is same has HTTP + {% endif %} + params: + my_identifier: + type: identifier + description: | + in HTTPS case if "manual.use_for_https" is set to True + + address: + description: "{{ identifier }} address" + default: + variable: manual.http_proxy.address + + port: + description: "{{ identifier }} port" + default: + variable: manual.http_proxy.port + + version: + description: SOCKS host version used by proxy + choices: + - v4 + - v5 + default: v5 + disabled: + type: identifier + when: 'HTTPS' diff --git a/examples/020/dictionaries/firefox/20-auto.yml b/examples/090/dictionaries/firefox/30-auto.yml similarity index 65% rename from examples/020/dictionaries/firefox/20-auto.yml rename to examples/090/dictionaries/firefox/30-auto.yml index 14e883c..0e45339 100644 --- a/examples/020/dictionaries/firefox/20-auto.yml +++ b/examples/090/dictionaries/firefox/30-auto.yml @@ -3,6 +3,5 @@ auto: description: Automatic proxy configuration URL type: web_address disabled: - type: variable variable: _.proxy_mode - when: Automatic proxy configuration URL + when_not: Automatic proxy configuration URL diff --git a/examples/090/dictionaries/firefox/40-no_proxy.yml b/examples/090/dictionaries/firefox/40-no_proxy.yml new file mode 100644 index 0000000..d6bede6 --- /dev/null +++ b/examples/090/dictionaries/firefox/40-no_proxy.yml @@ -0,0 +1,19 @@ +--- +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 + examples: + - .mozilla.org + - .net.nz + - 192.168.1.0/24 + help: Connections to localhost, 127.0.0.1/8 and ::1 are never proxied diff --git a/examples/090/dictionaries/firefox/50-prompt_authentication.yml b/examples/090/dictionaries/firefox/50-prompt_authentication.yml new file mode 100644 index 0000000..7138e22 --- /dev/null +++ b/examples/090/dictionaries/firefox/50-prompt_authentication.yml @@ -0,0 +1,7 @@ +--- +prompt_authentication: + description: Prompt for authentication if password is saved + default: true + disabled: + variable: _.proxy_mode + when: No proxy diff --git a/examples/090/dictionaries/firefox/55-proxy_dns_socks5.yml b/examples/090/dictionaries/firefox/55-proxy_dns_socks5.yml new file mode 100644 index 0000000..0427894 --- /dev/null +++ b/examples/090/dictionaries/firefox/55-proxy_dns_socks5.yml @@ -0,0 +1,15 @@ +--- +proxy_dns_socks5: + description: Use proxy DNS when using SOCKS v5 + default: false + mode: advanced + disabled: + jinja: | + {% if _.manual.socks_proxy.version is propertyerror %} + the proxy mode is not manual + {% elif _.manual.socks_proxy.version == 'v4' %} + socks version is v4 + {% endif %} + description: | + if "firefox.proxy_mode" is not "Manual proxy configuration" + or "firefox.manual.socks_proxy.version" is "v4" diff --git a/examples/090/dictionaries/firefox/60-dns_over_https.yml b/examples/090/dictionaries/firefox/60-dns_over_https.yml new file mode 100644 index 0000000..94c0ec2 --- /dev/null +++ b/examples/090/dictionaries/firefox/60-dns_over_https.yml @@ -0,0 +1,31 @@ +--- +dns_over_https: # DNS over HTTPS + + enable_dns_over_https: false # Enable DNS over HTTPS + + provider: + description: Use Provider + choices: + - Cloudflare + - NextDNS + - Custom + default: Cloudflare + disabled: + variable: _.enable_dns_over_https + when: false + + custom_dns_url: + description: Custom DNS URL + type: web_address + disabled: + jinja: | + {% if _.provider is propertyerror or _.provider != 'Custom' %} + provider is not custom + {% endif %} + description: if "dns_over_https.provider" is not "Custom" + validators: + - jinja: | + {% if dns_over_https.custom_dns_url.startswith('http://') %} + only https is allowed + {% endif %} + description: must starts with 'https://' only diff --git a/examples/091/README.md b/examples/091/README.md new file mode 100644 index 0000000..8b40475 --- /dev/null +++ b/examples/091/README.md @@ -0,0 +1 @@ +Variable in parent family diff --git a/examples/091/dictionaries/firefox/20-manual.yml b/examples/091/dictionaries/firefox/20-manual.yml new file mode 100644 index 0000000..b167f70 --- /dev/null +++ b/examples/091/dictionaries/firefox/20-manual.yml @@ -0,0 +1,40 @@ +--- +manual: + + use_for_https: true # Also use this proxy for HTTPS + + "{{ identifier }}_proxy": + description: "{{ identifier }} Proxy" + dynamic: + - HTTPS + - SOCKS + hidden: + jinja: | + {% if my_identifier == 'HTTPS' and _.use_for_https %} + HTTPS is same has HTTP + {% endif %} + params: + my_identifier: + type: identifier + description: | + in HTTPS case if "manual.use_for_https" is set to True + + address: + description: "{{ identifier }} address" + default: + variable: __.http_proxy.address + + port: + description: "{{ identifier }} port" + default: + variable: __.http_proxy.port + + version: + description: SOCKS host version used by proxy + choices: + - v4 + - v5 + default: v5 + disabled: + type: identifier + when: 'HTTPS' diff --git a/examples/092/README.md b/examples/092/README.md new file mode 100644 index 0000000..86ff802 --- /dev/null +++ b/examples/092/README.md @@ -0,0 +1 @@ +Namespace diff --git a/examples/092/dictionaries/firefox/empty b/examples/092/dictionaries/firefox/empty new file mode 100644 index 0000000..e69de29 diff --git a/examples/092/dictionaries/firefox/empty.yml b/examples/092/dictionaries/firefox/empty.yml new file mode 100644 index 0000000..e69de29 diff --git a/examples/092/namespace b/examples/092/namespace new file mode 100644 index 0000000..e69de29 diff --git a/examples/100/config/02/config.yaml b/examples/100/config/02/config.yaml index c43d770..ffa7a24 100644 --- a/examples/100/config/02/config.yaml +++ b/examples/100/config/02/config.yaml @@ -4,4 +4,4 @@ foxyproxy: - title: My company color: '#66cc66' type: HTTP - address: proxy.my_company.net + address: proxy.company.net diff --git a/examples/100/dictionaries/foxyproxy/00-foxyproxy.yml b/examples/100/dictionaries/foxyproxy/00-foxyproxy.yml index 16a9c9e..ed97d53 100644 --- a/examples/100/dictionaries/foxyproxy/00-foxyproxy.yml +++ b/examples/100/dictionaries/foxyproxy/00-foxyproxy.yml @@ -1,12 +1 @@ --- -proxies: - description: Proxy configuration - type: leadership - - title: - description: Title or Description - multi: true - mandatory: false - - color: - description: Color diff --git a/examples/101/config b/examples/101/config new file mode 120000 index 0000000..52cae7a --- /dev/null +++ b/examples/101/config @@ -0,0 +1 @@ +../100/config \ No newline at end of file diff --git a/examples/101/config/02/config.yaml b/examples/101/config/02/config.yaml deleted file mode 100644 index c43d770..0000000 --- a/examples/101/config/02/config.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -foxyproxy: - proxies: - - title: My company - color: '#66cc66' - type: HTTP - address: proxy.my_company.net diff --git a/examples/101/config/03/config.yaml b/examples/101/config/03/config.yaml deleted file mode 100644 index bf2cc98..0000000 --- a/examples/101/config/03/config.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -firefox: - proxy_mode: Manual proxy configuration - manual: - http_proxy: - address: http.proxy.net -foxyproxy: - proxies: - - title: My company - color: '#66cc66' - type: HTTP - - title: An other company - color: '#cc66cc' - type: SOCKS5 - username: my_user - password: my_password - - title: WPAD - color: '#1166cc' - type: WPAD - url: http://wpad.proxy.net/wpad.dat diff --git a/examples/101/dictionaries/foxyproxy/00-foxyproxy.yml b/examples/101/dictionaries/foxyproxy/00-foxyproxy.yml index 4b363ee..1725997 100644 --- a/examples/101/dictionaries/foxyproxy/00-foxyproxy.yml +++ b/examples/101/dictionaries/foxyproxy/00-foxyproxy.yml @@ -5,14 +5,7 @@ proxies: title: description: Title or Description - multi: true mandatory: false color: description: Color -# validators: -# - type: jinja -# jinja: | -# {% if _.color | regex_search('/^#([A-F0-9]{3}|[A-F0-9]{6})$/i') %} -# not a valid color, should be somethink like #000000 -# {% endif %} diff --git a/examples/102/config b/examples/102/config new file mode 120000 index 0000000..52cae7a --- /dev/null +++ b/examples/102/config @@ -0,0 +1 @@ +../100/config \ No newline at end of file diff --git a/examples/102/config/02/config.yaml b/examples/102/config/02/config.yaml deleted file mode 100644 index c43d770..0000000 --- a/examples/102/config/02/config.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -foxyproxy: - proxies: - - title: My company - color: '#66cc66' - type: HTTP - address: proxy.my_company.net diff --git a/examples/102/config/03/config.yaml b/examples/102/config/03/config.yaml deleted file mode 100644 index bf2cc98..0000000 --- a/examples/102/config/03/config.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -firefox: - proxy_mode: Manual proxy configuration - manual: - http_proxy: - address: http.proxy.net -foxyproxy: - proxies: - - title: My company - color: '#66cc66' - type: HTTP - - title: An other company - color: '#cc66cc' - type: SOCKS5 - username: my_user - password: my_password - - title: WPAD - color: '#1166cc' - type: WPAD - url: http://wpad.proxy.net/wpad.dat diff --git a/examples/102/dictionaries/foxyproxy/00-foxyproxy.yml b/examples/102/dictionaries/foxyproxy/00-foxyproxy.yml index e94b7b3..e19211d 100644 --- a/examples/102/dictionaries/foxyproxy/00-foxyproxy.yml +++ b/examples/102/dictionaries/foxyproxy/00-foxyproxy.yml @@ -1,32 +1,20 @@ --- proxies: description: Proxy configuration - _type: leadership + type: leadership title: description: Title or Description - multi: true mandatory: false - type: - description: Proxy Type - type: choice - choices: - - HTTP - - HTTPS/SSL - - SOCKS4 - - SOCKS5 - - PAC URL - - WPAD - - System (use system settings) - - Direct (no proxy) - default: Direct (no proxy) - color: description: Color -# validators: -# - type: jinja -# jinja: | -# {% if _.color | regex_search('/^#([A-F0-9]{3}|[A-F0-9]{6})$/i') %} -# not a valid color, should be somethink like #000000 -# {% endif %} + regexp: "^#(?:[0-9a-f]{3}){1,2}$" + auto_save: true + default: + jinja: | + # + {%- for i in range(6) -%} + {{- '0123456789abcdef' | random -}} + {%- endfor -%} + description: random color value diff --git a/examples/103/config b/examples/103/config new file mode 120000 index 0000000..52cae7a --- /dev/null +++ b/examples/103/config @@ -0,0 +1 @@ +../100/config \ No newline at end of file diff --git a/examples/103/config/02/config.yaml b/examples/103/config/02/config.yaml deleted file mode 100644 index c43d770..0000000 --- a/examples/103/config/02/config.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -foxyproxy: - proxies: - - title: My company - color: '#66cc66' - type: HTTP - address: proxy.my_company.net diff --git a/examples/103/config/03/config.yaml b/examples/103/config/03/config.yaml deleted file mode 100644 index bf2cc98..0000000 --- a/examples/103/config/03/config.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -firefox: - proxy_mode: Manual proxy configuration - manual: - http_proxy: - address: http.proxy.net -foxyproxy: - proxies: - - title: My company - color: '#66cc66' - type: HTTP - - title: An other company - color: '#cc66cc' - type: SOCKS5 - username: my_user - password: my_password - - title: WPAD - color: '#1166cc' - type: WPAD - url: http://wpad.proxy.net/wpad.dat diff --git a/examples/103/dictionaries/foxyproxy/00-foxyproxy.yml b/examples/103/dictionaries/foxyproxy/00-foxyproxy.yml index 72c7a43..5c72d09 100644 --- a/examples/103/dictionaries/foxyproxy/00-foxyproxy.yml +++ b/examples/103/dictionaries/foxyproxy/00-foxyproxy.yml @@ -5,12 +5,10 @@ proxies: title: description: Title or Description - multi: true mandatory: false type: description: Proxy Type - type: choice choices: - HTTP - HTTPS/SSL @@ -24,105 +22,12 @@ proxies: color: description: Color -# validators: -# - type: jinja -# jinja: | -# {% if _.color | regex_search('/^#([A-F0-9]{3}|[A-F0-9]{6})$/i') %} -# not a valid color, should be somethink like #000000 -# {% endif %} - - address: - description: IP address, DNS name, server name - type: domainname - params: - allow_ip: true - disabled: &needs_address - type: jinja - jinja: | - {% if _.type not in ['HTTP', 'HTTPS/SSL', 'SOCKS4', 'SOCKS5'] %} - disabled - {% endif %} - description: | - if type not in: - - HTTP - - HTTPS/SSL - - SOCKS4 - - SOCKS5 + regexp: "^#(?:[0-9a-f]{3}){1,2}$" + auto_save: true default: - type: jinja jinja: | - {% if firefox_address is not undefined %} - {{ firefox_address }} - {% endif %} - params: - firefox_address: - type: variable - variable: firefox.manual.http_proxy.address - propertyerror: false - description: copy HTTP address if proxy is not "Manual" - - port: - description: Port - type: port - default: - type: jinja - jinja: | - {% if firefox_port is not undefined %} - {{ firefox_port }} - {% endif %} - params: - firefox_port: - type: variable - variable: firefox.manual.http_proxy.port - propertyerror: false - description: copy HTTP port if proxy is not "Manual" - disabled: *needs_address - - username: - description: Username - type: unix_user - mandatory: - type: jinja - jinja: | - {% if password is not undefined and password %} - username is mandatory - {% endif %} - params: - password: - type: variable - variable: _.password - propertyerror: false - description: if a password is set - disabled: *needs_address - - password: - description: Password - type: secret - mandatory: false - disabled: *needs_address - - url: - description: URL - type: web_address - disabled: - type: jinja - jinja: | - {% if _.type not in ['PAC URL', 'WPAD'] %} - proxy does not need url - {% endif %} - description: | - if type is not in: - - PAC URL - - WPAD - default: - type: jinja - jinja: | - {% if firefox_url is not undefined %} - {{ firefox_url }} - {% endif %} - params: - firefox_url: - type: variable - variable: firefox.auto - propertyerror: false - description: copy HTTP address if proxy is "Auto" + # + {%- for i in range(6) -%} + {{- '0123456789abcdef' | random -}} + {%- endfor -%} + description: random color value diff --git a/examples/104/README.md b/examples/104/README.md new file mode 100644 index 0000000..d6459e0 --- /dev/null +++ b/examples/104/README.md @@ -0,0 +1 @@ +xxx diff --git a/examples/104/config b/examples/104/config new file mode 120000 index 0000000..52cae7a --- /dev/null +++ b/examples/104/config @@ -0,0 +1 @@ +../100/config \ No newline at end of file diff --git a/examples/104/dictionaries/foxyproxy/00-foxyproxy.yml b/examples/104/dictionaries/foxyproxy/00-foxyproxy.yml new file mode 100644 index 0000000..7158b8f --- /dev/null +++ b/examples/104/dictionaries/foxyproxy/00-foxyproxy.yml @@ -0,0 +1,104 @@ +--- +proxies: + description: Proxy configuration + _type: leadership + + title: + description: Title or Description + mandatory: false + + type: + description: Proxy Type + choices: + - HTTP + - HTTPS/SSL + - SOCKS4 + - SOCKS5 + - PAC URL + - WPAD + - System (use system settings) + - Direct (no proxy) + default: Direct (no proxy) + + color: + description: Color + regexp: "^#(?:[0-9a-f]{3}){1,2}$" + auto_save: true + default: + jinja: | + # + {%- for i in range(6) -%} + {{- '0123456789abcdef' | random -}} + {%- endfor -%} + description: random color value + + address: + description: IP address, DNS name, server name + type: domainname + params: + allow_ip: true + allow_without_dot: true + disabled: &needs_address + jinja: | + {% if _.type not in ['HTTP', 'HTTPS/SSL', 'SOCKS4', 'SOCKS5'] %} + disabled + {% endif %} + description: | + if type not in: + - HTTP + - HTTPS/SSL + - SOCKS4 + - SOCKS5 + default: + jinja: | + {% if firefox.manual.http_proxy.address is not propertyerror %} + {{ firefox.manual.http_proxy.address }} + {% endif %} + description: copy HTTP address if proxy is not "Manual" + + port: + description: Port + type: port + default: + jinja: | + {% if firefox.manual.http_proxy.port is not propertyerror %} + {{ firefox.manual.http_proxy.port }} + {% endif %} + description: copy HTTP port if proxy is not "Manual" + disabled: *needs_address + + username: + description: Username + type: unix_user + mandatory: + jinja: | + {% if _.password is not propertyerror and _.password %} + username is mandatory + {% endif %} + description: if a password is set + disabled: *needs_address + + password: + description: Password + type: secret + mandatory: false + disabled: *needs_address + + url: + description: URL + type: web_address + disabled: + jinja: | + {% if _.type not in ['PAC URL', 'WPAD'] %} + proxy does not need url + {% endif %} + description: | + if type is not in: + - PAC URL + - WPAD + default: + jinja: | + {% if firefox.auto is not propertyerror %} + {{ firefox.auto }} + {% endif %} + description: copy HTTP address if proxy is "Auto"