From: Jianhui Zhao Date: Thu, 25 Jun 2026 11:09:01 +0000 (+0800) Subject: rtty: update to 9.1.0 X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=2b0ef8365ca3193480916501113e93a7d93545e2;p=openwrt-packages.git rtty: update to 9.1.0 - Add libinih dependency - Switch init script from CLI arguments to INI config file - Add new config options: http_timeout, reconnect, cacert, cert, key changelog: https://github.com/zhaojh329/rtty/releases/tag/v9.1.0 Signed-off-by: Jianhui Zhao --- diff --git a/utils/rtty/Makefile b/utils/rtty/Makefile index afbd0e0d0..662ba29c1 100644 --- a/utils/rtty/Makefile +++ b/utils/rtty/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rtty -PKG_VERSION:=9.0.4 +PKG_VERSION:=9.1.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL=https://github.com/zhaojh329/rtty/releases/download/v$(PKG_VERSION) -PKG_HASH:=3bfc5db341c40e451544a218b7ef2cc59329ce04c50824b8ce6e5b805504c9bd +PKG_HASH:=9ba3deeda738dc35cf43982b384d2342688acbe1cf72d8485bebdd73d232b129 PKG_MAINTAINER:=Jianhui Zhao PKG_LICENSE:=MIT @@ -28,7 +28,7 @@ define Package/rtty/Default CATEGORY:=Utilities SUBMENU:=Terminal URL:=https://github.com/zhaojh329/rtty - DEPENDS:= +USE_GLIBC:libcrypt-compat +libev $(2) + DEPENDS:= +USE_GLIBC:libcrypt-compat +libev +libinih $(2) VARIANT:=$(1) PROVIDES:=rtty endef diff --git a/utils/rtty/files/rtty.config b/utils/rtty/files/rtty.config index 69d03eee8..322d9fb0d 100644 --- a/utils/rtty/files/rtty.config +++ b/utils/rtty/files/rtty.config @@ -16,3 +16,8 @@ # option username 'root' # Skip a second login authentication. See man login(1) about the details # option heartbeat '30' # Heartbeat interval in seconds(Default is 30s) # option verbose '1' # verbose log +# option http_timeout '30' # HTTP idle timeout in seconds(Default is 30s) +# option reconnect '1' # Auto reconnect to the server +# option cacert '/path/to/ca-cert.crt' # CA certificate to verify peer +# option cert '/path/to/client.crt' # Client cert for mTLS +# option key '/path/to/client.key' # Client key for mTLS diff --git a/utils/rtty/files/rtty.init b/utils/rtty/files/rtty.init index dde37bd53..0e48018a2 100644 --- a/utils/rtty/files/rtty.init +++ b/utils/rtty/files/rtty.init @@ -18,7 +18,12 @@ validate_rtty_section() { 'token:maxlength(32)' \ 'username:string' \ 'heartbeat:uinteger' \ - 'verbose:bool:0' + 'verbose:bool:0' \ + 'http_timeout:uinteger:30' \ + 'reconnect:bool:0' \ + 'cacert:file' \ + 'cert:file' \ + 'key:file' } start_rtty() { @@ -47,17 +52,31 @@ start_rtty() { id=$(sed 's/://g' /sys/class/net/$ifname/address | tr 'a-z' 'A-Z') } + mkdir -p /var/etc + local conf_file=/var/etc/rtty.ini + + printf '[rtty]\n' > "$conf_file" + printf 'id = %s\n' "$id" >> "$conf_file" + [ -n "$group" ] && printf 'group = %s\n' "$group" >> "$conf_file" + [ -n "$description" ] && printf 'description = %s\n' "$description" >> "$conf_file" + printf 'host = %s\n' "$host" >> "$conf_file" + [ -n "$port" ] && printf 'port = %s\n' "$port" >> "$conf_file" + [ -n "$token" ] && printf 'token = %s\n' "$token" >> "$conf_file" + [ -n "$username" ] && printf 'username = %s\n' "$username" >> "$conf_file" + [ -n "$heartbeat" ] && printf 'heartbeat = %s\n' "$heartbeat" >> "$conf_file" + [ -n "$http_timeout" ] && printf 'http-timeout = %s\n' "$http_timeout" >> "$conf_file" + [ "$reconnect" = "1" ] && printf 'reconnect = true\n' >> "$conf_file" + [ "$verbose" = "1" ] && printf 'verbose = true\n' >> "$conf_file" + + printf '\n[ssl]\n' >> "$conf_file" + [ "$ssl" = "1" ] && printf 'enabled = true\n' >> "$conf_file" + [ "$insecure" = "1" ] && printf 'insecure = true\n' >> "$conf_file" + [ -n "$cacert" ] && printf 'cacert = %s\n' "$cacert" >> "$conf_file" + [ -n "$cert" ] && printf 'cert = %s\n' "$cert" >> "$conf_file" + [ -n "$key" ] && printf 'key = %s\n' "$key" >> "$conf_file" + procd_open_instance - procd_set_param command $BIN -h $host -I "$id" -a - [ -n "$group" ] && procd_append_param command -g "$group" - [ -n "$port" ] && procd_append_param command -p "$port" - [ -n "$description" ] && procd_append_param command -d "$description" - [ "$ssl" = "1" ] && procd_append_param command -s - [ "$insecure" = "1" ] && procd_append_param command -x - [ -n "$token" ] && procd_append_param command -t "$token" - [ -n "$username" ] && procd_append_param command -f "$username" - [ -n "$heartbeat" ] && procd_append_param command -i "$heartbeat" - [ "$verbose" = "1" ] && procd_append_param command -v + procd_set_param command $BIN --conf "$conf_file" procd_set_param respawn procd_close_instance }