diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af488cfe6..e9c25d1ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: - name: install protoc run: sudo apt-get update && sudo apt-get install -y protobuf-compiler - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install rust (${{ matrix.rust }}) uses: actions-rs/toolchain@v1 with: @@ -43,7 +43,7 @@ jobs: - name: install protoc run: sudo apt-get update && sudo apt-get install -y protobuf-compiler - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install rust uses: actions-rs/toolchain@v1 with: @@ -62,7 +62,7 @@ jobs: - name: install protoc run: sudo apt-get update && sudo apt-get install -y protobuf-compiler - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install rust uses: actions-rs/toolchain@v1 with: @@ -84,16 +84,15 @@ jobs: dockerhub: name: Docker build and push to Docker Hub runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' steps: - - uses: actions/checkout@v2 - - uses: docker/setup-qemu-action@v1 - - uses: docker/setup-buildx-action@v1 - - uses: docker/login-action@v1 + - uses: actions/checkout@v4 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - uses: docker/build-push-action@v2 + - uses: docker/build-push-action@v6 with: context: . push: 'true' diff --git a/CODEOWNERS b/CODEOWNERS index 50a603bd9..e5304fd0f 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,2 +1,2 @@ # Code owners of Sōzu -* @FlorentinDUBOIS @Keksoj @Wonshtrum @llenotre +* @FlorentinDUBOIS @Wonshtrum @llenotre diff --git a/Cargo.lock b/Cargo.lock index e68af936c..0a44a0c72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -132,33 +132,6 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" -[[package]] -name = "aws-lc-rs" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdd82dba44d209fddb11c190e0a94b78651f95299598e472215667417a03ff1d" -dependencies = [ - "aws-lc-sys", - "mirai-annotations", - "paste", - "zeroize", -] - -[[package]] -name = "aws-lc-sys" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df7a4168111d7eb622a31b214057b8509c0a7e1794f44c546d742330dc793972" -dependencies = [ - "bindgen", - "cc", - "cmake", - "dunce", - "fs_extra", - "libc", - "paste", -] - [[package]] name = "backtrace" version = "0.3.74" @@ -180,29 +153,6 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" -[[package]] -name = "bindgen" -version = "0.69.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "itertools 0.12.1", - "lazy_static", - "lazycell", - "log 0.4.22", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.87", - "which", -] - [[package]] name = "bitflags" version = "2.6.0" @@ -236,20 +186,9 @@ version = "1.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" dependencies = [ - "jobserver", - "libc", "shlex", ] -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - [[package]] name = "cfg-if" version = "1.0.0" @@ -268,17 +207,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e4de3bc4ea267985becf712dc6d9eed8b04c953b3fcfb339ebc87acd9804901" -[[package]] -name = "clang-sys" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" -dependencies = [ - "glob", - "libc", - "libloading", -] - [[package]] name = "clap" version = "4.5.20" @@ -319,15 +247,6 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" -[[package]] -name = "cmake" -version = "0.1.51" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" -dependencies = [ - "cc", -] - [[package]] name = "colorchoice" version = "1.0.2" @@ -457,12 +376,6 @@ dependencies = [ "syn 2.0.87", ] -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - [[package]] name = "either" version = "1.13.0" @@ -529,12 +442,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "fs_extra" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" - [[package]] name = "futures" version = "0.3.31" @@ -651,12 +558,6 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - [[package]] name = "hashbrown" version = "0.15.0" @@ -701,15 +602,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "hpack" version = "0.3.0" @@ -949,15 +841,6 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.13.0" @@ -993,15 +876,6 @@ dependencies = [ "libc", ] -[[package]] -name = "jobserver" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" -dependencies = [ - "libc", -] - [[package]] name = "kawa" version = "0.6.7" @@ -1017,28 +891,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" -[[package]] -name = "libloading" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" -dependencies = [ - "cfg-if", - "windows-targets", -] - [[package]] name = "libredox" version = "0.1.3" @@ -1130,12 +988,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "mirai-annotations" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" - [[package]] name = "multimap" version = "0.10.0" @@ -1262,12 +1114,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - [[package]] name = "paw" version = "1.0.0" @@ -1397,7 +1243,7 @@ checksum = "0c1318b19085f08681016926435853bbf7858f9c082d0999b80550ff5d9abe15" dependencies = [ "bytes", "heck", - "itertools 0.13.0", + "itertools", "log 0.4.22", "multimap", "once_cell", @@ -1417,7 +1263,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" dependencies = [ "anyhow", - "itertools 0.13.0", + "itertools", "proc-macro2", "quote", "syn 2.0.87", @@ -1558,12 +1404,6 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rusticata-macros" version = "4.1.0" @@ -1604,7 +1444,6 @@ version = "0.23.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ - "aws-lc-rs", "log 0.4.22", "once_cell", "ring", @@ -1645,7 +1484,6 @@ version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ - "aws-lc-rs", "ring", "rustls-pki-types", "untrusted", @@ -2262,18 +2100,6 @@ version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - [[package]] name = "winapi" version = "0.3.9" diff --git a/Dockerfile b/Dockerfile index 338a701d0..31eed07f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,8 @@ RUN apk add --no-cache llvm-libunwind \ COPY . /usr/src/sozu WORKDIR /usr/src/sozu -RUN cargo vendor --locked +RUN mkdir .cargo +RUN cargo vendor --locked >.cargo/config.toml RUN cargo build --release --frozen FROM alpine:$ALPINE_VERSION as bin @@ -38,8 +39,6 @@ RUN apk update && apk add --no-cache \ COPY --from=builder /usr/src/sozu/target/release/sozu /usr/local/bin/sozu COPY os-build/config.toml /etc/sozu/config.toml -COPY lib/assets/404.html /etc/sozu/html/404.html -COPY lib/assets/503.html /etc/sozu/html/503.html ENTRYPOINT ["/usr/local/bin/sozu"] CMD ["start", "-c", "/etc/sozu/config.toml"] diff --git a/doc/debugging_strategies.md b/doc/debugging_strategies.md index ba0bed062..3771deb46 100644 --- a/doc/debugging_strategies.md +++ b/doc/debugging_strategies.md @@ -10,9 +10,9 @@ It is useful to gather information on the configuration state in a production sy Here are some commands you can use to take a snapshot of the current state: ```bash -sozu -c /etc/config.toml status > "sozu-status-$(date -Iseconds).txt" -sozu -c /etc/config.toml query metrics > "sozu-metrics-$(date -Iseconds).txt" -sozu -c /etc/config.toml query clusters > "sozu-applications-$(date -Iseconds).txt" +sozu -c /etc/config.toml status" +sozu -c /etc/config.toml metrics get" +sozu -c /etc/config.toml clusters list" sozu -c /etc/config.toml state save -f "sozu-state-$(date -Iseconds).txt" ``` @@ -232,13 +232,13 @@ Normal traffic (`sozu.http.requests`) drops while 404 (`sozu.http.404.errors`) a Check the configuration state with; ```bash -sozu -c /etc/config.toml query clusters +sozu -c /etc/config.toml clusters list ``` And, for the complete configuration for a specific cluster id: ```bash -sozu -c /etc/config.toml query clusters -i cluster_id +sozu -c /etc/config.toml clusters list -i cluster_id ``` ### Backend server unavailable diff --git a/lib/Cargo.toml b/lib/Cargo.toml index d38e2a3d5..d41b20c32 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -42,7 +42,12 @@ nom = { version = "^7.1.3", default-features = true, features = ["std"] } poule = "^0.3.2" rand = "^0.8.5" regex = "^1.11.0" -rustls = { version = "^0.23.14", features = ["ring"] } +rustls = { version = "^0.23.14", default-features = false, features = [ + "ring", + "logging", + "std", + "tls12", +] } rustls-pemfile = "^2.2.0" rusty_ulid = "^2.0.0" sha2 = "^0.10.8"