nginx-util: fix PROVIDES and issue #6905
nginx-ssl-util and nginx-ssl-util-nopcre are replacements for each other, but cannot replace nginx-util (instead conflict with it). The hard coded [::1] could lead to a nginx error if build without IPv6. So, get the loopback addresses dynamically. Signed-off-by: Peter Stadler <peter.stadler@student.uibk.ac.at>
This commit is contained in:
parent
5cd9d62f52
commit
f76f1e082d
3 changed files with 17 additions and 10 deletions
|
@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=nginx-util
|
PKG_NAME:=nginx-util
|
||||||
PKG_VERSION:=1.1
|
PKG_VERSION:=1.1
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
include $(INCLUDE_DIR)/cmake.mk
|
include $(INCLUDE_DIR)/cmake.mk
|
||||||
|
@ -13,13 +13,14 @@ define Package/nginx-util
|
||||||
SUBMENU:=Web Servers/Proxies
|
SUBMENU:=Web Servers/Proxies
|
||||||
TITLE:=Builder of LAN listen directives for Nginx
|
TITLE:=Builder of LAN listen directives for Nginx
|
||||||
DEPENDS:=+libstdcpp +libubus +libubox +libpthread
|
DEPENDS:=+libstdcpp +libubus +libubox +libpthread
|
||||||
PROVIDES:=nginx-util
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/nginx-ssl-util/default
|
define Package/nginx-ssl-util/default
|
||||||
$(Package/nginx-util)
|
$(Package/nginx-util)
|
||||||
TITLE+= and manager of its SSL certificates
|
TITLE+= and manager of its SSL certificates
|
||||||
DEPENDS+=+libopenssl
|
DEPENDS+= +libopenssl
|
||||||
|
CONFLICTS:=nginx-util
|
||||||
|
PROVIDES:=nginx-ssl-util
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/nginx-ssl-util-nopcre
|
define Package/nginx-ssl-util-nopcre
|
||||||
|
@ -30,7 +31,7 @@ endef
|
||||||
define Package/nginx-ssl-util
|
define Package/nginx-ssl-util
|
||||||
$(Package/nginx-ssl-util/default)
|
$(Package/nginx-ssl-util/default)
|
||||||
TITLE+= (using PCRE)
|
TITLE+= (using PCRE)
|
||||||
DEPENDS+=+libpcre
|
DEPENDS+= +libpcre
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/nginx-util/description
|
define Package/nginx-util/description
|
||||||
|
|
|
@ -13,6 +13,7 @@ void create_lan_listen()
|
||||||
std::string ssl_listen = listen;
|
std::string ssl_listen = listen;
|
||||||
std::string ssl_listen_default = listen;
|
std::string ssl_listen_default = listen;
|
||||||
|
|
||||||
|
#ifndef NO_UBUS
|
||||||
auto add_listen = [&listen, &listen_default
|
auto add_listen = [&listen, &listen_default
|
||||||
#ifdef NGINX_OPENSSL
|
#ifdef NGINX_OPENSSL
|
||||||
,&ssl_listen, &ssl_listen_default
|
,&ssl_listen, &ssl_listen_default
|
||||||
|
@ -31,10 +32,16 @@ void create_lan_listen()
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
add_listen("", "127.0.0.1", "");
|
auto loopback_status = ubus::call("network.interface.loopback", "status");
|
||||||
add_listen("[", "::1", "]");
|
|
||||||
|
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");
|
auto lan_status = ubus::call("network.interface.lan", "status");
|
||||||
|
|
||||||
for (auto ip : lan_status.filter("ipv4-address", "", "address")) {
|
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;
|
// std::cout<<std::endl;
|
||||||
|
|
||||||
// // example for exploring:
|
// // example for exploring:
|
||||||
// ubus::strings keys{"ipv4-address", "", "*"};
|
// ubus::strings keys{"ipv4-address", "", ""};
|
||||||
// for (auto x : ubus::call("network.interface.lan", "status").filter(keys)) {
|
// for (auto x : ubus::call("network.interface.lan", "status").filter(keys)) {
|
||||||
// std::cout<<blobmsg_name(x)<<": ";
|
// std::cout<<blobmsg_name(x)<<": ";
|
||||||
// switch (blob_id(x)) {
|
// switch (blob_id(x)) {
|
||||||
|
@ -173,8 +173,7 @@ private:
|
||||||
|
|
||||||
public:
|
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}
|
: keys{filter}, n{keys.size()-1}, pos{msg}, cur{this}
|
||||||
{
|
{
|
||||||
if (pos!=nullptr) {
|
if (pos!=nullptr) {
|
||||||
|
|
Loading…
Reference in a new issue