diff --git a/owsd/Makefile b/owsd/Makefile index 7d45d4113..72f5a5319 100644 --- a/owsd/Makefile +++ b/owsd/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=owsd -PKG_VERSION:=0.97 +PKG_VERSION:=0.98 PKG_RELEASE:=1 PKG_SOURCE_PROTO=git PKG_SOURCE_URL:=git@public.inteno.se:owsd.git -PKG_SOURCE_VERSION:=40487a5d2d6541451095b9afcb23fd0d8395fde2 +PKG_SOURCE_VERSION:=07da8de7d41775fd07eacbad77b2c21963f34f7a PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION} PKG_MAINTAINER:=Sartura Support for Inteno diff --git a/owsd/files/owsd.init b/owsd/files/owsd.init index 611df1a97..75f6f55e9 100644 --- a/owsd/files/owsd.init +++ b/owsd/files/owsd.init @@ -22,12 +22,16 @@ validate_owsd_iface() { 'port:port' \ 'interface:string' \ 'origin:list(string)' \ - 'cert:string' \ - 'key:string' + 'whitelist_interface_as_origin:bool' \ + 'ipv6:bool' \ + 'cert:file' \ + 'key:file' } +. /lib/functions/network.sh + parse_owsd_iface() { - local port interface cert key + local port interface whitelist_interface_as_origin ipv6 cert key validate_owsd_iface "$1" || { echo "Validation failed" @@ -36,9 +40,23 @@ parse_owsd_iface() { [ -n "${port}" ] && procd_append_param command -p "${port}" [ -n "${interface}" ] && procd_append_param command -i "${interface}" + [ -n "${ipv6}" ] && procd_append_param command -6 [ -n "${cert}" ] && procd_append_param command -c "${cert}" [ -n "${key}" ] && procd_append_param command -k "${key}" + if [ -n "${interface}" ] && [ -n "$whitelist_interface_as_origin" ]; then + local ip4addrs ip6addrs + + if network_get_ipaddrs ip4addrs "${interface}"; then for addr in $ip4addrs; do + append_origin "http${cert:+s}://${addr}:${port}" + # TODO allow omitting default ports + done; fi + if [ -n "$ipv6}" ] && network_get_ip6addrs ip6addrs "${interface}"; then for addr in $ip6addrs; do + append_origin "http${cert:+s}://[[${addr}]]:${port}" + # TODO allow omitting default ports + done; fi + fi + config_list_foreach "$1" "origin" append_origin }