Commit Graph
64 Commits
Author SHA1 Message Date
John 12eadcdd39 remove deprecated code for clap 3.1.0 (#774) 2022-02-25 10:46:18 +08:00
zonyitoo 66e192e894 fix(ssservice): fixed command line option when running as symlink of ssserver/ssmanager 2022-02-21 22:02:02 +08:00
zonyitoo 9ef0b31f91 upgrade clap to v3.0 2022-01-05 20:12:53 +08:00
zonyitoo 89d9e66338 ssservice support symlinked by sslocal, ssserver, ssmanager 2021-11-27 17:36:16 +08:00
zonyitoo 486e1d7279 Local, Server & Manager unified binary ssservice
- fixes #698
- Refactored shadowsocks-rust crate structure. Common code are put into
a separated library
2021-11-27 17:36:16 +08:00
zonyitoo 48e822d104 fixed build warning on Windows 2021-11-27 00:22:23 +08:00
zonyitoo 1eff9b1883 remove redundant clone and Into for RemoteDnsAddress 2021-11-26 00:43:05 +08:00
zonyitoo 1dc0c2a363 make clippy happy 2021-11-26 00:12:13 +08:00
zonyitoo 7aec233271 command line --password also support ${VAR_NAME} syntax
- use the original text instead of empty string if ${VAR_NAME} 's
VAR_NAME doesn't exist

ref #419
2021-11-25 23:54:23 +08:00
zonyitoo 11262f5f99 refactored command line options getter with clap::value_t! 2021-11-25 20:21:50 +08:00
zonyitoo 0b5933b4b6 ssmanager won't use read_server_password 2021-11-25 17:33:14 +08:00
zonyitoo 74e8a4f8f5 Reading password from environment variable or TTY
- servers creating from command line options would use TTY,
SS_SERVER_PASSWORD and SS_SERVER_${SERVER_ADDR}_PASSWORD environment
variables
- servers in configuration file "password" would allow ${VAR_NAME} to
read from environment variable VAR_NAME

fixes #419
2021-11-25 17:19:16 +08:00
zonyitoo aaac00f208 SS_LOG_VERBOSE_LEVEL and SS_LOG_WITHOUT_TIME environment variable
ref #691
2021-11-25 16:15:49 +08:00
zonyitoo fa3a2a83d2 default configuration file (config.json) for Windows, Linux, macOS
- $XDG_CONFIG_PATH/shadowsocks-rust/config.json
- $HOME/.config/shadowsocks-rust/config.json
- {FOLDERID_RoamingAppData}\shadowsocks\shadowsocks-rust\config\config.json
- $HOME/Library/Application Support/org.shadowsocks.shadowsocks-rust/config.json

fixes #688
2021-11-25 15:14:07 +08:00
zonyitoo 7b1b67fe44 local-dns remote-dns-addr will have default port 53
fixes #683
2021-11-15 12:27:47 +08:00
zonyitoo da6473be09 servers created from command-line should have tcp_only default mode
fixes #670
2021-11-08 18:30:47 +08:00
Zimo LiandZimo Li 183b4bf0ca Fix spelling (#667)
* spelling: active

* spelling: availability

* spelling: because

* spelling: behavior

* spelling: browsers

* spelling: excessive

* spelling: extended

* spelling: insecure

* spelling: miscellaneous

* *spelling: negotiate

* spelling: particular

* spelling: readiness

* spelling: recommended

* spelling: response

* spelling: respectively

* spelling: reassemble

* spelling: Shadowsocks

* spelling: simultaneously

* spelling: silent

* spelling: stabilized

* spelling: unexpectedly

* *spelling: UNEXPECTEDLY

Co-authored-by: Zimo Li <lzm0@users.noreply.github.com>
2021-11-05 01:17:24 +08:00
zonyitoo e46d57936f support outbound-bind-interface for Windows 2021-10-23 17:32:15 +08:00
zonyitoo fa4a6928c1 fixed warning & update dependencies 2021-10-15 20:30:25 +08:00
zonyitoo a9e2f372c4 support ssmanager server standalone mode
- fixes #648
- allow restarting ssmanager without killing all running ssservers
2021-10-15 19:02:18 +08:00
spyophobia cba7fa4c3b daemon starts in pwd (#640)
This is the default behavior when not daemonizing.
2021-10-08 03:44:47 +08:00
zonyitoo a77ea0b304 make clippy happy, update dependencies 2021-10-08 01:24:07 +08:00
zonyitoo 593630833c Revert "remove chroot when daemonizing (#640)"
This reverts commit 862a8a78b7.
2021-10-08 01:16:06 +08:00
zonyitoo 42451a3e39 fixed bug. auto-reload "servers" should also reload plugins 2021-10-08 01:10:58 +08:00
zonyitoo 862a8a78b7 remove chroot when daemonizing (#640) 2021-10-08 00:13:55 +08:00
zonyitoo 76dfdbaaf6 print errno if daemonize failed 2021-10-08 00:03:24 +08:00
zonyitoo 3fdad5a401 reload config "servers" in runtime for sslocal
- Trigger reload with signal SIGUSR1
- run_local is replaced by create_local then call run() on Server
instance
- DNS resolver reloader won't trigger multiple time when
/etc/resolv.conf changed in 1 second
2021-10-06 02:33:00 +08:00
zonyitoo 0c96cf5840 log BUILD_TIME and bump version to v1.12.0-alpha.5 2021-09-25 23:20:33 +08:00
ty 337ab16adb Local server support Tun interface for both TCP and UDP (#586)
* [POC] basic implementation of TCP redirecting tun (#581)

* [POC] basic implementation of UDP redirection of Tun

* build with action

* add configuration interface for tun

* refine document and command line options

* outbound-bind-addr instead of reusing local_address for outbound sockets

* support customizing udp expiry and capacity

* make clippy happy

* fixed build error for Android

* add docs

* make a customized AsyncFd with the released tun crate

* TUN_INTERFACE_NAME to_owned directly

* ignore accept errors for tcp tun

* tun supports Android only on master branch

* android doesnt support setting IFF_NO_PI

* set route for macos automatically when creating tun

* set route for macos directly with PF_ROUTE

* Linux-like uses ETH_P_IP and ETH_P_IPV6

* use tun on crates.io and ignores Android support temporary

* update dependencies
2021-08-22 04:49:53 +08:00
zonyitoo fc40cef2c3 ssmanager support default --plugin and --plugin-opts
- fixes #421
2021-08-17 17:35:36 +08:00
zonyitoo 97bb489293 set Mode::UdpOnly via command line -u
- fixes #577
- Why the original code use merge instead of replace?
2021-07-21 12:48:06 +08:00
zonyitoo 402cdcb1d9 updated exitcode as standard defined in sysexits.h 2021-07-11 21:35:34 +08:00
zonyitoo 5d232ca123 exit with code instead of panic! when loading config and ACL errors
- fixes #566
2021-07-10 02:33:30 +08:00
zonyitoo 420e4511d3 add manager debug strings 2021-06-13 08:14:31 +08:00
zonyitoo d61d1028a5 add tcp-keep-alive command line option
- ref #546
2021-06-07 03:17:44 +08:00
zonyitoo f0f1ab59cd properly set available redir types for TCP and UDP separately 2021-05-15 00:40:21 +08:00
zonyitoo 6c75ce19f4 support snmalloc and rpmalloc 2021-05-07 11:35:35 +08:00
ty 4dfcc8e036 Manage UDP associations with LFU strategy (#506)
* manage UDP associations with LFU

- DNS associations could be evicted firstly then others like HTTP/3

* UDP redir caches inbound non-local socket

- Optimization: prevent creating new sockets for the same remotes

* updated libc to v0.2.94 for unified TCP options

* make clippy happy

* Pin lfu-cache to v1.2.1 for edward-shen/lfu-cache#2

* UDP target should cache with expiration 1hrs

* UDP tunnel test with an echo server

- CI crashes occasionally because of 8.8.8.8:53 doesn't respond
2021-04-28 01:27:33 +08:00
ty 8a27bb296c support TFO on Linux, FreeBSD, macOS and Windows (#487)
- ref #184
2021-04-25 23:31:13 +08:00
zonyitoo 50286dc9d9 free the memory of clap after parsing options
- --nofile is now only existed in *nix build except Android
2021-04-11 20:03:04 +08:00
zonyitoo 468207e0c1 support --udp-timeout and --udp-max-associations in ssmanager (#494)
- renamed --no-delay to --tcp-no-delay
2021-04-11 17:44:19 +08:00
DuckSoft 8ff69772ee fix sip002 wiki url 2021-04-01 16:19:40 +08:00
zonyitoo 32640208fa release v1.10.1 2021-03-26 23:00:04 +08:00
zonyitoo ab7d19df64 ProtocolType::Dns exists only if feature local-dns enabled
- fixes #469
2021-03-26 19:59:34 +08:00
zonyitoo 7cd59966e3 sslocal checks instance argument requirements 2021-03-26 16:17:15 +08:00
zonyitoo 46a51c877f manager mode should be set after parameter MANAGER_ADDRESS 2021-03-14 20:57:48 +08:00
zonyitoo 68d315ecd6 expose dns in command line options 2021-03-14 17:59:27 +08:00
zonyitoo 0ac0f15459 allow setting mode independently for every locals and servers
ref #452

- adding `mode` in `locals` and `servers` extended format`
redir and tunnel supports customizing UDP binding address by `udp_addr`

BREAKING CHANGES:

- `sslocal` and `ssserver` command line option `-u` and `-U` can only
  control mode of command line specified local or server instance`
2021-03-14 17:09:41 +08:00
zonyitoo 6bebb6c6c0 support multiple local servers in configuration file
ref #452

- support `locals` in configuration file, running multiple local server
  instance simultaneously
- support `unix://` in `dns` configuration

BREAKING CHANGE:

- `sslocal`'s `--dns-addr` is now only available in Android
- shadowsocks-service's `Config` struct have lots of changes
2021-03-14 17:09:41 +08:00
zonyitoo 0f81561f2f suppress warning of unused Result 2021-02-19 11:20:11 +08:00