2026-03-18 19:21:25 +01:00
from tiramisu import *
from tiramisu . setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail . tiramisu import func , dict_env , load_functions , ConvertDynOptionDescription
try :
groups . namespace
except :
groups . addgroup ( ' namespace ' )
ALLOWED_LEADER_PROPERTIES . add ( " basic " )
ALLOWED_LEADER_PROPERTIES . add ( " standard " )
ALLOWED_LEADER_PROPERTIES . add ( " advanced " )
option_1 = ChoiceOption ( name = " proxy_mode " , doc = " Configure Proxy Access to the Internet " , values = ( " No proxy " , " Auto-detect proxy settings for this network " , " Use system proxy settings " , " Manual proxy configuration " , " Automatic proxy configuration URL " ) , default = " No proxy " , properties = frozenset ( { " mandatory " , " standard " } ) , informations = { ' ymlfiles ' : [ ' tutorial_tmp/structural/firefox/00-proxy.yml ' ] , ' type ' : ' choice ' } )
2026-03-25 21:16:12 +01:00
option_4 = DomainnameOption ( name = " address " , doc = " Proxy address " , type = " domainname " , allow_ip = True , properties = frozenset ( { " basic " , " mandatory " } ) , informations = { ' ymlfiles ' : [ ' tutorial_tmp/types/00-type.yml ' , ' tutorial_tmp/structural/firefox/10-manual.yml ' ] , ' type ' : ' domainname ' } )
option_5 = PortOption ( name = " port " , doc = " Proxy port " , default = " 8080 " , allow_private = True , properties = frozenset ( { " mandatory " , " standard " } ) , informations = { ' ymlfiles ' : [ ' tutorial_tmp/types/00-type.yml ' , ' tutorial_tmp/structural/firefox/10-manual.yml ' ] , ' type ' : ' port ' } )
optiondescription_3 = OptionDescription ( name = " http_proxy " , doc = " HTTP Proxy " , children = [ option_4 , option_5 ] , properties = frozenset ( { " basic " } ) , informations = { ' ymlfiles ' : [ ' tutorial_tmp/types/00-type.yml ' , ' tutorial_tmp/structural/firefox/10-manual.yml ' ] } )
2026-03-18 19:21:25 +01:00
option_6 = BoolOption ( name = " use_for_https " , doc = " Also use this proxy for HTTPS " , default = True , properties = frozenset ( { " mandatory " , " standard " } ) , informations = { ' ymlfiles ' : [ ' tutorial_tmp/structural/firefox/20-manual.yml ' ] , ' type ' : ' boolean ' } )
2026-03-25 21:16:12 +01:00
option_8 = DomainnameOption ( name = " address " , doc = " Proxy address " , default = Calculation ( func [ ' calc_value ' ] , Params ( ( ParamOption ( option_4 ) ) ) ) , type = " domainname " , allow_ip = True , properties = frozenset ( { " force_default_on_freeze " , " mandatory " , " standard " , Calculation ( func [ ' variable_to_property ' ] , Params ( ( ) , kwargs = { ' value ' : ParamOption ( option_6 ) , ' prop ' : ParamValue ( " frozen " ) , ' when ' : ParamValue ( True ) , ' inverse ' : ParamValue ( False ) } ) , help_function = func [ ' variable_to_property ' ] ) } ) , informations = { ' ymlfiles ' : [ ' tutorial_tmp/types/00-type.yml ' , ' tutorial_tmp/structural/firefox/20-manual.yml ' ] , ' type ' : ' domainname ' } )
option_9 = PortOption ( name = " port " , doc = " Proxy port " , default = Calculation ( func [ ' calc_value ' ] , Params ( ( ParamOption ( option_5 ) ) ) ) , allow_private = True , properties = frozenset ( { " force_default_on_freeze " , " mandatory " , " standard " , Calculation ( func [ ' variable_to_property ' ] , Params ( ( ) , kwargs = { ' value ' : ParamOption ( option_6 ) , ' prop ' : ParamValue ( " frozen " ) , ' when ' : ParamValue ( True ) , ' inverse ' : ParamValue ( False ) } ) , help_function = func [ ' variable_to_property ' ] ) } ) , informations = { ' ymlfiles ' : [ ' tutorial_tmp/types/00-type.yml ' , ' tutorial_tmp/structural/firefox/20-manual.yml ' ] , ' type ' : ' port ' } )
optiondescription_7 = OptionDescription ( name = " https_proxy " , doc = " HTTPS Proxy " , children = [ option_8 , option_9 ] , properties = frozenset ( { " standard " , Calculation ( func [ ' variable_to_property ' ] , Params ( ( ) , kwargs = { ' value ' : ParamOption ( option_6 ) , ' prop ' : ParamValue ( " hidden " ) , ' when ' : ParamValue ( True ) , ' inverse ' : ParamValue ( False ) } ) , help_function = func [ ' variable_to_property ' ] ) } ) , informations = { ' ymlfiles ' : [ ' tutorial_tmp/types/00-type.yml ' , ' tutorial_tmp/structural/firefox/20-manual.yml ' ] } )
option_11 = DomainnameOption ( name = " address " , doc = " Proxy address " , default = Calculation ( func [ ' calc_value ' ] , Params ( ( ParamOption ( option_4 ) ) ) ) , type = " domainname " , allow_ip = True , properties = frozenset ( { " mandatory " , " standard " } ) , informations = { ' ymlfiles ' : [ ' tutorial_tmp/types/00-type.yml ' , ' tutorial_tmp/structural/firefox/20-manual.yml ' ] , ' type ' : ' domainname ' } )
option_12 = PortOption ( name = " port " , doc = " Proxy port " , default = Calculation ( func [ ' calc_value ' ] , Params ( ( ParamOption ( option_5 ) ) ) ) , allow_private = True , properties = frozenset ( { " mandatory " , " standard " } ) , informations = { ' ymlfiles ' : [ ' tutorial_tmp/types/00-type.yml ' , ' tutorial_tmp/structural/firefox/20-manual.yml ' ] , ' type ' : ' port ' } )
2026-03-18 19:21:25 +01:00
option_13 = ChoiceOption ( name = " version " , doc = " SOCKS host version used by proxy " , values = ( " v4 " , " v5 " ) , default = " v5 " , properties = frozenset ( { " mandatory " , " standard " } ) , informations = { ' ymlfiles ' : [ ' tutorial_tmp/structural/firefox/20-manual.yml ' ] , ' type ' : ' choice ' } )
2026-03-25 21:16:12 +01:00
optiondescription_10 = OptionDescription ( name = " socks_proxy " , doc = " SOCKS Proxy " , children = [ option_11 , option_12 , option_13 ] , properties = frozenset ( { " standard " } ) , informations = { ' ymlfiles ' : [ ' tutorial_tmp/types/00-type.yml ' , ' tutorial_tmp/structural/firefox/20-manual.yml ' ] } )
2026-03-18 19:21:25 +01:00
optiondescription_2 = OptionDescription ( name = " manual " , doc = " Manual proxy configuration " , children = [ optiondescription_3 , option_6 , optiondescription_7 , optiondescription_10 ] , properties = frozenset ( { " basic " , Calculation ( func [ ' variable_to_property ' ] , Params ( ( ) , kwargs = { ' value ' : ParamOption ( option_1 ) , ' prop ' : ParamValue ( " disabled " ) , ' when ' : ParamValue ( " Manual proxy configuration " ) , ' inverse ' : ParamValue ( True ) } ) , help_function = func [ ' variable_to_property ' ] ) } ) , informations = { ' ymlfiles ' : [ ' tutorial_tmp/structural/firefox/10-manual.yml ' , ' tutorial_tmp/structural/firefox/20-manual.yml ' ] } )
option_14 = URLOption ( name = " auto " , doc = " Automatic proxy configuration URL " , allow_ip = False , allow_without_dot = True , properties = frozenset ( { " basic " , " mandatory " , Calculation ( func [ ' variable_to_property ' ] , Params ( ( ) , kwargs = { ' value ' : ParamOption ( option_1 ) , ' prop ' : ParamValue ( " disabled " ) , ' when ' : ParamValue ( " Automatic proxy configuration URL " ) , ' inverse ' : ParamValue ( True ) } ) , help_function = func [ ' variable_to_property ' ] ) } ) , informations = { ' ymlfiles ' : [ ' tutorial_tmp/structural/firefox/30-auto.yml ' ] , ' type ' : ' web_address ' } )
option_15 = DomainnameOption ( name = " no_proxy " , doc = " Address for which proxy will be desactivated " , multi = True , type = " domainname " , allow_ip = True , allow_cidr_network = True , allow_without_dot = True , allow_startswith_dot = True , properties = frozenset ( { " standard " , Calculation ( func [ ' variable_to_property ' ] , Params ( ( ) , kwargs = { ' value ' : ParamOption ( option_1 ) , ' __internal_multi ' : ParamValue ( True ) , ' prop ' : ParamValue ( " disabled " ) , ' when ' : ParamValue ( " No proxy " ) , ' inverse ' : ParamValue ( False ) } ) , help_function = func [ ' variable_to_property ' ] ) } ) , informations = { ' ymlfiles ' : [ ' tutorial_tmp/structural/firefox/40-no_proxy.yml ' ] , ' type ' : ' domainname ' , ' examples ' : ( ' .mozilla.org ' , ' .net.nz ' , ' 192.168.1.0/24 ' ) , ' help ' : ' Connections to localhost, 127.0.0.1/8 and ::1 are never proxied ' } )
option_0 = OptionDescription ( name = " baseoption " , doc = " baseoption " , children = [ option_1 , optiondescription_2 , option_14 , option_15 ] )