nginx: enable ssl for all variants and remove nginx-util w/o ssl

Make the plain nginx version the same as nginx-ssl.
In a further change we will replace nginx by a dummy package,
depending on +nginx-ssl instead. This allows a smooth upgrade.

For nginx-util leave the ssl and the ssl-nopcre versions only.
For nginx-mod-luci remove the duplicate ssl version.
Replace the removed packages by dummies for a smooth upgrade.
The dummy packages will be removed after a transition period.

Additionally, enable the http2 module for nginx-ssl by default
and cleanup the nginx.init file.

Signed-off-by: Peter Stadler <peter.stadler@student.uibk.ac.at>
This commit is contained in:
Peter Stadler
2020-05-21 20:21:59 +02:00
parent c260f2f294
commit 3603f50fd5
9 changed files with 144 additions and 471 deletions

View File

@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=nginx-util
PKG_VERSION:=1.4
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_MAINTAINER:=Peter Stadler <peter.stadler@student.uibk.ac.at>
include $(INCLUDE_DIR)/package.mk
@@ -12,26 +12,16 @@ CMAKE_OPTIONS+= -DUBUS=y
CMAKE_OPTIONS+= -DVERSION=$(PKG_VERSION)
define Package/nginx-util/default
define Package/nginx-ssl-util/default
SECTION:=net
CATEGORY:=Network
SUBMENU:=Web Servers/Proxies
TITLE:=Nginx configurator
DEPENDS:=+libstdcpp +libubus +libubox +libpthread
endef
define Package/nginx-util
$(Package/nginx-util/default)
CONFLICTS:=nginx-ssl-util-nopcre nginx-ssl-util
endef
define Package/nginx-ssl-util/default
$(Package/nginx-util/default)
TITLE+= including SSL
DEPENDS+= +libopenssl
CONFLICTS:=nginx-util,
TITLE:=Nginx configurator including SSL
DEPENDS:=+libstdcpp +libubus +libubox +libpthread +libopenssl
# TODO: remove after a transition period (together with below and pkg nginx):
# It actually removes nginx-util (replacing it by a dummy pkg) to avoid
# conflicts with nginx-ssl-util*
EXTRA_DEPENDS:=nginx-util (>=1.4-2)
endef
@@ -39,25 +29,22 @@ define Package/nginx-ssl-util
$(Package/nginx-ssl-util/default)
TITLE+= (using PCRE)
DEPENDS+= +libpcre
CONFLICTS+= nginx-ssl-util-nopcre,
CONFLICTS:=nginx-ssl-util-nopcre,
endef
define Package/nginx-ssl-util-nopcre
$(Package/nginx-ssl-util/default)
TITLE+= (using <regex>)
CONFLICTS+= nginx-ssl-util
CONFLICTS:=nginx-ssl-util
endef
define Package/nginx-util/description
define Package/nginx-ssl-util/default/description
Utility that builds dynamically LAN listen directives for Nginx.
endef
Package/nginx-ssl-util/default/description = $(Package/nginx-util/description)\
Furthermore, it manages SSL directives for its server parts and can create \
Furthermore, it manages SSL directives for its server parts and can create
corresponding (self-signed) certificates.
endef
Package/nginx-ssl-util/description = \
@@ -70,12 +57,6 @@ Package/nginx-ssl-util-nopcre/description = \
It uses the standard regex library of C++.
define Package/nginx-util/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/nginx-util $(1)/usr/bin/nginx-util
endef
define Package/nginx-ssl-util/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/nginx-ssl-util $(1)/usr/bin/nginx-util
@@ -89,6 +70,21 @@ define Package/nginx-ssl-util-nopcre/install
endef
$(eval $(call BuildPackage,nginx-util))
$(eval $(call BuildPackage,nginx-ssl-util))
$(eval $(call BuildPackage,nginx-ssl-util-nopcre))
# TODO: remove after a transition period (together with above and pkg nginx):
# It replaces nginx-util by a dummy pkg for a smooth upgrade of nginx*
define Package/nginx-util
TITLE:=Dummy package for removing nginx-util when upgrading.
DEPENDS:=+libstdcpp +libubus +libubox +libpthread
PKGARCH:=all
endef
define Package/nginx-util/install
$(INSTALL_DIR) $(1)/usr/bin
endef
$(eval $(call BuildPackage,nginx-util))

View File

@@ -23,11 +23,6 @@ FIND_PATH(ubox_include_dir libubox/blobmsg.h)
FIND_LIBRARY(ubox NAMES ubox)
INCLUDE_DIRECTORIES(${ubox_include_dir})
ADD_EXECUTABLE(nginx-util nginx-util.cpp)
TARGET_COMPILE_DEFINITIONS(nginx-util PUBLIC -DNO_SSL)
TARGET_LINK_LIBRARIES(nginx-util ${ubox} ${ubus} pthread)
INSTALL(TARGETS nginx-util RUNTIME DESTINATION bin)
ADD_EXECUTABLE(nginx-ssl-util nginx-util.cpp)
TARGET_LINK_LIBRARIES(nginx-ssl-util ${ubox} ${ubus} pthread ssl crypto pcre)
INSTALL(TARGETS nginx-ssl-util RUNTIME DESTINATION bin)