]> git.99rst.org Git - openwrt-packages.git/commitdiff
rtty: update to 9.1.0
authorJianhui Zhao <redacted>
Thu, 25 Jun 2026 11:09:01 +0000 (19:09 +0800)
committerTianling Shen <redacted>
Fri, 26 Jun 2026 08:39:50 +0000 (16:39 +0800)
- 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 <redacted>
utils/rtty/Makefile
utils/rtty/files/rtty.config
utils/rtty/files/rtty.init

index afbd0e0d0ca480cc8a6c67b91a7866aeb551b155..662ba29c1459dfa9c08a20b3d1a752932470113e 100644 (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
index 69d03eee8bff6e54bd9419459127c40aa425903a..322d9fb0daa8aec9ea419550930cc1caee1b6254 100644 (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
index dde37bd53e82d4af63f5026aaefcafd85b16e94f..0e48018a29246e359cc6cb4ded27b23262a5c463 100644 (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
 }
git clone https://git.99rst.org/PROJECT