Merge pull request #11092 from peter-stadler/nginx-util
nginx-util: fix PROVIDES variable and failure with ipv6 disabled
This commit is contained in:
commit
fd30aa5f02
3 changed files with 17 additions and 10 deletions
|
@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_NAME:=nginx-util
|
||||
PKG_VERSION:=1.1
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
@ -13,13 +13,14 @@ define Package/nginx-util
|
|||
SUBMENU:=Web Servers/Proxies
|
||||
TITLE:=Builder of LAN listen directives for Nginx
|
||||
DEPENDS:=+libstdcpp +libubus +libubox +libpthread
|
||||
PROVIDES:=nginx-util
|
||||
endef
|
||||
|
||||
define Package/nginx-ssl-util/default
|
||||
$(Package/nginx-util)
|
||||
TITLE+= and manager of its SSL certificates
|
||||
DEPENDS+=+libopenssl
|
||||
DEPENDS+= +libopenssl
|
||||
CONFLICTS:=nginx-util
|
||||
PROVIDES:=nginx-ssl-util
|
||||
endef
|
||||
|
||||
define Package/nginx-ssl-util-nopcre
|
||||
|
@ -30,7 +31,7 @@ endef
|
|||
define Package/nginx-ssl-util
|
||||
$(Package/nginx-ssl-util/default)
|
||||
TITLE+= (using PCRE)
|
||||
DEPENDS+=+libpcre
|
||||
DEPENDS+= +libpcre
|
||||
endef
|
||||
|
||||
define Package/nginx-util/description
|
||||
|
|
|
@ -13,6 +13,7 @@ void create_lan_listen()
|
|||
std::string ssl_listen = listen;
|
||||
std::string ssl_listen_default = listen;
|
||||
|
||||
#ifndef NO_UBUS
|
||||
auto add_listen = [&listen, &listen_default
|
||||
#ifdef NGINX_OPENSSL
|
||||
,&ssl_listen, &ssl_listen_default
|
||||
|
@ -31,10 +32,16 @@ void create_lan_listen()
|
|||
#endif
|
||||
};
|
||||
|
||||
add_listen("", "127.0.0.1", "");
|
||||
add_listen("[", "::1", "]");
|
||||
auto loopback_status = ubus::call("network.interface.loopback", "status");
|
||||
|
||||
for (auto ip : loopback_status.filter("ipv4-address", "", "address")) {
|
||||
add_listen("", static_cast<const char *>(blobmsg_data(ip)), "");
|
||||
}
|
||||
|
||||
for (auto ip : loopback_status.filter("ipv6-address", "", "address")) {
|
||||
add_listen("[", static_cast<const char *>(blobmsg_data(ip)), "]");
|
||||
}
|
||||
|
||||
#ifndef NO_UBUS
|
||||
auto lan_status = ubus::call("network.interface.lan", "status");
|
||||
|
||||
for (auto ip : lan_status.filter("ipv4-address", "", "address")) {
|
||||
|
|
|
@ -31,7 +31,7 @@ extern "C" { //TODO(pst): remove when in upstream
|
|||
// std::cout<<std::endl;
|
||||
|
||||
// // example for exploring:
|
||||
// ubus::strings keys{"ipv4-address", "", "*"};
|
||||
// ubus::strings keys{"ipv4-address", "", ""};
|
||||
// for (auto x : ubus::call("network.interface.lan", "status").filter(keys)) {
|
||||
// std::cout<<blobmsg_name(x)<<": ";
|
||||
// switch (blob_id(x)) {
|
||||
|
@ -173,8 +173,7 @@ private:
|
|||
|
||||
public:
|
||||
|
||||
|
||||
explicit iterator(const blob_attr * msg, const strings & filter)
|
||||
explicit iterator(const blob_attr * msg, const strings & filter={""})
|
||||
: keys{filter}, n{keys.size()-1}, pos{msg}, cur{this}
|
||||
{
|
||||
if (pos!=nullptr) {
|
||||
|
|
Loading…
Reference in a new issue