Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 1.64 KB

File metadata and controls

53 lines (34 loc) · 1.64 KB

Lua script for Voluapt usage

Script global.lua

Script will display on standard output lua globals, and content of context global variable created by Voluapt.

Example of calling context.find_proxy_for_url() function to find HTTP proxy for a URL. Result is formatted and printed on standard output.

From a predefined list of URL git match and a test URL, a git configuration file will be generated with a series of definition like this one:

[http "https://*.example.com"]
    proxy = http://proxy.corp:8080

Call this script with -Doutfile=/path/to/file.gitconfig, then define an include entry in user global git configuration in ~/.gitconfig or $XDG_CONFIG_HOME/git/config:

[include]
    path = /path/to/file.gitconfig

Both scripts will generate content of environment variables: HTTP_PROXY, HTTPS_PROXY, FTP_PROXY and NO_PROXY.

Use -Doutfile=proxy-settings.bat for dos batch, and, -Doutfile=proxy-settings.ps1 for PowerShell. Then, you can use them this way:

  • call proxy-settings.bat to define environment variables for console
  • . /path/to/proxy-settings.ps1 to merge new environment variables

Scripts miscellaneous

Those tools do not support nested configuration file. Use those samples to generate your own configuration.