diff --git a/glorytun-udp/init b/glorytun-udp/init index caac5d93d..c58281ac7 100755 --- a/glorytun-udp/init +++ b/glorytun-udp/init @@ -20,20 +20,21 @@ _err() { validate_section() { uci_validate_section glorytun glorytun "${1}" \ - 'enable:bool:0' \ - 'key:string' \ - 'host:host' \ - 'port:port' \ - 'proto:string' \ - 'bind:string' \ + 'enable:bool:0' \ + 'key:string' \ + 'host:host' \ + 'port:port' \ + 'proto:string' \ + 'bind:string' \ 'bindport:port' \ - 'mtu:uinteger:1500' \ + 'mtu:uinteger:1500' \ 'mtuauto:bool:0' \ + 'chacha20:bool:0' \ 'dev:string' } start_instance() { - local enable key host port dev listener proto bind bindport mtu mtuauto + local enable key host port dev listener proto bind bindport mtu mtuauto chacha20 validate_section "${1}" || { _err "validation failed" @@ -63,6 +64,7 @@ start_instance() { ${dev:+dev "$dev"} \ ${mtu:+mtu "$mtu"} \ ${mtuauto:+mtu-auto} \ + ${chacha20:+chacha20} \ v4only procd_set_param respawn 0 30 0 diff --git a/glorytun/init b/glorytun/init index bee5ebbb2..dd17b265b 100755 --- a/glorytun/init +++ b/glorytun/init @@ -27,11 +27,12 @@ validate_section() { 'host:host' \ 'port:port' \ 'dev:string' \ + 'chacha20:bool:0' \ 'proto:string' } start_instance() { - local enable key host port dev listener mptcp proto + local enable key host port dev listener mptcp proto chacha20 validate_section "${1}" || { _err "validation failed" @@ -57,6 +58,7 @@ start_instance() { ${host:+host "$host"} \ ${listener:+listener} \ ${mptcp:+mptcp} \ + ${chacha20:+chacha20} \ ${dev:+dev "$dev"} \ retry count -1 const 5000000 \ timeout 5000 \ diff --git a/luci-app-glorytun/luasrc/model/cbi/glorytun-settings.lua b/luci-app-glorytun/luasrc/model/cbi/glorytun-settings.lua index 914431c4e..d905905c9 100644 --- a/luci-app-glorytun/luasrc/model/cbi/glorytun-settings.lua +++ b/luci-app-glorytun/luasrc/model/cbi/glorytun-settings.lua @@ -26,6 +26,7 @@ local basicParams = { { Flag,"mtuauto",0, translate("MTU auto") }, { Flag,"mptcp",0, translate("MPTCP") } + { Flag,"chacha20",0, translate("Use ChaCha20 stream cipher") } }