diff --git a/build.py b/build.py index 6cb7b23..9cebbf6 100755 --- a/build.py +++ b/build.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import sys +from json import dump, loads from pathlib import Path from ruamel.yaml import YAML from ansi2html import Ansi2HTMLConverter @@ -12,12 +13,14 @@ from rougail.user_data_yaml import RougailUserDataYaml from rougail.output_doc import RougailOutputDoc +PREVIOUS = Path("previous.yml") + + if __name__ == "__main__": - version = sys.argv[1] + commit_id = sys.argv[1] # rougailconfig = RougailConfig.copy() rougailconfig = get_rougail_config(backward_compatibility=False, add_extra_options=False) rougailconfig['main_structural_directories'] = ['firefox'] - rougailconfig['default_structural_format_version'] = version if Path('config/namespace').is_file(): has_namespace = True has_foxyproxy = False @@ -44,6 +47,7 @@ if __name__ == "__main__": rougailconfig['doc.title_level'] = 3 inventory = RougailOutputDoc(config, rougailconfig=rougailconfig.copy()) inventory.load_formatter() + inv_formatter = inventory.formatter rougailconfig['step.output'] = 'console' summary = Path('summary_before.md') if summary.is_file(): @@ -59,11 +63,11 @@ if __name__ == "__main__": else: all_dirs = [[rougailconfig['main_structural_directories']]] - doc += inventory.formatter.title('Screenshot', 2) + '\n' + doc += inv_formatter.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.formatter.title('Structure', 2) + '\n' + doc += '\n' + inv_formatter.title('Structure', 2) + '\n' print(all_dirs) for r in all_dirs: for dirs in r: @@ -75,17 +79,17 @@ if __name__ == "__main__": namespace = f.parent.name file_found = True if f.name.endswith('.yml') or f.name.endswith('.yaml'): - doc += inventory.formatter.title(str(f), 3) + doc += inv_formatter.title(str(f), 3) doc += '\n```yml\n' with f.open(encoding="utf8") as file_fh: doc += file_fh.read() doc += '\n```\n' rougailconfig['step.output'] = 'doc' inv_doc = inventory.run()[1] - rougailconfig['step.output'] = 'console' if file_found and inv_doc: - doc += inventory.formatter.title('Generated documentation', 3) - CMD = f"foo@bar:~$ rougail -v {version} -m firefox/ " + doc += inv_formatter.title('Generated documentation', 3) + CMD = f"foo@bar:~$ git switch --detach {commit_id}\n" + CMD += "foo@bar:~$ rougail -m firefox/ " if has_namespace: CMD += "-s Firefox " if has_foxyproxy: @@ -95,10 +99,28 @@ if __name__ == "__main__": cmd = CMD + "-o doc -do github" doc += f'```console\n{cmd}\n```\n' doc += inv_doc + if PREVIOUS.is_file(): + rougailconfig["doc.title_level"] = 5 + rougailconfig["doc.contents"] = ["changelog"] + rougailconfig["doc.previous_json_file"] = str(PREVIOUS) + inv_doc = inventory.run()[1] + if file_found and inv_doc: + doc += inv_formatter.title('Changelog', 3) + cmd = CMD + "-o doc --doc.contents variables changelog -do github" + doc += f'```console\n{cmd}\n```\n' + doc += inv_doc + # save PREVIOUS + rougailconfig["doc.contents"] = ["variables"] + rougailconfig['doc.output_format'] = 'json' + data = inventory.run()[1] + if data: + with PREVIOUS.open('w') as fh: + dump(loads(data), fh) # + rougailconfig['step.output'] = 'console' config = Path('config') if config.is_dir(): - doc += inventory.formatter.title('User data', 2) + doc += inv_formatter.title('User data', 2) configs = list(config.iterdir()) configs.sort() for idx, dirname in enumerate(configs): @@ -106,24 +128,24 @@ if __name__ == "__main__": continue for filename in dirname.iterdir(): if filename.name.endswith('.yml') or filename.name.endswith('.yaml'): - doc += inventory.formatter.title(f'Example {idx + 1}', 3) - doc += inventory.formatter.title(str(filename), 4) + doc += inv_formatter.title(f'Example {idx + 1}', 3) + doc += inv_formatter.title(str(filename), 4) doc += '\n```yml\n' with filename.open(encoding="utf8") as file_fh: doc += file_fh.read() doc += '\n```\n' # with filename.open(encoding="utf8") as file_fh: # objects = yaml.load(file_fh) -# doc += inventory.formatter.yaml(objects) +# doc += inv_formatter.yaml(objects) #readme = dirname / 'README.md' #if readme.is_file(): - # doc += inventory.formatter.title('Description', 4) + # doc += inv_formatter.title('Description', 4) # with readme.open() as fh: # doc += fh.read() + '\n\n' rougail = Rougail(rougailconfig) tiramisu_config = rougail.run() rougailconfig['step.user_data'] = ['yaml'] - rougailconfig['yaml.filename'] = [str(filename.absolute())] + rougailconfig['yaml.filename'] = [str(filename)] data = RougailUserDataYaml(tiramisu_config, rougailconfig=rougailconfig) ret = data.run() errors = rougail.user_datas(ret) @@ -134,7 +156,7 @@ if __name__ == "__main__": ) console = export.run()[1] conv = Ansi2HTMLConverter(inline=True) - doc += inventory.formatter.title('Output', 4) + doc += inv_formatter.title('Output', 4) cmd = CMD + f"-u yaml -ff {filename}" doc += f"```console\n{cmd}\n```\n" conv_data = '
' + conv.convert(console, full=False) + "
\n" @@ -150,7 +172,7 @@ if __name__ == "__main__": ) console = export.run()[1] conv = Ansi2HTMLConverter(inline=True) - doc += inventory.formatter.title('Output in read write mode', 4) + doc += inv_formatter.title('Output in read write mode', 4) cmd = cmd + " --cli.read_write" doc += f"```console\n{cmd}\n```\n" conv_data = '
' + conv.convert(console, full=False) + "
\n" diff --git a/build.sh b/build.sh index 66cf648..d497dd2 100755 --- a/build.sh +++ b/build.sh @@ -40,7 +40,7 @@ cd - > /dev/null for i in $(ls -d "examples"/* | sort); do num=$(echo $(basename "$i")) echo "$num" - commit_id="v$VERSION_$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 @@ -56,7 +56,7 @@ for i in $(ls -d "examples"/* | sort); do rm -rf "$DEST/config" num=$(echo $(basename "$i")) echo "$num" - commit_id="v$VERSION_$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 @@ -100,7 +100,7 @@ for i in $(ls -d "examples"/* | sort); do if [ -f config/mode ]; then mv config/mode mode fi - "$BUILDER"/build.py "$VERSION" + "$BUILDER"/build.py "$commit_id" 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 diff --git a/examples/001/README.md b/examples/001/README.md deleted file mode 100644 index 21f4eae..0000000 --- a/examples/001/README.md +++ /dev/null @@ -1 +0,0 @@ -The format version in commandline diff --git a/examples/001/structural_files/firefox/00-proxy.yml b/examples/001/structural_files/firefox/00-proxy.yml deleted file mode 100644 index 94a82bd..0000000 --- a/examples/001/structural_files/firefox/00-proxy.yml +++ /dev/null @@ -1,4 +0,0 @@ -%YAML 1.2 ---- -version: 1.1 -... diff --git a/examples/028/README.md b/examples/028/README.md deleted file mode 100644 index e84df81..0000000 --- a/examples/028/README.md +++ /dev/null @@ -1 +0,0 @@ -Type variable is optional diff --git a/examples/031/README.md b/examples/031/README.md index 17ab1fd..7d9b8be 100644 --- a/examples/031/README.md +++ b/examples/031/README.md @@ -1 +1 @@ -Bases type is optional if default value +Copy HTTP manual proxy to HTTPS manual proxy diff --git a/examples/032/SUBTITLE.md b/examples/031/SUBTITLE.md similarity index 100% rename from examples/032/SUBTITLE.md rename to examples/031/SUBTITLE.md diff --git a/examples/032/TITLE.md b/examples/031/TITLE.md similarity index 100% rename from examples/032/TITLE.md rename to examples/031/TITLE.md diff --git a/examples/031/structural_files/firefox/20-manual.yml b/examples/031/structural_files/firefox/20-manual.yml index bbd0f25..442fb2d 100644 --- a/examples/031/structural_files/firefox/20-manual.yml +++ b/examples/031/structural_files/firefox/20-manual.yml @@ -5,4 +5,17 @@ version: 1.1 manual: use_for_https: true # Also use this proxy for HTTPS + + https_proxy: # HTTPS Proxy + + address: + description: HTTPS address + type: domainname + params: + allow_ip: true + + port: + description: HTTPS Port + type: port + default: 8080 ... diff --git a/examples/032/README.md b/examples/032/README.md index 7d9b8be..be99f7f 100644 --- a/examples/032/README.md +++ b/examples/032/README.md @@ -1 +1 @@ -Copy HTTP manual proxy to HTTPS manual proxy +An hidden family diff --git a/examples/032/structural_files/firefox/20-manual.yml b/examples/032/structural_files/firefox/20-manual.yml index 442fb2d..42f47c9 100644 --- a/examples/032/structural_files/firefox/20-manual.yml +++ b/examples/032/structural_files/firefox/20-manual.yml @@ -6,7 +6,9 @@ manual: use_for_https: true # Also use this proxy for HTTPS - https_proxy: # HTTPS Proxy + https_proxy: + description: HTTPS Proxy + hidden: true address: description: HTTPS address diff --git a/examples/033/README.md b/examples/033/README.md index be99f7f..7e740c0 100644 --- a/examples/033/README.md +++ b/examples/033/README.md @@ -1 +1 @@ -An hidden family +A conditional hidden family with a variable diff --git a/examples/033/structural_files/firefox/20-manual.yml b/examples/033/structural_files/firefox/20-manual.yml index 42f47c9..f7295f0 100644 --- a/examples/033/structural_files/firefox/20-manual.yml +++ b/examples/033/structural_files/firefox/20-manual.yml @@ -8,7 +8,8 @@ manual: https_proxy: description: HTTPS Proxy - hidden: true + hidden: + variable: _.use_for_https address: description: HTTPS address diff --git a/examples/034/README.md b/examples/034/README.md index 7e740c0..1be0e6e 100644 --- a/examples/034/README.md +++ b/examples/034/README.md @@ -1 +1 @@ -A conditional hidden family with a variable +A calculated default value diff --git a/examples/035/SUBTITLE.md b/examples/034/SUBTITLE.md similarity index 100% rename from examples/035/SUBTITLE.md rename to examples/034/SUBTITLE.md diff --git a/examples/034/structural_files/firefox/20-manual.yml b/examples/034/structural_files/firefox/20-manual.yml index f7295f0..3e15a0b 100644 --- a/examples/034/structural_files/firefox/20-manual.yml +++ b/examples/034/structural_files/firefox/20-manual.yml @@ -16,9 +16,12 @@ manual: type: domainname params: allow_ip: true + default: + variable: __.http_proxy.address port: description: HTTPS Port type: port - default: 8080 + default: + variable: __.http_proxy.port ... diff --git a/examples/035/README.md b/examples/035/README.md index 1be0e6e..26a03cf 100644 --- a/examples/035/README.md +++ b/examples/035/README.md @@ -1 +1 @@ -A calculated default value +Variable type and parameters type are copied with default value diff --git a/examples/035/config b/examples/035/config index dce6a43..12177f8 120000 --- a/examples/035/config +++ b/examples/035/config @@ -1 +1 @@ -../013/config \ No newline at end of file +../017/config \ No newline at end of file diff --git a/examples/035/structural_files/firefox/20-manual.yml b/examples/035/structural_files/firefox/20-manual.yml index 3e15a0b..f25bcd9 100644 --- a/examples/035/structural_files/firefox/20-manual.yml +++ b/examples/035/structural_files/firefox/20-manual.yml @@ -13,15 +13,11 @@ manual: address: description: HTTPS address - type: domainname - params: - allow_ip: true default: variable: __.http_proxy.address port: description: HTTPS Port - type: port default: variable: __.http_proxy.port ... diff --git a/examples/036/README.md b/examples/036/README.md deleted file mode 100644 index 26a03cf..0000000 --- a/examples/036/README.md +++ /dev/null @@ -1 +0,0 @@ -Variable type and parameters type are copied with default value diff --git a/examples/036/config b/examples/036/config deleted file mode 120000 index 12177f8..0000000 --- a/examples/036/config +++ /dev/null @@ -1 +0,0 @@ -../017/config \ No newline at end of file diff --git a/examples/036/structural_files/firefox/20-manual.yml b/examples/036/structural_files/firefox/20-manual.yml deleted file mode 100644 index f25bcd9..0000000 --- a/examples/036/structural_files/firefox/20-manual.yml +++ /dev/null @@ -1,23 +0,0 @@ -%YAML 1.2 ---- -version: 1.1 - -manual: - - use_for_https: true # Also use this proxy for HTTPS - - https_proxy: - description: HTTPS Proxy - hidden: - variable: _.use_for_https - - address: - description: HTTPS address - default: - variable: __.http_proxy.address - - port: - description: HTTPS Port - default: - variable: __.http_proxy.port -... diff --git a/examples/050/README.md b/examples/050/README.md index eaa8f87..3306546 100644 --- a/examples/050/README.md +++ b/examples/050/README.md @@ -1 +1 @@ -Family: "shorthand" mode +A variable with type "web_address" diff --git a/examples/050/TITLE.md b/examples/050/TITLE.md index 8775c7e..f8448e5 100644 --- a/examples/050/TITLE.md +++ b/examples/050/TITLE.md @@ -1 +1 @@ -Shorthand mode +Automatic proxy diff --git a/examples/050/config b/examples/050/config deleted file mode 120000 index 160a2a6..0000000 --- a/examples/050/config +++ /dev/null @@ -1 +0,0 @@ -../010/config \ No newline at end of file diff --git a/examples/060/config/01/README.md b/examples/050/config/01/README.md similarity index 100% rename from examples/060/config/01/README.md rename to examples/050/config/01/README.md diff --git a/examples/050/config/01/config.yaml b/examples/050/config/01/config.yaml new file mode 100644 index 0000000..1edbe91 --- /dev/null +++ b/examples/050/config/01/config.yaml @@ -0,0 +1,2 @@ +--- +auto: https://auto.proxy.net/wpad.dat diff --git a/examples/050/config/02/config.yaml b/examples/050/config/02/config.yaml new file mode 100644 index 0000000..26df130 --- /dev/null +++ b/examples/050/config/02/config.yaml @@ -0,0 +1,2 @@ +--- +proxy_mode: Automatic proxy configuration URL diff --git a/examples/060/config/03/config.yaml b/examples/050/config/03/config.yaml similarity index 100% rename from examples/060/config/03/config.yaml rename to examples/050/config/03/config.yaml diff --git a/examples/050/firefox.png b/examples/050/firefox.png new file mode 100644 index 0000000..20701e2 Binary files /dev/null and b/examples/050/firefox.png differ diff --git a/examples/080/firefox.xcf b/examples/050/firefox.xcf similarity index 75% rename from examples/080/firefox.xcf rename to examples/050/firefox.xcf index c362607..89c7f4b 100644 Binary files a/examples/080/firefox.xcf and b/examples/050/firefox.xcf differ diff --git a/examples/050/structural_files/firefox/10-manual.yml b/examples/050/structural_files/firefox/10-manual.yml deleted file mode 100644 index 047ff8a..0000000 --- a/examples/050/structural_files/firefox/10-manual.yml +++ /dev/null @@ -1,23 +0,0 @@ -%YAML 1.2 ---- -version: 1.1 - -manual: - description: Manual proxy configuration - disabled: - 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 -... diff --git a/examples/060/structural_files/firefox/30-auto.yml b/examples/050/structural_files/firefox/30-auto.yml similarity index 100% rename from examples/060/structural_files/firefox/30-auto.yml rename to examples/050/structural_files/firefox/30-auto.yml diff --git a/examples/051/README.md b/examples/051/README.md index 7441d43..7c3c2fe 100644 --- a/examples/051/README.md +++ b/examples/051/README.md @@ -1 +1 @@ -Variable: "shorthand" mode +A conditional disabled variable diff --git a/examples/051/config b/examples/051/config deleted file mode 120000 index dce6a43..0000000 --- a/examples/051/config +++ /dev/null @@ -1 +0,0 @@ -../013/config \ No newline at end of file diff --git a/examples/061/config/01/README.md b/examples/051/config/01/README.md similarity index 100% rename from examples/061/config/01/README.md rename to examples/051/config/01/README.md diff --git a/examples/051/config/01/config.yaml b/examples/051/config/01/config.yaml new file mode 100644 index 0000000..1edbe91 --- /dev/null +++ b/examples/051/config/01/config.yaml @@ -0,0 +1,2 @@ +--- +auto: https://auto.proxy.net/wpad.dat diff --git a/examples/051/config/02/config.yaml b/examples/051/config/02/config.yaml new file mode 100644 index 0000000..26df130 --- /dev/null +++ b/examples/051/config/02/config.yaml @@ -0,0 +1,2 @@ +--- +proxy_mode: Automatic proxy configuration URL diff --git a/examples/071/config/03/config.yaml b/examples/051/config/03/config.yaml similarity index 100% rename from examples/071/config/03/config.yaml rename to examples/051/config/03/config.yaml diff --git a/examples/051/structural_files/firefox/20-manual.yml b/examples/051/structural_files/firefox/20-manual.yml deleted file mode 100644 index 66119e8..0000000 --- a/examples/051/structural_files/firefox/20-manual.yml +++ /dev/null @@ -1,43 +0,0 @@ -%YAML 1.2 ---- -version: 1.1 - -manual: - - use_for_https: true # Also use this proxy for HTTPS - - '{{ identifier }}_proxy': - description: '{{ identifier }} Proxy' - hidden: - jinja: |- - {% if my_identifier == 'HTTPS' and manual.use_for_https %} - HTTPS is same has HTTP - {% endif %} - description: in HTTPS case if "manual.use_for_https" is set to True - params: - my_identifier: - type: identifier - dynamic: - - HTTPS - - SOCKS - - 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/061/structural_files/firefox/30-auto.yml b/examples/051/structural_files/firefox/30-auto.yml similarity index 100% rename from examples/061/structural_files/firefox/30-auto.yml rename to examples/051/structural_files/firefox/30-auto.yml diff --git a/examples/060/README.md b/examples/060/README.md index 3306546..057f856 100644 --- a/examples/060/README.md +++ b/examples/060/README.md @@ -1 +1 @@ -A variable with type "web_address" +A variable with type "domainname", parameters type and disabled diff --git a/examples/070/SUBTITLE.md b/examples/060/SUBTITLE.md similarity index 100% rename from examples/070/SUBTITLE.md rename to examples/060/SUBTITLE.md diff --git a/examples/060/TITLE.md b/examples/060/TITLE.md index f8448e5..90ad7d2 100644 --- a/examples/060/TITLE.md +++ b/examples/060/TITLE.md @@ -1 +1 @@ -Automatic proxy +Address for which proxy will be desactivated diff --git a/examples/060/config/01/config.yaml b/examples/060/config/01/config.yaml index 1edbe91..ed97d53 100644 --- a/examples/060/config/01/config.yaml +++ b/examples/060/config/01/config.yaml @@ -1,2 +1 @@ --- -auto: https://auto.proxy.net/wpad.dat diff --git a/examples/060/config/02/config.yaml b/examples/060/config/02/config.yaml index 26df130..54956ea 100644 --- a/examples/060/config/02/config.yaml +++ b/examples/060/config/02/config.yaml @@ -1,2 +1,4 @@ --- proxy_mode: Automatic proxy configuration URL +auto: https://auto.proxy.net/wpad.dat +no_proxy: 192.168.1.0/24 diff --git a/examples/060/firefox.png b/examples/060/firefox.png index 20701e2..16f5931 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 89c7f4b..5cc54d7 100644 Binary files a/examples/060/firefox.xcf and b/examples/060/firefox.xcf differ diff --git a/examples/070/structural_files/firefox/40-no_proxy.yml b/examples/060/structural_files/firefox/40-no_proxy.yml similarity index 100% rename from examples/070/structural_files/firefox/40-no_proxy.yml rename to examples/060/structural_files/firefox/40-no_proxy.yml diff --git a/examples/061/README.md b/examples/061/README.md index 7c3c2fe..130d225 100644 --- a/examples/061/README.md +++ b/examples/061/README.md @@ -1 +1 @@ -A conditional disabled variable +A variable with multiple value diff --git a/examples/061/config/01/config.yaml b/examples/061/config/01/config.yaml index 1edbe91..ed97d53 100644 --- a/examples/061/config/01/config.yaml +++ b/examples/061/config/01/config.yaml @@ -1,2 +1 @@ --- -auto: https://auto.proxy.net/wpad.dat diff --git a/examples/061/config/02/config.yaml b/examples/061/config/02/config.yaml index 26df130..ccba4c0 100644 --- a/examples/061/config/02/config.yaml +++ b/examples/061/config/02/config.yaml @@ -1,2 +1,6 @@ --- proxy_mode: Automatic proxy configuration URL +auto: https://auto.proxy.net/wpad.dat +no_proxy: + - example.net + - 192.168.1.0/24 diff --git a/examples/071/structural_files/firefox/40-no_proxy.yml b/examples/061/structural_files/firefox/40-no_proxy.yml similarity index 100% rename from examples/071/structural_files/firefox/40-no_proxy.yml rename to examples/061/structural_files/firefox/40-no_proxy.yml diff --git a/examples/062/README.md b/examples/062/README.md new file mode 100644 index 0000000..d83ef1b --- /dev/null +++ b/examples/062/README.md @@ -0,0 +1 @@ +A non mandatory variable diff --git a/examples/072/config b/examples/062/config similarity index 100% rename from examples/072/config rename to examples/062/config diff --git a/examples/072/structural_files/firefox/40-no_proxy.yml b/examples/062/structural_files/firefox/40-no_proxy.yml similarity index 100% rename from examples/072/structural_files/firefox/40-no_proxy.yml rename to examples/062/structural_files/firefox/40-no_proxy.yml diff --git a/examples/063/README.md b/examples/063/README.md new file mode 100644 index 0000000..ad6b7fb --- /dev/null +++ b/examples/063/README.md @@ -0,0 +1 @@ +Examples diff --git a/examples/073/SUBTITLE.md b/examples/063/SUBTITLE.md similarity index 100% rename from examples/073/SUBTITLE.md rename to examples/063/SUBTITLE.md diff --git a/examples/073/config b/examples/063/config similarity index 100% rename from examples/073/config rename to examples/063/config diff --git a/examples/073/structural_files/firefox/40-no_proxy.yml b/examples/063/structural_files/firefox/40-no_proxy.yml similarity index 100% rename from examples/073/structural_files/firefox/40-no_proxy.yml rename to examples/063/structural_files/firefox/40-no_proxy.yml diff --git a/examples/074/README.md b/examples/064/README.md similarity index 100% rename from examples/074/README.md rename to examples/064/README.md diff --git a/examples/074/config/01/config.yaml b/examples/064/config/01/config.yaml similarity index 100% rename from examples/074/config/01/config.yaml rename to examples/064/config/01/config.yaml diff --git a/examples/074/config/02/config.yaml b/examples/064/config/02/config.yaml similarity index 100% rename from examples/074/config/02/config.yaml rename to examples/064/config/02/config.yaml diff --git a/examples/074/config/03/config.yaml b/examples/064/config/03/config.yaml similarity index 100% rename from examples/074/config/03/config.yaml rename to examples/064/config/03/config.yaml diff --git a/examples/074/structural_files/firefox/40-no_proxy.yml b/examples/064/structural_files/firefox/40-no_proxy.yml similarity index 100% rename from examples/074/structural_files/firefox/40-no_proxy.yml rename to examples/064/structural_files/firefox/40-no_proxy.yml diff --git a/examples/075/README.md b/examples/065/README.md similarity index 100% rename from examples/075/README.md rename to examples/065/README.md diff --git a/examples/075/TITLE.md b/examples/065/TITLE.md similarity index 100% rename from examples/075/TITLE.md rename to examples/065/TITLE.md diff --git a/examples/075/config/01/config.yaml b/examples/065/config/01/config.yaml similarity index 100% rename from examples/075/config/01/config.yaml rename to examples/065/config/01/config.yaml diff --git a/examples/075/config/02/config.yaml b/examples/065/config/02/config.yaml similarity index 100% rename from examples/075/config/02/config.yaml rename to examples/065/config/02/config.yaml diff --git a/examples/075/config/03/config.yaml b/examples/065/config/03/config.yaml similarity index 100% rename from examples/075/config/03/config.yaml rename to examples/065/config/03/config.yaml diff --git a/examples/075/config/04/config.yaml b/examples/065/config/04/config.yaml similarity index 100% rename from examples/075/config/04/config.yaml rename to examples/065/config/04/config.yaml diff --git a/examples/075/firefox.png b/examples/065/firefox.png similarity index 100% rename from examples/075/firefox.png rename to examples/065/firefox.png diff --git a/examples/075/firefox.xcf b/examples/065/firefox.xcf similarity index 100% rename from examples/075/firefox.xcf rename to examples/065/firefox.xcf diff --git a/examples/075/structural_files/firefox/50-prompt_authentication.yml b/examples/065/structural_files/firefox/50-prompt_authentication.yml similarity index 100% rename from examples/075/structural_files/firefox/50-prompt_authentication.yml rename to examples/065/structural_files/firefox/50-prompt_authentication.yml diff --git a/examples/076/README.md b/examples/066/README.md similarity index 100% rename from examples/076/README.md rename to examples/066/README.md diff --git a/examples/076/TITLE.md b/examples/066/TITLE.md similarity index 100% rename from examples/076/TITLE.md rename to examples/066/TITLE.md diff --git a/examples/076/config/01/config.yaml b/examples/066/config/01/config.yaml similarity index 100% rename from examples/076/config/01/config.yaml rename to examples/066/config/01/config.yaml diff --git a/examples/076/config/02/config.yaml b/examples/066/config/02/config.yaml similarity index 100% rename from examples/076/config/02/config.yaml rename to examples/066/config/02/config.yaml diff --git a/examples/076/config/03/config.yaml b/examples/066/config/03/config.yaml similarity index 100% rename from examples/076/config/03/config.yaml rename to examples/066/config/03/config.yaml diff --git a/examples/076/config/04/config.yaml b/examples/066/config/04/config.yaml similarity index 100% rename from examples/076/config/04/config.yaml rename to examples/066/config/04/config.yaml diff --git a/examples/076/structural_files/firefox/55-proxy_dns_socks5.yml b/examples/066/structural_files/firefox/55-proxy_dns_socks5.yml similarity index 100% rename from examples/076/structural_files/firefox/55-proxy_dns_socks5.yml rename to examples/066/structural_files/firefox/55-proxy_dns_socks5.yml diff --git a/examples/077/README.md b/examples/067/README.md similarity index 100% rename from examples/077/README.md rename to examples/067/README.md diff --git a/examples/077/config/01/config.yaml b/examples/067/config/01/config.yaml similarity index 100% rename from examples/077/config/01/config.yaml rename to examples/067/config/01/config.yaml diff --git a/examples/077/config/02/config.yaml b/examples/067/config/02/config.yaml similarity index 100% rename from examples/077/config/02/config.yaml rename to examples/067/config/02/config.yaml diff --git a/examples/077/config/03/config.yaml b/examples/067/config/03/config.yaml similarity index 100% rename from examples/077/config/03/config.yaml rename to examples/067/config/03/config.yaml diff --git a/examples/077/config/04/config.yaml b/examples/067/config/04/config.yaml similarity index 100% rename from examples/077/config/04/config.yaml rename to examples/067/config/04/config.yaml diff --git a/examples/077/structural_files/firefox/55-proxy_dns_socks5.yml b/examples/067/structural_files/firefox/55-proxy_dns_socks5.yml similarity index 100% rename from examples/077/structural_files/firefox/55-proxy_dns_socks5.yml rename to examples/067/structural_files/firefox/55-proxy_dns_socks5.yml diff --git a/examples/078/README.md b/examples/068/README.md similarity index 100% rename from examples/078/README.md rename to examples/068/README.md diff --git a/examples/078/config/01/config.yaml b/examples/068/config/01/config.yaml similarity index 100% rename from examples/078/config/01/config.yaml rename to examples/068/config/01/config.yaml diff --git a/examples/078/config/02/config.yaml b/examples/068/config/02/config.yaml similarity index 100% rename from examples/078/config/02/config.yaml rename to examples/068/config/02/config.yaml diff --git a/examples/078/config/03/config.yaml b/examples/068/config/03/config.yaml similarity index 100% rename from examples/078/config/03/config.yaml rename to examples/068/config/03/config.yaml diff --git a/examples/078/config/04/config.yaml b/examples/068/config/04/config.yaml similarity index 100% rename from examples/078/config/04/config.yaml rename to examples/068/config/04/config.yaml diff --git a/examples/078/config/mode b/examples/068/config/mode similarity index 100% rename from examples/078/config/mode rename to examples/068/config/mode diff --git a/examples/078/structural_files/firefox/55-proxy_dns_socks5.yml b/examples/068/structural_files/firefox/55-proxy_dns_socks5.yml similarity index 100% rename from examples/078/structural_files/firefox/55-proxy_dns_socks5.yml rename to examples/068/structural_files/firefox/55-proxy_dns_socks5.yml diff --git a/examples/070/README.md b/examples/070/README.md index 057f856..4207bc8 100644 --- a/examples/070/README.md +++ b/examples/070/README.md @@ -1 +1 @@ -A variable with type "domainname", parameters type and disabled +A boolean variable diff --git a/examples/070/TITLE.md b/examples/070/TITLE.md index 90ad7d2..fc1521c 100644 --- a/examples/070/TITLE.md +++ b/examples/070/TITLE.md @@ -1 +1 @@ -Address for which proxy will be desactivated +DNS over HTTPS diff --git a/examples/070/config/02/config.yaml b/examples/070/config/02/config.yaml deleted file mode 100644 index 54956ea..0000000 --- a/examples/070/config/02/config.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -proxy_mode: Automatic proxy configuration URL -auto: https://auto.proxy.net/wpad.dat -no_proxy: 192.168.1.0/24 diff --git a/examples/070/firefox.png b/examples/070/firefox.png index 16f5931..d368003 100644 Binary files a/examples/070/firefox.png and b/examples/070/firefox.png differ diff --git a/examples/070/firefox.xcf b/examples/070/firefox.xcf index 5cc54d7..c362607 100644 Binary files a/examples/070/firefox.xcf and b/examples/070/firefox.xcf differ diff --git a/examples/070/structural_files/firefox/60-dns_over_https.yml b/examples/070/structural_files/firefox/60-dns_over_https.yml new file mode 100644 index 0000000..754f2a8 --- /dev/null +++ b/examples/070/structural_files/firefox/60-dns_over_https.yml @@ -0,0 +1,8 @@ +%YAML 1.2 +--- +version: 1.1 + +dns_over_https: # DNS over HTTPS + + enable_dns_over_https: false # Enable DNS over HTTPS +... diff --git a/examples/071/README.md b/examples/071/README.md index 130d225..9215d09 100644 --- a/examples/071/README.md +++ b/examples/071/README.md @@ -1 +1 @@ -A variable with multiple value +A choice variable diff --git a/examples/071/config/02/config.yaml b/examples/071/config/02/config.yaml index ccba4c0..aee4796 100644 --- a/examples/071/config/02/config.yaml +++ b/examples/071/config/02/config.yaml @@ -1,6 +1,3 @@ --- -proxy_mode: Automatic proxy configuration URL -auto: https://auto.proxy.net/wpad.dat -no_proxy: - - example.net - - 192.168.1.0/24 +dns_over_https: + enable_dns_over_https: true diff --git a/examples/081/structural_files/firefox/60-dns_over_https.yml b/examples/071/structural_files/firefox/60-dns_over_https.yml similarity index 100% rename from examples/081/structural_files/firefox/60-dns_over_https.yml rename to examples/071/structural_files/firefox/60-dns_over_https.yml diff --git a/examples/072/README.md b/examples/072/README.md index d83ef1b..972da98 100644 --- a/examples/072/README.md +++ b/examples/072/README.md @@ -1 +1 @@ -A non mandatory variable +A web_address variable diff --git a/examples/080/config/01/config.yaml b/examples/072/config/01/config.yaml similarity index 100% rename from examples/080/config/01/config.yaml rename to examples/072/config/01/config.yaml diff --git a/examples/081/config/02/config.yaml b/examples/072/config/02/config.yaml similarity index 100% rename from examples/081/config/02/config.yaml rename to examples/072/config/02/config.yaml diff --git a/examples/082/config/03/config.yaml b/examples/072/config/03/config.yaml similarity index 100% rename from examples/082/config/03/config.yaml rename to examples/072/config/03/config.yaml diff --git a/examples/082/config/04/config.yaml b/examples/072/config/04/config.yaml similarity index 100% rename from examples/082/config/04/config.yaml rename to examples/072/config/04/config.yaml diff --git a/examples/082/structural_files/firefox/60-dns_over_https.yml b/examples/072/structural_files/firefox/60-dns_over_https.yml similarity index 100% rename from examples/082/structural_files/firefox/60-dns_over_https.yml rename to examples/072/structural_files/firefox/60-dns_over_https.yml diff --git a/examples/073/README.md b/examples/073/README.md index ad6b7fb..c11c818 100644 --- a/examples/073/README.md +++ b/examples/073/README.md @@ -1 +1 @@ -Examples +A variable with custom validation diff --git a/examples/081/config/01/config.yaml b/examples/073/config/01/config.yaml similarity index 100% rename from examples/081/config/01/config.yaml rename to examples/073/config/01/config.yaml diff --git a/examples/082/config/02/config.yaml b/examples/073/config/02/config.yaml similarity index 100% rename from examples/082/config/02/config.yaml rename to examples/073/config/02/config.yaml diff --git a/examples/083/config/03/config.yaml b/examples/073/config/03/config.yaml similarity index 100% rename from examples/083/config/03/config.yaml rename to examples/073/config/03/config.yaml diff --git a/examples/083/config/04/config.yaml b/examples/073/config/04/config.yaml similarity index 100% rename from examples/083/config/04/config.yaml rename to examples/073/config/04/config.yaml diff --git a/examples/083/structural_files/firefox/60-dns_over_https.yml b/examples/073/structural_files/firefox/60-dns_over_https.yml similarity index 100% rename from examples/083/structural_files/firefox/60-dns_over_https.yml rename to examples/073/structural_files/firefox/60-dns_over_https.yml diff --git a/examples/080/README.md b/examples/080/README.md index 4207bc8..8025287 100644 --- a/examples/080/README.md +++ b/examples/080/README.md @@ -1 +1 @@ -A boolean variable +Variable in same family diff --git a/examples/090/SUBTITLE.md b/examples/080/SUBTITLE.md similarity index 100% rename from examples/090/SUBTITLE.md rename to examples/080/SUBTITLE.md diff --git a/examples/080/TITLE.md b/examples/080/TITLE.md index fc1521c..86ff802 100644 --- a/examples/080/TITLE.md +++ b/examples/080/TITLE.md @@ -1 +1 @@ -DNS over HTTPS +Namespace diff --git a/examples/080/firefox.png b/examples/080/firefox.png deleted file mode 100644 index d368003..0000000 Binary files a/examples/080/firefox.png and /dev/null differ diff --git a/examples/090/structural_files/firefox/00-proxy.yml b/examples/080/structural_files/firefox/00-proxy.yml similarity index 100% rename from examples/090/structural_files/firefox/00-proxy.yml rename to examples/080/structural_files/firefox/00-proxy.yml diff --git a/examples/028/structural_files/firefox/10-manual.yml b/examples/080/structural_files/firefox/10-manual.yml similarity index 100% rename from examples/028/structural_files/firefox/10-manual.yml rename to examples/080/structural_files/firefox/10-manual.yml diff --git a/examples/090/structural_files/firefox/20-manual.yml b/examples/080/structural_files/firefox/20-manual.yml similarity index 100% rename from examples/090/structural_files/firefox/20-manual.yml rename to examples/080/structural_files/firefox/20-manual.yml diff --git a/examples/090/structural_files/firefox/30-auto.yml b/examples/080/structural_files/firefox/30-auto.yml similarity index 100% rename from examples/090/structural_files/firefox/30-auto.yml rename to examples/080/structural_files/firefox/30-auto.yml diff --git a/examples/090/structural_files/firefox/40-no_proxy.yml b/examples/080/structural_files/firefox/40-no_proxy.yml similarity index 100% rename from examples/090/structural_files/firefox/40-no_proxy.yml rename to examples/080/structural_files/firefox/40-no_proxy.yml diff --git a/examples/090/structural_files/firefox/50-prompt_authentication.yml b/examples/080/structural_files/firefox/50-prompt_authentication.yml similarity index 100% rename from examples/090/structural_files/firefox/50-prompt_authentication.yml rename to examples/080/structural_files/firefox/50-prompt_authentication.yml diff --git a/examples/090/structural_files/firefox/55-proxy_dns_socks5.yml b/examples/080/structural_files/firefox/55-proxy_dns_socks5.yml similarity index 100% rename from examples/090/structural_files/firefox/55-proxy_dns_socks5.yml rename to examples/080/structural_files/firefox/55-proxy_dns_socks5.yml diff --git a/examples/080/structural_files/firefox/60-dns_over_https.yml b/examples/080/structural_files/firefox/60-dns_over_https.yml index 754f2a8..ccc4a5a 100644 --- a/examples/080/structural_files/firefox/60-dns_over_https.yml +++ b/examples/080/structural_files/firefox/60-dns_over_https.yml @@ -5,4 +5,31 @@ version: 1.1 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 + validators: + - jinja: |- + {% if dns_over_https.custom_dns_url.startswith('http://') %} + only https is allowed + {% endif %} + description: must starts with 'https://' only + disabled: + jinja: |- + {% if _.provider is propertyerror or _.provider != 'Custom' %} + provider is not custom + {% endif %} + description: if "dns_over_https.provider" is not "Custom" ... diff --git a/examples/081/README.md b/examples/081/README.md index 9215d09..86ff802 100644 --- a/examples/081/README.md +++ b/examples/081/README.md @@ -1 +1 @@ -A choice variable +Namespace diff --git a/examples/092/namespace b/examples/081/namespace similarity index 100% rename from examples/092/namespace rename to examples/081/namespace diff --git a/examples/092/structural_files/firefox/empty b/examples/081/structural_files/firefox/empty similarity index 100% rename from examples/092/structural_files/firefox/empty rename to examples/081/structural_files/firefox/empty diff --git a/examples/092/structural_files/firefox/empty.yml b/examples/081/structural_files/firefox/empty.yml similarity index 100% rename from examples/092/structural_files/firefox/empty.yml rename to examples/081/structural_files/firefox/empty.yml diff --git a/examples/082/README.md b/examples/082/README.md deleted file mode 100644 index 972da98..0000000 --- a/examples/082/README.md +++ /dev/null @@ -1 +0,0 @@ -A web_address variable diff --git a/examples/082/config/01/config.yaml b/examples/082/config/01/config.yaml deleted file mode 100644 index ed97d53..0000000 --- a/examples/082/config/01/config.yaml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/examples/083/README.md b/examples/083/README.md deleted file mode 100644 index c11c818..0000000 --- a/examples/083/README.md +++ /dev/null @@ -1 +0,0 @@ -A variable with custom validation diff --git a/examples/083/config/01/config.yaml b/examples/083/config/01/config.yaml deleted file mode 100644 index ed97d53..0000000 --- a/examples/083/config/01/config.yaml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/examples/083/config/02/config.yaml b/examples/083/config/02/config.yaml deleted file mode 100644 index aee4796..0000000 --- a/examples/083/config/02/config.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dns_over_https: - enable_dns_over_https: true diff --git a/examples/090/README.md b/examples/090/README.md deleted file mode 100644 index 8025287..0000000 --- a/examples/090/README.md +++ /dev/null @@ -1 +0,0 @@ -Variable in same family diff --git a/examples/090/TITLE.md b/examples/090/TITLE.md deleted file mode 100644 index 86ff802..0000000 --- a/examples/090/TITLE.md +++ /dev/null @@ -1 +0,0 @@ -Namespace diff --git a/examples/090/structural_files/firefox/10-manual.yml b/examples/090/structural_files/firefox/10-manual.yml deleted file mode 100644 index 047ff8a..0000000 --- a/examples/090/structural_files/firefox/10-manual.yml +++ /dev/null @@ -1,23 +0,0 @@ -%YAML 1.2 ---- -version: 1.1 - -manual: - description: Manual proxy configuration - disabled: - 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 -... diff --git a/examples/090/structural_files/firefox/60-dns_over_https.yml b/examples/090/structural_files/firefox/60-dns_over_https.yml deleted file mode 100644 index ccc4a5a..0000000 --- a/examples/090/structural_files/firefox/60-dns_over_https.yml +++ /dev/null @@ -1,35 +0,0 @@ -%YAML 1.2 ---- -version: 1.1 - -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 - validators: - - jinja: |- - {% if dns_over_https.custom_dns_url.startswith('http://') %} - only https is allowed - {% endif %} - description: must starts with 'https://' only - disabled: - jinja: |- - {% if _.provider is propertyerror or _.provider != 'Custom' %} - provider is not custom - {% endif %} - description: if "dns_over_https.provider" is not "Custom" -... diff --git a/examples/091/README.md b/examples/091/README.md deleted file mode 100644 index 8b40475..0000000 --- a/examples/091/README.md +++ /dev/null @@ -1 +0,0 @@ -Variable in parent family diff --git a/examples/091/structural_files/firefox/20-manual.yml b/examples/091/structural_files/firefox/20-manual.yml deleted file mode 100644 index 2bd707b..0000000 --- a/examples/091/structural_files/firefox/20-manual.yml +++ /dev/null @@ -1,43 +0,0 @@ -%YAML 1.2 ---- -version: 1.1 - -manual: - - use_for_https: true # Also use this proxy for HTTPS - - '{{ identifier }}_proxy': - description: '{{ identifier }} Proxy' - hidden: - jinja: |- - {% if my_identifier == 'HTTPS' and _.use_for_https %} - HTTPS is same has HTTP - {% endif %} - description: in HTTPS case if "manual.use_for_https" is set to True - params: - my_identifier: - type: identifier - dynamic: - - HTTPS - - SOCKS - - 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 deleted file mode 100644 index 86ff802..0000000 --- a/examples/092/README.md +++ /dev/null @@ -1 +0,0 @@ -Namespace