Menu="OtherSettings" Title="Docker" Icon="icon-docker" Tag="icon-docker" --- /dev/null",$dummy,$DockerStopped); exec("ls --indicator-style=none /sys/class/net|awk '/^br[0-9]+$/'",$nics); $bridge = count($nics)>0; function strposX($s, $c, $n=1) { $p = 0; while ($n && $p=strpos($s,$c,$p)!==false) {$n--; $p+=strlen($c);} return $p; } unset($custom,$other); exec("ls --indicator-style=none /sys/class/net|grep -P '^br[0-9]'",$custom); exec("ls --indicator-style=none /sys/class/net|grep -P '^(bond|eth)[0-9]'",$other); $slaves = []; foreach ($other as $network) { if (substr($network,0,4)=='bond') { $br = str_replace('bond','br',$network); $bond = "/sys/class/net/$network/bonding/slaves"; if (file_exists($bond)) $slaves = array_merge($slaves,explode(' ',str_replace("\n","",file_get_contents($bond)))); if (!in_array($br,$custom)) $custom[] = $network; } else { $br = str_replace('eth','br',$network); $bond = str_replace('eth','bond',$network); if (!in_array($br,$custom) && !in_array($bond,$custom)) $custom[] = $network; } } $include = $include6 = $address = $address6 = $gateway = $gateway6 = $unset = $protocol = []; $wide = false; foreach ($custom as $network) { if (in_array($network,$slaves)) continue; $ip4 = exec("ip -br -4 addr show $network scope global|awk '{print $3}'"); $ip6 = exec("ip -br -6 addr show $network scope global|awk '{print $3}'"); $gw4 = $ip4 ? exec("ip -4 route show dev $network default|awk '{print $3;exit}'") : ''; $gw6 = $ip6 ? exec("ip -6 route show dev $network default|awk '{print $3;exit}'") : ''; $route4 = $ip4 ? exec("ip -4 route show dev $network $ip4|awk '{print $1;exit}'") : ''; $route6 = $ip6 ? exec("ip -6 route show dev $network|awk '/^".substr($ip6,0,strposX($ip6,':',4))."/{print $1;exit}'") : ''; [$eth,$vlan] = my_explode('.',$network); $eth = str_replace(['bond','br'],'eth',$eth); if (!$vlan) { $protocol[$network] = _var($$eth,'PROTOCOL:0','ipv4'); } else { foreach ($$eth as $key => $value) if (strpos($key,'VLANID')!==false && $value==$vlan) {$protocol[$network] = _var($$eth,str_replace('VLANID','PROTOCOL',$key),'ipv4'); break;} } if ($ip4 && $route4) { $include[$network] = $route4; $address[$network] = $ip4; $gateway[$network] = $gw4; } elseif (!array_key_exists($network,$gateway6)) { $unset[] = $network; } if ($ip6 && $route6) { $include6[$network] = $route6; $address6[$network] = $ip6; $gateway6[$network] = $gw6; } elseif (!array_key_exists($network,$gateway)) { $unset[] = $network; } if ($protocol[$network] != 'ipv4') $wide = true; } $ip4class = $wide ? 'ip6' : 'ip4'; $gw4class = $wide ? 'gw6' : 'gw4'; $unset = array_unique($unset); function normalize($network) { return strtoupper(str_replace('.','_',$network)); } function base_min($route) { [$net,$mask] = my_explode('/',$route); $mask = 32-$mask; return explode('.',long2ip((ip2long($net)>>$mask)<<$mask)); } function base_max($route) { [$net,$mask] = my_explode('/',$route); $mask = 32-$mask; return explode('.',long2ip(((ip2long($net)>>$mask)<<$mask)+pow(2,$mask)-1)); } function base_net($route) { return substr(explode('/',$route)[0],0,-2); } $bgcolor = strstr('white,azure',$display['theme']) ? '#f2f2f2' : '#1c1c1c'; ?>
_(Enable Docker)_: : _(One or more paths do not exist)_ (_(view)_) :docker_enable_help: _(Enable container table readmore-js)_: : :docker_readmore_help: _(Docker Stop Timeout)_ (_(seconds)_): : :docker_timeout_help: _(Docker data-root)_: : :docker_vdisk_type_help: _(Default appdata storage location)_: : _(Modify with caution: unable to validate path until Array is Started)_ _(Path does not exist)_ :docker_appdata_location_help:
_(Docker LOG rotation)_: : :docker_log_rotation_help: _(Template Authoring Mode)_: : :docker_authoring_mode_help: _(Docker custom network type)_: :  _(Please read the Help carefully)_. _(Misconfiguration can cause problems)_. :docker_custom_network_type_help: _(Host access to custom networks)_: :  _(Make sure you understand what you are doing before enabling)_. :docker_custom_network_access_help: _(Preserve user defined networks)_: : :docker_user_defined_network_help: $route):?> _(IPv4 custom network on interface)_ (_(optional)_): : > **_(Subnet)_:** **_(Gateway)_:** > **_(DHCP pool)_:**. "; for ($n=$net[$b]; $n<=$max[$b]; $n++) echo mk_option($net_user[$b],$n,$n,$n%$step==0?'':'class="hide"'); echo ""; } echo "/ "; echo "($size "._('hosts').")"; echo ""; ?> :docker_include_interface_vlan_ipv4_help: _(IPv4 custom network on interface)_ (_(optional)_): : > **_(Subnet)_:** >/ **_(Gateway)_:** " title="_(IPv4 address A.B.C.D)_"> > **_(DHCP pool)_:** >/ ( _(hosts)_) :docker_exclude_interface_vlan_ipv4_help:
$route):?> _(IPv6 custom network on interface)_ (_(optional)_): : > **_(Subnet)_:** **_(Gateway)_:** > **_(DHCP pool)_:**: / "; echo ""; ?> :docker_include_interface_vlan_ipv6_help: _(IPv6 custom network on interface)_ (_(optional)_): : > **_(Subnet)_:**>/ **_(Gateway)_:**" title="_(IPv6 address nnnn:xxxx::yyyy)_"> > **_(DHCP pool)_:**>/ :docker_exclude_interface_vlan_ipv6_help:
_(Docker version)_: : getInfo(); echo $arrInfo['Version']?> :docker_version_help: _(Docker vDisk location)_: : _(Docker directory)_: : :docker_vdisk_location_active_help: _(Default appdata storage location)_: : :docker_appdata_location_active_help:
_(Docker LOG rotation)_: : :docker_log_rotation_active_help: _(Docker custom network type)_: : :docker_custom_network_type_help: _(Host access to custom networks)_: : :docker_custom_network_access_help: _(Preserve user defined networks)_: : :docker_user_defined_network_help: $route):?> _(IPv4 custom network on interface)_ : : **_(Subnet)_:** **_(Gateway)_:** **_(DHCP pool)_:**   ( _(hosts)_) $value) { if (strpos($key,'VLANID')!==false && $value==$vlan) {$protocol = _var($$eth,str_replace('VLANID','PROTOCOL',$key),'ipv4'); break;} } } [$subnet,$mask] = my_explode('/',_var($dockercfg,"DOCKER_SUBNET_$port")); [$range,$size] = my_explode('/',_var($dockercfg,"DOCKER_RANGE_$port")); ?> _(IPv4 custom network on interface)_ : : **_(Subnet)_:** / **_(Gateway)_:** **_(DHCP pool)_:**   ( _(hosts)_) $route):?> _(IPv6 custom network on interface)_ : : **_(Subnet)_:** **_(Gateway)_:** **_(DHCP pool)_:** $value) { if (strpos($key,'VLANID')!==false && $value==$vlan) {$protocol = _var($$eth,str_replace('VLANID','PROTOCOL',$key),'ipv4'); break;} } } [$subnet6,$mask6] = my_explode('/',_var($dockercfg,"DOCKER_SUBNET6_$port")); [$range6,$size6] = my_explode('/',_var($dockercfg,"DOCKER_RANGE6_$port")); ?> _(IPv6 custom network on interface)_ : : **_(Subnet)_:** / **_(Gateway)_:** **_(DHCP pool)_:**
  :
_(Docker volume info)_
_(btrfs filesystem show)_: : ".shell_exec("btrfs filesystem show /var/lib/docker").""?>
_(btrfs scrub status)_: : ".implode("\n", $scrub_status).""?>   : :docker_scrub_help:   : :docker_cancel_help: