cbeuw / Cloak

A censorship circumvention tool to evade detection by authoritarian state adversaries
GNU General Public License v3.0
3.42k stars 304 forks source link

shadowsocks server cloak plugin debug #157

Open taylorwin opened 3 years ago

taylorwin commented 3 years ago

how can i cloak debug model ? I did three tests and failed test 1 { "server":["::1", "127.0.0.1"], "mode":"tcp_and_udp", "server_port":3333, "local_port":1080, "password":"xxxxx", "timeout":60, "method":"chacha20-ietf-poly1305", "plugin":"ck-server", "plugin_opts":"-d debug; /app/cloak-server.conf" } test 2 { "server":["::1", "127.0.0.1"], "mode":"tcp_and_udp", "server_port":3333, "local_port":1080, "password":"xxxxx", "timeout":60, "method":"chacha20-ietf-poly1305", "plugin":"ck-server", "plugin_opts":"-d debug /app/cloak-server.conf" } test 3 { "server":["::1", "127.0.0.1"], "mode":"tcp_and_udp", "server_port":3333, "local_port":1080, "password":"xxxxx", "timeout":60, "method":"chacha20-ietf-poly1305", "plugin":"ck-server -d debug", "plugin_opts":"-d debug /app/cloak-server.conf" }

kenchou commented 2 years ago

I have similar needs. But I want suppress info log because there are too many logs since shadowsocks upgrade to latest version (v3.3.5).

shadowsocks set env and launch plugin without parameters. https://github.com/shadowsocks/shadowsocks-libev/blob/master/src/plugin.c#L103-L128

Cloak only accpet cli flag to change verbosity. https://github.com/cbeuw/Cloak/blob/master/cmd/ck-client/ck-client.go#L41-L46

Workaround:

create a plugin wrapper script /usr/bin/ck-client-plugin

#!/bin/sh
exec /usr/bin/ck-client -verbosity=warn

debug to set the flag -verbosity=debug

update shadowsocks config set plugin to wapper: "plugin":"/usr/bin/ck-client-plugin",

restart shadowsocks

/etc/init.d/shadowsocks restart

Done.