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 <zhaojh329@gmail.com>
This commit is contained in:
Jianhui Zhao authored and Tianling Shen committed 2026-06-26 16:39:50 +08:00
1 parent de9e76d391
commit 2b0ef8365c
3 files changed
+38 -14

No files matched your search

+3 -3
View File
@@ -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 <zhaojh329@gmail.com>
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
+5
View File
@@ -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
+30 -11
View File
@@ -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
}