mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
obuspa: option to use system ca-bundle
This commit is contained in:
parent
d6edbf4e57
commit
8a759a67e4
4 changed files with 31 additions and 3 deletions
|
|
@ -30,4 +30,8 @@ config OBUSPA_MAX_CONTROLLERS_NUM
|
||||||
help
|
help
|
||||||
This value must be in range of 1 to 10. (default 5)
|
This value must be in range of 1 to 10. (default 5)
|
||||||
|
|
||||||
|
config OBUSPA_USE_CA_BUNDLE
|
||||||
|
bool "Use ca bundle from ca-certificates as trusted certificates in usp"
|
||||||
|
default y
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=obuspa
|
PKG_NAME:=obuspa
|
||||||
PKG_VERSION:=7.0.5.22
|
PKG_VERSION:=7.0.5.23
|
||||||
|
|
||||||
LOCAL_DEV:=0
|
LOCAL_DEV:=0
|
||||||
ifneq ($(LOCAL_DEV),1)
|
ifneq ($(LOCAL_DEV),1)
|
||||||
|
|
@ -32,7 +32,10 @@ define Package/obuspa
|
||||||
SUBMENU:=TRx69
|
SUBMENU:=TRx69
|
||||||
TITLE:=USP agent
|
TITLE:=USP agent
|
||||||
MENU:=1
|
MENU:=1
|
||||||
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl +ca-certificates
|
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl
|
||||||
|
ifeq ($(CONFIG_OBUSPA_USE_CA_BUNDLE),y)
|
||||||
|
DEPENDS+=+ca-certificates
|
||||||
|
endif
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/obuspa/description
|
define Package/obuspa/description
|
||||||
|
|
@ -112,6 +115,9 @@ ifeq ($(CONFIG_OBUSPA_ENABLE_TEST_CONTROLLER),y)
|
||||||
$(INSTALL_BIN) ./files/etc/init.d/usptest $(1)/etc/init.d/
|
$(INSTALL_BIN) ./files/etc/init.d/usptest $(1)/etc/init.d/
|
||||||
$(INSTALL_BIN) ./files/etc/uci-defaults/55-test-usp-controller $(1)/etc/uci-defaults/
|
$(INSTALL_BIN) ./files/etc/uci-defaults/55-test-usp-controller $(1)/etc/uci-defaults/
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(CONFIG_OBUSPA_USE_CA_BUNDLE),y)
|
||||||
|
$(INSTALL_BIN) ./files/etc/uci-defaults/70-configure-default-ca-bundle $(1)/etc/uci-defaults/
|
||||||
|
endif
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,obuspa))
|
$(eval $(call BuildPackage,obuspa))
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ config obuspa 'global'
|
||||||
option db_file '/etc/obuspa/usp.db'
|
option db_file '/etc/obuspa/usp.db'
|
||||||
option role_file '/etc/obuspa/roles.json'
|
option role_file '/etc/obuspa/roles.json'
|
||||||
option dm_caching_exclude '/etc/obuspa/dmcaching_exclude.json'
|
option dm_caching_exclude '/etc/obuspa/dmcaching_exclude.json'
|
||||||
option trust_cert '/etc/ssl/cert.pem'
|
#option trust_cert '/etc/ssl/cert.pem'
|
||||||
#option client_cert '/etc/obuspa/client.pem'
|
#option client_cert '/etc/obuspa/client.pem'
|
||||||
#option log_dest '/tmp/obuspa.log'
|
#option log_dest '/tmp/obuspa.log'
|
||||||
|
|
||||||
|
|
|
||||||
18
obuspa/files/etc/uci-defaults/70-configure-default-ca-bundle
Normal file
18
obuspa/files/etc/uci-defaults/70-configure-default-ca-bundle
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. /lib/functions.sh
|
||||||
|
|
||||||
|
CA="/etc/ssl/cert.pem"
|
||||||
|
|
||||||
|
if [ ! -f "/etc/config/obuspa" ]; then
|
||||||
|
echo "Local obuspa not available"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
uci_load obuspa
|
||||||
|
bundle="$(uci_get obuspa global trust_cert)"
|
||||||
|
if [ -z "${bundle}" ]; then
|
||||||
|
if [ -f "${CA}" ]; then
|
||||||
|
uci_set obuspa global trust_cert "${CA}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
Loading…
Add table
Reference in a new issue