This commit is contained in:
Mateusz Gruszczyński committed 2026-11-19 23:23:01 +01:00
1 parent 8b7f5dbfb8
commit 5e43752041
3 files changed
+9 -92

No files matched your search

+2 -2
View File
@@ -363,7 +363,7 @@ e26dce02df9c043329ca164fed215d271781bce8fb03240f528331bf3df6b9d7 src/cache/poli
12a6d5d9d6711e956391b4b952e8149658b8bf64cfcc0a4c59c281f2630a6aac src/cache/policy/scope_tests.rs
c3a4300f7cdb6b2b7c16fbc489d49ba2451331bb4a55a2d9f618c684fd61eecb src/cache/range.rs
37d077a35f34e3ed76601838ffc3a9596a452727ce7cbfc82d024fb70b6b5fa4 src/cache/rules.rs
97dfb7627f07a8a17adbeeabaeaf6fd335c9edf006cebc4391496b783d97ec14 src/cache/rules_tests.rs
77414809d3f128781d9c665dc52a454db2f3f93f59f164384881ca7c1cc75d8c src/cache/rules_tests.rs
48344d7dcbbb220d8c16f5aa9bb88d86a6388b226bbf93d0ca92d8dfbf2c8001 src/cache/stats.rs
2981e35a7fbbc2b36214b5518f4ba97d57c1d2e01f4f375175c4b2c6be955927 src/cache/tests.rs
b969394b04859b269dcecd8958b1aab40b532709512714e9900f0ecad6b6d0c5 src/cache/tickets.rs
@@ -457,7 +457,7 @@ f1b0254f53b1a4336bd8170ad441ba072b49a114e497b985cb20699b4e375044 src/prometheus
c03cdfa8da7bb440d08ce4436e8bedaaf8dad5e489169e6bc156495029e12ad5 src/proxy/cache_helpers.rs
2d39552aa01ce3d048560944975243d0a58ae762d838e547f5fa65007d871dc4 src/proxy/cache_http_invalidation.rs
a86b10ce0707b51e925e11ea14f7f40fa108a196166f62cf40007a97f9e17203 src/proxy/cache_http_invalidation_tests.rs
b2c4e168f63767008bda51eac4bd070be853e4de232af78588a61d5b182d9b51 src/proxy/cache_plan/mod.rs
f93a40303bc3b6645f6928c4e8795978b0554e30a75f4c9daf9fff1e2138a037 src/proxy/cache_plan/mod.rs
811a00b55b24638b4bf8a6bea9ed7c0ffe2a758f76bfe63a95e1d31bce1c2c9c src/proxy/cache_plan/tests.rs
d6bd4aafab7b1371c31b3d22ddf949a08ea942489649ca12c7615b3b2d5a109a src/proxy/error_fallback.rs
79ec6b6e378ecfe478ed779ba53e69030c4d5f06ebd6ae0092f335751db0667f src/proxy/forward/cache_fast_path_tests.rs
-68
View File
@@ -1,68 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT"
DIST="$ROOT/dist"
CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-$ROOT/target}"
export CARGO_TARGET_DIR
fail() {
printf 'error: %s\n' "$*" >&2
exit 1
}
need() {
command -v "$1" >/dev/null 2>&1 || fail "$1 is required"
}
need cargo
need rustc
need python3
need sha256sum
python3 -c 'import sys; sys.exit(0 if sys.version_info >= (3,10) else 1)' \
|| fail 'Python 3.10+ is required'
[[ -f Cargo.toml ]] || fail 'run this script from the RustProxy project root'
[[ -f Cargo.lock ]] || fail 'Cargo.lock is required for a reproducible release'
[[ -f scripts/preflight.py ]] || fail 'scripts/preflight.py is missing'
VERSION="$(python3 scripts/version.py)"
HOST="$(rustc -vV | sed -n 's/^host: //p')"
[[ -n "$VERSION" ]] || fail 'could not determine project version'
[[ -n "$HOST" ]] || fail 'could not determine Rust host target'
printf 'RustProxy %s release build for %s\n' "$VERSION" "$HOST"
python3 scripts/preflight.py
cargo fmt --all -- --check
cargo test --locked --all-targets
cargo clippy --locked --all-targets -- -D warnings
rm -rf "$CARGO_TARGET_DIR/release"
cargo build --locked --release
BIN="$CARGO_TARGET_DIR/release/rust-proxy"
[[ -x "$BIN" ]] || fail "release binary was not created: $BIN"
ACTUAL_VERSION="$($BIN --version)"
printf 'Built: %s\n' "$ACTUAL_VERSION"
rm -rf "$DIST"
mkdir -p "$DIST"
ARTIFACT="rust-proxy-${VERSION}-${HOST}"
cp "$BIN" "$DIST/$ARTIFACT"
chmod 0755 "$DIST/$ARTIFACT"
sha256sum "$DIST/$ARTIFACT" > "$DIST/$ARTIFACT.sha256"
SOURCE_ZIP="$DIST/RustProxy-${VERSION}-source.zip"
python3 make_zip.py "$SOURCE_ZIP"
sha256sum "$SOURCE_ZIP" > "$SOURCE_ZIP.sha256"
printf '\nRelease ready:\n'
printf ' binary: %s\n' "$DIST/$ARTIFACT"
printf ' checksum: %s\n' "$DIST/$ARTIFACT.sha256"
printf ' source zip: %s\n' "$SOURCE_ZIP"
printf ' checksum: %s\n' "$SOURCE_ZIP.sha256"
+7 -22
View File
@@ -30,23 +30,14 @@ impl CachePlan {
}
pub(super) fn with_vcl_cookie_lookup(mut self, allowed: bool) -> Self {
if let Self::Enabled {
vcl_cookie_lookup, ..
} = &mut self
{
if let Self::Enabled { vcl_cookie_lookup, .. } = &mut self {
*vcl_cookie_lookup = allowed;
}
self
}
pub(super) fn vcl_cookie_lookup(self) -> bool {
matches!(
self,
Self::Enabled {
vcl_cookie_lookup: true,
..
}
)
matches!(self, Self::Enabled { vcl_cookie_lookup: true, .. })
}
pub(super) fn force_cache(self) -> bool {
@@ -83,17 +74,11 @@ impl CachePlan {
Self::Enabled {
force_cache: true, ..
} => crate::cache::forced_request_policy(method, headers, body_empty),
Self::Enabled {
vcl_cookie_lookup, ..
} => crate::cache::request_policy_with_vcl_cookie(
method,
headers,
body_empty,
path,
has_query,
settings,
vcl_cookie_lookup,
),
Self::Enabled { vcl_cookie_lookup, .. } => {
crate::cache::request_policy_with_vcl_cookie(
method, headers, body_empty, path, has_query, settings, vcl_cookie_lookup,
)
}
}
}
}