From f9531f38a77a00d1c2ac95df93b1f8c89200eab7 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Tue, 15 Sep 2015 20:45:30 +0200 Subject: avahi - expose many more config options in GUI Resubmit of PR #1030. --- config/avahi/avahi.xml | 211 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 196 insertions(+), 15 deletions(-) diff --git a/config/avahi/avahi.xml b/config/avahi/avahi.xml index 0b49fea3..0c18e097 100644 --- a/config/avahi/avahi.xml +++ b/config/avahi/avahi.xml @@ -51,7 +51,7 @@ Avahi Modify avahi settings.
Services
- pkg_edit.php?xml=avahi.xml&id=0 + pkg_edit.php?xml=avahi.xml avahi @@ -72,6 +72,10 @@ https://packages.pfsense.org/packages/config/avahi/services/sftp-ssh.service + + Server Options + listtopic + Enable enable @@ -79,55 +83,232 @@ checkbox - Browse domains (comma separated) + Browse Domains browsedomains - (Example: local, pfsense.org, mydomain.com) + Enter the (comma separated) list of domains that you would like proxied. (Example: local, pfsense.org, mydomain.com)
+ (Default: local) ]]>
input + local
Deny interfaces denyinterfaces NOTE: WAN is always disabled (so it is not shown here). + Interfaces that you do NOT want Avahi to listen on.
+ Note: WAN is always disabled (so it is not shown here). ]]>
interfaces_selection - wan + (wan|loopback) true
- Disable IPv6 - disable_ipv6 - Disable IPv6 support in Avahi. + Enable IPv4 + enable_ipv4 + Enable IPv4 support in Avahi. (Default: enabled) checkbox + on + publish_aaaa_on_ipv4 - Disable IPv4 - disable_ipv4 - Disable IPv4 support in Avahi. + Enable IPv6 + enable_ipv6 + Enable IPv6 support in Avahi. (Default: enabled) checkbox + on + publish_a_on_ipv6 - Disable D-BUS + Disable D-Bus disable_dbus - Disable D-BUS client API support in Avahi. + Disable D-Bus client API support in Avahi. (Default: no) + checkbox + + + Wide Area + listtopic + + + Enable Wide-Area DNS-SD + enable_wide_area + + + If you want to maintain multiple different multicast DNS domains even with this option enabled, + use subdomains of .local, such as "kitchen.local".
+ (Default: enabled) + ]]> +
+ checkbox + on +
+ + Publishing Options + listtopic + + + Disable Publishing + disable_publishing + + + You can use this is a security measure. Warning: Do NOT disable publishing unless you know what you are doing!
+ (Default: no) + ]]> +
+ checkbox + off +
+ + Disable User Service Publishing + disable_user_service_publishing + + + (Default: no) + ]]> + + checkbox + off + + + Add Service Cookie + add_service_cookie + + + (Default: disabled) + ]]> + + checkbox + off + + + Publish Addresses + publish_addresses + + + (Default: enabled) + ]]> + + checkbox + on + + + Publish HINFO + publish_hinfo + + + This is recommended by the mDNS specification but not required. For the sake of privacy you might choose to disable this feature.
+ (Default: enabled) + ]]> +
+ checkbox + on +
+ + Publish Workstation + publish_workstation + + + (Default: enabled) + ]]> + + checkbox + on + + + Publish DNS Servers + publish_resolv_conf_dns_servers + + + When used in conjunction with avahi-dnsconfd on the client side this allows DHCP-like configuration of unicast DNS servers.
+ (Default: disabled) + ]]> +
+ checkbox + off +
+ + Publish AAAA records on IPv4 + publish_aaaa_on_ipv4 + + + (Default: enabled) + ]]> + + checkbox + on + + + Publish A records on IPv6 + publish_a_on_ipv6 + + + (Default: disabled) + ]]> + + checkbox + off + + + Reflector Options + listtopic + + + Enable Reflector + enable_reflector + + + (Default: enabled) + ]]> + + checkbox + on + + + Reflect IPv + reflect_ipv + + + (Default: disabled) + ]]> + checkbox + off
avahi_sync(); + avahi_upgrade_config(); avahi_install(); avahi_deinstall(); + + avahi_validate_input($_POST, $input_errors); + -- cgit v1.2.3 From f12a5229a66ecdd30673255e7fa0b7ea71663b93 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Tue, 15 Sep 2015 20:46:28 +0200 Subject: avahi - expose many more config options in GUI --- config/avahi/avahi.inc | 118 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 91 insertions(+), 27 deletions(-) diff --git a/config/avahi/avahi.inc b/config/avahi/avahi.inc index 4c824e71..ba89676f 100644 --- a/config/avahi/avahi.inc +++ b/config/avahi/avahi.inc @@ -63,23 +63,36 @@ function avahi_deinstall() { } function avahi_write_config() { - global $config; + global $config, $avahi_config; conf_mount_rw(); // Pull some various values out of config.xml + if (isset($config['installedpackages']['avahi']['config'][0])) { + $avahi_config = $config['installedpackages']['avahi']['config'][0]; + } + // Server Options $hostname = $config['system']['hostname']; $domain = $config['system']['domain']; - $enable = $config['installedpackages']['avahi']['config'][0]['enable']; - $browsedomains = $config['installedpackages']['avahi']['config'][0]['browsedomains']; - $denyif = $config['installedpackages']['avahi']['config'][0]['denyinterfaces']; - $useipv4 = ($config['installedpackages']['avahi']['config'][0]['disable_ipv4']) ? "no" : "yes"; - $useipv6 = ($config['installedpackages']['avahi']['config'][0]['disable_ipv6']) ? "no" : "yes"; - $usedbus = ($config['installedpackages']['avahi']['config'][0]['disable_dbus']) ? "no" : "yes"; - - // No supplied domains? Use the defaults. - if (!$browsedomains) { - $browsedomains = "local, 0pointer.de, zeroconf.org"; - } + $enable = $avahi_config['enable']; + $browsedomains = $avahi_config['browsedomains'] ?: "local"; + $denyif = $avahi_config['denyinterfaces']; + $useipv4 = ($avahi_config['enable_ipv4']) ? "yes" : "no"; + $useipv6 = ($avahi_config['enable_ipv6']) ? "yes" : "no"; + $usedbus = ($avahi_config['disable_dbus']) ? "no" : "yes"; + // Wide Area + $widearea = ($avahi_config['enable_wide_area']) ? "yes" : "no"; + // Publishing Options + $publish = ($avahi_config['disable_publishing']) ? "no" : "yes"; + $userpublish = ($avahi_config['disable_user_service_publishing']) ? "no" : "yes"; + $addresspublish = ($avahi_config['publish_addresses']) ? "yes" : "no"; + $cookie = ($avahi_config['add_service_cookie']) ? "yes" : "no"; + $hinfopublish = ($avahi_config['publish_hinfo']) ? "yes" : "no"; + $wspublish = ($avahi_config['publish_workstation']) ? "yes" : "no"; + $aaaaonv4 = ($avahi_config['publish_aaaa_on_ipv4']) ? "yes" : "no"; + $aonv6 = ($avahi_config['publish_a_on_ipv6']) ? "yes" : "no"; + // Reflector Options + $reflect = ($avahi_config['enable_reflector']) ? "yes" : "no"; + $reflectipv = ($avahi_config['reflect_ipv']) ? "yes" : "no"; // Never pass along WAN. Bad. $denyinterfaces = $config['interfaces']['wan']['if']; @@ -94,6 +107,15 @@ function avahi_write_config() { } } } + + // Process DNS servers and omit localhost if present in /etc/resolv.conf + $publishdns = ''; + $dns = implode(" ", get_dns_servers()); + $dns = trim(str_replace('127.0.0.1', '', $dns)); + $dns = str_replace(' ', ', ', $dns); + if ($dns) { + $publishdns = "publish-dns-servers={$dns}"; + } // Construct the avahi configuration $avahiconfig = << 0 ) { + write_config("[avahi] Upgraded old package configuration."); + } +} + +function avahi_validate_input($post, &$input_errors) { + if (($post['enable_ipv4'] != "on" ) && ($post['enable_ipv6'] != "on" )) { + $input_errors[] = gettext("You cannot disable both IPv4 and IPv6!"); + } + if (($post['enable_ipv4'] != "on" ) && ($post['publish_aaaa_on_ipv4'] == "on" )) { + $input_errors[] = gettext("'Publish AAAA records on IPv4' makes no sense with IPv4 disabled."); + } + if (($post['enable_ipv6'] != "on" ) && ($post['publish_a_on_ipv6'] == "on" )) { + $input_errors[] = gettext("'Publish A records on IPv6' makes no sense with IPv6 disabled."); + } +} + ?> -- cgit v1.2.3 From a74e24aa68fe5eec9b1cbf0be63dc56cce781863 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Tue, 15 Sep 2015 20:47:33 +0200 Subject: Bump avahi package version --- pkg_config.10.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg_config.10.xml b/pkg_config.10.xml index 54731866..4417b18f 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -261,7 +261,7 @@ net/avahi-app devel/dbus avahi-0.6.31-##ARCH##.pbi - 1.10.1 + 1.10.2 BETA 2.2 https://packages.pfsense.org/packages/config/avahi/avahi.xml -- cgit v1.2.3 From 1d4d53538064c081134b31b675787c7919b0f05c Mon Sep 17 00:00:00 2001 From: doktornotor Date: Tue, 15 Sep 2015 20:48:35 +0200 Subject: Bump avahi package version --- pkg_config.8.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg_config.8.xml b/pkg_config.8.xml index fde529cb..93aa23d0 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -316,7 +316,7 @@ avahi-app-0.6.29_1.tbz avahi-0.6.31-i386.pbi - 0.6.31 pkg v1.08 + 0.6.31 pkg v1.10.2 ALPHA 1.2.3 https://packages.pfsense.org/packages/config/avahi/avahi.xml -- cgit v1.2.3 From f38c9f21aec51b66e7cca29ea1be42031b81f97b Mon Sep 17 00:00:00 2001 From: doktornotor Date: Tue, 15 Sep 2015 20:49:29 +0200 Subject: Bump avahi package version --- pkg_config.8.xml.amd64 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index 1d6d070a..35bed49c 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -303,7 +303,7 @@ avahi-0.6.29.tbz avahi-0.6.31-amd64.pbi - 0.6.31 pkg v1.08 + 0.6.31 pkg v1.10.2 ALPHA 1.2.3 https://packages.pfsense.org/packages/config/avahi/avahi.xml -- cgit v1.2.3