Commit Graph
52 Commits
Author SHA1 Message Date
Max Lv bdc77408cb Rename to shadowsocks-c with libuv, async DNS and CI lint (#3051)
Rename the project to shadowsocks-c while retaining ss-* commands, the embedding ABI, and legacy library/package lookup compatibility.

Replace libev with bundled libuv for IOCP/kqueue event backends, expand asynchronous runtime DNS coverage, and add actionlint/Ruff with strict clang-tidy failure handling. Validate native platforms, static builds, packaging, interoperability, sanitizers, and canonical/legacy consumers.

All 22 hosted checks pass at reviewed head a8493250eb.
2026-09-11 14:18:37 +08:00
Max Lv 201e70c4bd Modernize C builds with offline dependencies and portable runtime helpers (#3050)
Bundle pinned offline dependencies, remove libcork/libipset and submodule requirements, and add portable runtime helpers with relocatable static/shared library installations.

Add Clang static build validation for Linux/musl, macOS and Windows, real TCP/UDP and SIP003 interoperability coverage, and recorded performance tradeoffs. All 21 hosted checks pass at the reviewed PR head 8d504e6218.
2026-09-11 13:42:11 +08:00
Max Lv 98915c7828 Build as C11 and remove input-sized VLAs from key parsing
crypto_parse_key sized a stack array from strlen() of the key given on
the command line or in the config file, so a long enough key string
overflowed the stack before any validation ran. Only the first key_len
bytes were ever used, and base64_decode already stops at the size it is
given, so a fixed MAX_KEY_LENGTH buffer is enough. crypto_parse_psk
needs one byte of slack to tell an over-long key from an exact-size one.

The two "here is a valid key instead" error paths were identical; they
are now one helper, which also drops the last input-sized VLA.

Switch the standard from gnu99 to C11 via CMAKE_C_STANDARD rather than a
hand-written -std flag, so CMake picks the right spelling per compiler.
2026-08-19 18:24:33 +08:00
Max LvandClaude Fable 5 ba7b9ad4cc Add code quality tooling: clang-tidy, sanitizers, coverage (#3046)
- Export compile_commands.json for tooling
- .clang-tidy: clang-analyzer + bugprone + cert checks scoped to src/,
  with stylistic/false-positive-prone checks disabled
- ENABLE_SANITIZERS CMake option (ASan + UBSan)
- ENABLE_COVERAGE CMake option with an lcov/genhtml 'coverage' target
- CI: asan job (ctest + stress test under ASan/UBSan), clang-tidy job
  (warning-count ratchet, baseline 29 with pinned clang-tidy-18),
  coverage job (lcov summary + HTML report artifact)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 12:24:57 +08:00
Pain fb3d4a5fb2 Fix CMake Deprecation Warning 2026-04-16 07:35:27 -07:00
Max LvandClaude Opus 4.6 c5e8788013 Bump version to 3.3.6
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 09:15:12 +08:00
Max LvandClaude Opus 4.6 6423c8e496 Add Debian package build test and statically link bundled submodules
Add tests/test_deb_build.sh with four phases:
1. Build .deb packages via dpkg-buildpackage
2. Verify all three packages contain expected files (binaries, man
   pages, shared library, headers, pkg-config)
3. Install packages and resolve dependencies
4. Smoke-test installed binaries, ldconfig, and headers

Add a Linux-only CI step in build.yml to run the test.

Statically link the bundled submodule libraries (libcork, libipset,
libbloom) into all targets instead of building them as shared libs.
These are vendored code built from git submodules, not system
libraries, so static linking is correct and eliminates
dpkg-shlibdeps warnings about missing .so files.

Pass -DWITH_STATIC=OFF in debian/rules since debian build-depends
only provide shared library dev packages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 11:32:13 +08:00
Max LvandClaude Opus 4.6 5c2d0e43fa Add ss-setup TUI tool with unit tests and CI integration
Interactive whiptail/dialog TUI for server/client config generation,
systemd service management, SIP003 plugin installation, and ss:// URI
output. Includes 131 bash unit tests covering all utility functions
(validation, JSON generation, URI encoding, config round-trip parsing).
Tests run in CTest and as a dedicated GitHub Actions step.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 18:30:20 +08:00
Max LvandClaude Opus 4.6 7bb250739e Modernize build: switch to CMake, add unit tests, fix man pages
* Modernize build: switch to CMake, add unit tests, fix man pages

Remove autotools (configure.ac, Makefile.am, m4/, autogen.sh) and make
CMake the sole build system. Enhance CMake with proper Find modules for
MbedTLS, libsodium, PCRE, and c-ares with version/feature detection.
Add support for connmarktos, nftables, stack protector, and MinGW.

Add 10 unit test suites (CTest) covering base64, buffer, cache, crypto,
jconf, json, netutils, ppbloom, rule, and utils modules. Add a Python
stress test measuring bandwidth per cipher with memory leak detection.

Fix man page typos ("Resovle" -> "Resolve"), document missing TCP buffer
options, fix ss-manager duplicate --executable entry, add example section
to ss-tunnel, and document --workdir and --nftables-sets options.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Migrate from PCRE to PCRE2

Replace legacy PCRE (libpcre3) with PCRE2 (libpcre2-8). PCRE1 has been
end-of-life since 2021.

- src/rule.h: use pcre2_code and pcre2_match_data types
- src/rule.c: pcre_compile -> pcre2_compile, pcre_exec -> pcre2_match,
  pcre_free -> pcre2_code_free, with proper error message retrieval
- cmake/FindPCRE.cmake -> cmake/FindPCRE2.cmake: find libpcre2-8 via
  pkg-config, pcre2-config, or manual search
- Update all CMakeLists.txt, config.h.cmake, configure.cmake, README.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Update Dockerfiles: use CMake build and pcre2-dev

The alpine Dockerfile still used autotools (autogen.sh/configure) which
were removed. Switch to cmake build and replace pcre-dev with pcre2-dev.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix Docker build: disable tests and remove git dep

The tests/ directory is excluded by .dockerignore, so pass
-DBUILD_TESTING=OFF to cmake. Submodules are already checked out
by actions/checkout, no need for git inside the container.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix Docker build: disable static libs (not available in alpine)

Alpine's mbedtls-dev only provides shared libraries. Disable static
build since Docker only needs shared binaries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Rewrite GitHub Actions: build and test directly on runner

Replace Docker-based CI with direct cmake build on ubuntu-latest and
macos-latest. Install dependencies via apt/brew, build with cmake,
run unit tests with ctest.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix CI: use mbedtls@3 on macOS, disable static build

- macOS: brew's mbedtls is now v4 (incompatible), use mbedtls@3
- Disable static build since CI runners lack static lib packages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix test build on Linux: add stdint.h and link libm

- test_ppbloom.c: add missing #include <stdint.h> for uint8_t
- test_json: link against libm for pow() used in json.c

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix test_ppbloom link: add libm for bloom's log()

On Linux, libbloom uses log() which requires explicit -lm linkage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix Linux build: link libm for test_buffer and test_crypto, fix warnings

Both test_buffer and test_crypto link libbloom.so which uses log() from
libm. Also fix unused variable warnings in test_json.c that would fail
with -Werror.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix Linux build: link libm for test_jconf (json.c uses pow)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* CI: add unit test and stress test steps to GitHub Actions

Split the Test step into separate "Unit tests" (ctest) and "Stress test"
(stress_test.py with 10MB transfer across all AEAD ciphers) steps for
better visibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 17:06:47 +08:00
Max Lv 8285e5a7de Bump version 2020-09-15 10:30:48 +08:00
DDoSolitary f1f3e9d6ca Fix support for building with CMake and MinGW. 2020-05-02 13:25:11 +08:00
Jamis Hoo 0aa55a29e5 Replace CMAKE_XXX_DIR with PROJECT_XXX_DIR, so that this project can be used in an enclosing project 2020-03-29 17:35:12 +08:00
Max Lv 72d7d9217c Bump version 2020-01-10 09:48:42 +08:00
Max Lv e2765847cc Bump version 2019-10-31 15:16:05 +08:00
Max Lv 346ab1be47 Bump version 2019-10-12 15:20:52 +08:00
Max Lv 615588bd39 Bump version 2019-08-09 15:17:53 +08:00
Max Lv e3c6c80df0 Fix #2443 2019-07-30 12:14:27 +08:00
Max Lv ffad914ddd Bump version 2019-06-08 08:01:47 +08:00
ideal a3265742d1 fix typo in comment 2019-03-11 14:38:44 +08:00
ideal 5c0b8d2ab4 cmake: let version available in config.h 2019-03-10 19:00:00 +08:00
ideal 55647ce5f2 define USE_SYSTEM_SHARED_LIB in config.h when cmake with -DWITH_EMBEDDED_SRC=OF
set USE_SYSTEM_SHARED_LIB to TRUE to let cmakedefine take effect in cmake/config.h.cmake
2019-03-10 18:50:50 +08:00
ideal 4913978a58 cmake: put pkgconfig file into lib/pkgconfig 2019-03-10 18:43:42 +08:00
Max Lv b0c6ba4945 Bump version 2019-03-09 19:07:22 +08:00
Max Lv c9159fc927 Bump version 2019-02-26 12:33:30 +08:00
Max Lv 545c04182f Bump version 2018-11-28 00:48:15 -08:00
Max Lv c8ea784ded Bump version 2018-11-26 21:04:24 -08:00
Max Lv b9ed8da571 Bump version 2018-11-07 22:46:20 -08:00
Max Lv 8c98bdecac Bump version 2018-05-28 19:55:12 -07:00
Max Lv 85a64ae836 Bump version 2018-01-15 17:25:03 -08:00
Roger Shimizu d41508292f Make cmake to build under Debian
Add a new option, WITH_EMBEDDED_SRC, which default is ON and same as
current setting.
When set to OFF, it can use system's libcork, libcorkipset, and libbloom.

It can be built in debian by:
$ cmake -DUSE_SYSTEM_SHARED_LIB=1 -DWITH_STATIC=OFF -DWITH_EMBEDDED_SRC=OFF
$ make
2018-01-07 23:36:24 +09:00
Max Lv cba94db423 Bump version 2017-12-28 21:09:40 -08:00
Max Lv 42b29fbb63 Fix cmake builds 2017-11-27 12:13:04 +08:00
Max Lv 82198aece8 Bump version 2017-11-20 12:22:43 +08:00
Max Lv 69c41d9752 Bump version 2017-09-14 19:31:13 -07:00
Max Lv f1dd1354a9 Bump version 2017-07-27 11:22:27 +08:00
Max Lv c11b2c08e4 Bump version 2017-06-27 14:17:53 +08:00
Max Lv bc96aed3b0 Bump version 2017-04-26 15:02:56 +08:00
zzzdong 9db9df5f4d Add a option in CMakeLists.txt for switch build with static libraries or not 2017-04-23 07:16:22 +08:00
Max Lv efe2acc4b4 Increase minimum version of cmake 2017-03-27 15:08:55 +08:00
wener 619ae880c9 Recommend to use shared binary 2017-03-26 21:20:33 +08:00
wener 1f91fbc69a 1. Fix incorrect install path.
2. set CMP0048 to OLD to prevent warning
2017-03-26 21:20:33 +08:00
wener 88ef344262 Add document build 2017-03-26 21:20:33 +08:00
Max Lv 48f5a3bec8 Bump version 2017-03-21 13:56:13 +08:00
Max Lv b725d575f2 Bump version 2017-03-16 14:21:11 +08:00
Max Lv fb53630b20 Fix some building issues 2017-03-16 14:04:05 +08:00
wener 734092e348 Build shared and static shadowsock-libev and executable. 2017-02-20 00:04:28 +08:00
wener 0cabdccd9a Remove confuse comment in config.h.in;Move config.h.in to cmake. 2017-02-18 13:03:22 +08:00
wener 95a8a4db50 Add missing ss-redir install; Remove cmake build success echo. 2017-02-18 02:43:30 +08:00
wener 00bf648f77 Allowed to build static linked executable, default ON
To build shared executable

   cmake -DBUILD_STATIC=OFF . && make
2017-02-18 01:41:24 +08:00
wener 111041731f link libcork instead cork to ss-redir 2017-02-18 00:10:32 +08:00