This commit is contained in:
Mateusz Gruszczyński committed 2026-10-08 09:42:10 +02:00
1 parent c24bc4279b
commit 3b3f0db377
84 files changed
+2686 -392

No files matched your search

+96 -18
View File
@@ -24,7 +24,7 @@ def read_docker_agent_source() -> str:
preflight(root)
manifest = tomllib.loads((root / "Cargo.toml").read_text())
assert manifest["package"]["version"] == "0.27.3"
assert manifest["package"]["version"] == "0.28.0"
assert manifest["dependencies"]["quinn"]["version"] == "0.11.12"
h3dep = manifest["dependencies"]["h3"]
assert h3dep["package"] == "hpx-h3" and h3dep["version"] == "=2.5.19" and "quinn" in h3dep["features"]
@@ -32,14 +32,14 @@ assert "h3-quinn" not in manifest["dependencies"]
lock_path = root / "Cargo.lock"
if lock_path.exists():
lock = lock_path.read_text()
assert 'name = "rust-proxy"\nversion = "0.27.3"' in lock
assert 'name = "rust-proxy"\nversion = "0.28.0"' in lock
assert 'name = "systemstat"' in lock and 'name = "metrics-process"' in lock and 'name = "sysinfo"' in lock, "Cargo.lock must be resolver-generated after adding cross-platform statistics libraries"
for release_doc, marker in {
"README.md": "# RustProxy 0.27.3",
"CHANGELOG.md": "## 0.27.3",
"ROADMAP.md": "## 0.27.3",
"AGENTS.md": "Current source version: 0.27.3.",
"docs/TEST_REPORT.md": "# Verification report - RustProxy 0.27.3",
"README.md": "# RustProxy 0.28.0",
"CHANGELOG.md": "## 0.28.0",
"ROADMAP.md": "## 0.28.0",
"AGENTS.md": "Current source version: 0.28.0.",
"docs/TEST_REPORT.md": "# Verification report - RustProxy 0.28.0",
}.items():
assert marker in (root / release_doc).read_text(), f"stale release identity in {release_doc}"
assert tomllib.loads((root / "rust-toolchain.toml").read_text())["toolchain"]["channel"] == "stable"
@@ -62,7 +62,7 @@ for marker in [
assert 'update version document is too large or incomplete: {error}' in update_check_source
assert '.context("update version document is too large or incomplete")' not in update_check_source
for marker in [
'tracing::error!(',
'tracing::warn!(',
'MAX_REDIRECTS: usize = 5',
'SSL_CERT_FILE',
'CURL_CA_BUNDLE',
@@ -116,10 +116,6 @@ for marker in [
'--prefix "$PREFIX"',
'python3-venv',
'python3-pip',
'certbot',
'python3-certbot-dns-rfc2136',
'python3-certbot-dns-cloudflare',
'python3-certbot-dns-ovh',
]:
assert marker in bootstrap, marker
assert 'curl ' not in bootstrap, 'Debian bootstrap must use wget instead of curl'
@@ -288,7 +284,7 @@ assert 'Opt-in health decisions based on ordinary user traffic. Defaults to disa
assert '"force_ssl"' in openapi and '"forward_client_ip"' in openapi
assert '"backend_header"' in openapi and '"backend_timing_header"' in openapi
assert '"StreamMetrics"' in openapi and '"streams"' in openapi
for marker in ['"version": "0.27.3"', '"/api/traffic"', '"capture_user_agent"', '"capture_country"', '"hot_auto_trim_enabled"', '"hot_auto_trim_after_seconds"', '"hot_auto_trim_target_percent"', '"/api/config/{section}"', '"ConfigSectionUpdate"', '"cold_on_idle"', '"cold_on_age"', '"cold_max_hot_seconds"', '"cold_on_lru"', '"cold_on_shutdown"', '"cold_gc_interval_seconds"', '"cold_gc_max_delete"', '"collapse_enabled"', '"collapse_wait_timeout_ms"', '"collapse_timeout_fallback"', '"stale_if_error_timeout"', '"stale_if_error_connection"', '"stale_if_error_dns"', '"stale_if_error_tls"', '"stale_if_error_statuses"', '"proactive_refresh_enabled"', '"proactive_refresh_before_expiry_seconds"', '"proactive_refresh_percent"', '"proactive_refresh_max_inflight"', '"TransformSettings"', '"TransformOverrides"', '"/api/cache/cold/cleanup"', '"/api/cache/invalidate"', '"/api/cache/bans"', '"/api/cache/bans/{id}"', '"CacheInvalidationRequest"', '"CacheInvalidationResponse"', '"ColdCleanupJob"', '"match_type"', '"regex_insensitive"', '"rewrite"', '"response"', '"covered_hosts"', '"default": true']:
for marker in ['"version": "0.28.0"', '"/api/traffic"', '"capture_user_agent"', '"capture_country"', '"hot_auto_trim_enabled"', '"hot_auto_trim_after_seconds"', '"hot_auto_trim_target_percent"', '"/api/config/{section}"', '"ConfigSectionUpdate"', '"cold_on_idle"', '"cold_on_age"', '"cold_max_hot_seconds"', '"cold_on_lru"', '"cold_on_shutdown"', '"cold_gc_interval_seconds"', '"cold_gc_max_delete"', '"collapse_enabled"', '"collapse_wait_timeout_ms"', '"collapse_timeout_fallback"', '"stale_if_error_timeout"', '"stale_if_error_connection"', '"stale_if_error_dns"', '"stale_if_error_tls"', '"stale_if_error_statuses"', '"proactive_refresh_enabled"', '"proactive_refresh_before_expiry_seconds"', '"proactive_refresh_percent"', '"proactive_refresh_max_inflight"', '"TransformSettings"', '"TransformOverrides"', '"/api/cache/cold/cleanup"', '"/api/cache/invalidate"', '"/api/cache/bans"', '"/api/cache/bans/{id}"', '"CacheInvalidationRequest"', '"CacheInvalidationResponse"', '"ColdCleanupJob"', '"match_type"', '"regex_insensitive"', '"rewrite"', '"response"', '"covered_hosts"', '"default": true']:
assert marker in openapi, marker
for marker in ['"NotFoundHost"', '"not_found_hosts"', '"PrometheusSettings"', '"allow_trusted_network_without_token"', '"include_docker_vhosts"', '"include_streams"', '"include_logging"']:
assert marker in openapi, marker
@@ -593,10 +589,13 @@ for marker in ['https://git.linuxiarz.pl/gru/RustProxy', 'https://rustproxy.linu
for language in ['langs/en_US.json', 'langs/pl_pl.json']:
language_text = (root / language).read_text(encoding='utf-8')
assert './dev.sh tls deploy' not in language_text
assert '/opt/rustproxy/current/rust-proxy --data-dir /var/lib/rustproxy tls deploy' in language_text
assert 'rust-proxy --data-dir /var/lib/rustproxy tls deploy' in language_text
startup_source = rust_source(root, 'src/main/admin_runtime.rs')
for marker in ['https://git.linuxiarz.pl/gru/RustProxy', 'https://rustproxy.linuxiarz.pl/', 'join("acme-python")', 'certificate_runtime']:
for marker in ['https://git.linuxiarz.pl/gru/RustProxy', 'https://rustproxy.linuxiarz.pl/']:
assert marker in startup_source, marker
assert 'Python: {} (ACME mode:' not in startup_source, 'startup banner must not print speculative ACME runtime state'
for marker in ['const protocols = ["H1"]', 'endpoint.http2', 'protocols.push("H2")', 'endpoint.h2c', 'protocols.push("H2C")', 'protocols.push("H3/UDP")']:
assert marker in app_js, marker
for document in ['docs/RENEWAL.md', 'docs/INSTALL.md', 'docs/API.md']:
document_text = (root / document).read_text(encoding='utf-8')
assert './dev.sh tls deploy' not in document_text
@@ -617,6 +616,8 @@ for marker in ['CERTBOT_PACKAGES', 'certbot==5.8.0', 'certbot-dns-cloudflare==5.
assert marker in acme_runtime_source, marker
for marker in ['venv_certbot', 'version.arg("--version")', 'RUSTPROXY_CERTBOT_EXECUTABLE', 'managed_certbot_executable']:
assert marker in acme_runtime_source, marker
for marker in ['ACME runtime check complete', 'status = runtime.status', 'mode = runtime.mode', 'python = runtime.python', 'pip = runtime.pip', 'certbot = runtime.certbot', 'managed_env = runtime.managed_directory.as_deref().unwrap_or("-")']:
assert marker in acme_runtime_source, marker
main_source = rust_source(root, "src/main.rs")
logging_source = rust_source(root, "src/logging.rs")
secret_store_source = rust_source(root, "src/secret_store.rs")
@@ -1047,7 +1048,7 @@ forwarding_source = rust_source(root, "src/forwarding.rs")
for marker in ['pub fn cloudflare_country', 'headers.get_all("cf-ipcountry")', 'country != "XX"']:
assert marker in forwarding_source, marker
forward_entry_source = rust_source(root, "src/proxy/forward_entry.rs")
for marker in ['cloudflare_country = crate::forwarding::cloudflare_country', '.or_else(|| state.geoip.country(context.client_ip))']:
for marker in ['cloudflare_country = crate::forwarding::cloudflare_country', '.or_else(|| state.geoip.load().country(context.client_ip))']:
assert marker in forward_entry_source, marker
assert forward_entry_source.count('crate::acl::allows_with_country(') >= 4, "profile/vhost/location access scopes must use composed IP+country evaluation"
route_cache_source = rust_source(root, "src/proxy/forward/route_cache.rs")
@@ -1392,7 +1393,7 @@ assert '"error_log" => {' not in admin_0241 and 'request("/api/config/error_log"
assert '"error_log"' in openapi and 'logging, error_log, forwarding' not in openapi
assert 'logging_section_persists_error_log_settings_atomically' in admin_0241 and 'error_log_is_not_a_standalone_configuration_section' in admin_0241
assert 'location.pathname === "/logging"' in settings_js_0241
assert '"RuntimeInformation"' in openapi and '"version": "0.27.3"' in openapi
assert '"RuntimeInformation"' in openapi and '"version": "0.28.0"' in openapi
# 0.24.1 compiler and hostname-cardinality regressions.
tls_0241 = rust_source(root, "src/tls.rs")
@@ -1437,5 +1438,82 @@ for schema_name in ["RedirectHost", "NotFoundHost"]:
node = openapi_0241["components"]["schemas"][schema_name]["properties"]["frontend"]["properties"]["hosts"]
assert "maxItems" not in node, schema_name
print("PASS: 0.27.3 manifest/package, shared system-statistics/runtime metadata, Settings logging, retained H2, external-packaging/Grafana/Prometheus/404-host/custom-location/path/cache/dashboard/Nagios UI/source contracts, stopped legacy-renewal removal, session/admin/transport contracts, deterministic package source and embedded SQLite schema-v8 migrations.")
# 0.27.3 maintenance regressions: restore ownership, production paths, GeoIP,
# explicit startup binds, strict WebSocket 101 framing and fail-soft update checks.
bootstrap_0273 = rust_source(root, "src/main/bootstrap.rs")
settings_0273 = rust_source(root, "src/settings.rs")
websocket_0273 = rust_source(root, "src/proxy/websocket/handshake.rs")
websocket_tests_0273 = (root / "src/proxy/websocket/tests.rs").read_text()
backup_validation_0273 = (root / "src/backup/validation.rs").read_text()
backup_owner_0273 = (root / "src/backup/ownership.rs").read_text()
geoip_update_0273 = (root / "src/geoip/update.rs").read_text()
geoip_http_0273 = (root / "src/geoip/update_http.rs").read_text()
update_check_0273 = rust_source(root, "src/update_check.rs")
admin_runtime_0273 = rust_source(root, "src/main/admin_runtime.rs")
dev_0273 = (root / "dev.sh").read_text()
style_0273 = (root / "src/admin/web/style.css").read_text()
settings_web_0273 = (root / "src/admin/web/settings.js").read_text()
assert 'default_value = "/var/lib/rustproxy"' in bootstrap_0273
assert 'RUST_PROXY_DATA_DIR="${RUST_PROXY_DATA_DIR:-$ROOT/data}"' in dev_0273
assert 'let restore_owner = if data_dir.exists()' in backup_validation_0273
assert 'set_tree_owner(&stage, owner)?;' in backup_validation_0273
assert 'libc::lchown' in backup_owner_0273 and 'restore_owner_is_applied_recursively' in (root / "src/backup/tests.rs").read_text()
assert 'explicit_startup_bind_replaces_canonical_saved_binding' in settings_0273
assert 'endpoint.id == canonical_id' in settings_0273
assert 'strict_upstream_101_body_framing_matrix' in websocket_tests_0273
assert '!headers.contains_key("transfer-encoding")' in websocket_0273
assert 'value.trim() == "0"' in websocket_0273
for marker_0273 in [
'DEFAULT_IPV4_URL', 'DEFAULT_IPV6_URL', 'DEFAULT_MMDB_URL', 'DEFAULT_MAX_BYTES',
'DEFAULT_INTERVAL_SECONDS', '.geoip-update.lock', 'pub async fn poll_loop',
'GeoIP update failed; proxy traffic is unaffected',
]:
assert marker_0273 in geoip_update_0273, marker_0273
for marker_0273 in ['pub(super) async fn download', 'expected_digest: Option<&str>', 'written <= max_bytes', 'Sha256::new()']:
assert marker_0273 in geoip_http_0273, marker_0273
assert 'state.start_geoip_updates();' in admin_runtime_0273
assert admin_runtime_0273.index('let admin_listener = TcpListener::bind(admin_addr)') < admin_runtime_0273.index('state.start_update_check(update_check);')
assert 'tracing::warn!(' in update_check_0273 and 'update check failed; retrying on the next interval' in update_check_0273
assert 'calc(100vh / var(--ui-scale, 1))' in style_0273
for marker_0273 in ['geoip-form', 'geoip_updates', '268435456', '86400']:
assert marker_0273 in settings_web_0273 or marker_0273 in html, marker_0273
assert '"geoip"' in openapi and 'GeoIpUpdateSettings' in openapi
# 0.28.0 operator controls and cache-policy regressions.
geoip_tests_0280 = (root / "src/geoip/update_tests.rs").read_text()
cache_settings_0280 = (root / "src/cache/model/settings.rs").read_text()
cache_entry_0280 = (root / "src/cache/model/entry.rs").read_text()
runtime_types_0280 = (root / "src/runtime/types.rs").read_text()
runtime_tests_0280 = (root / "src/runtime/tests.rs").read_text()
vhost_core_0280 = (root / "src/admin/web/vhosts/core.js").read_text()
runtime_web_0280 = (root / "src/admin/web/app/runtime.js").read_text()
cache_web_0280 = (root / "src/admin/web/app/settings.js").read_text()
for marker_0280 in [
'pub async fn update_now', 'publish_database(&app.geoip, database)',
'UpdateOutcome::Updated', 'UpdateOutcome::Current', 'UpdateOutcome::Busy',
]:
assert marker_0280 in geoip_update_0273, marker_0280
assert 'publishing_a_downloaded_database_hot_swaps_future_geoip_lookups' in geoip_tests_0280
assert 'state.geoip.load().country(context.client_ip)' in rust_source(root, "src/proxy/forward_entry.rs")
assert '.route("/api/geoip/update", post(geoip_update))' in admin_0241
assert 'id="geoip-update-now"' in html and 'api("/api/geoip/update", { method: "POST" })' in settings_web_0273
assert 'GeoIpUpdateResult' in openapi and '"/api/geoip/update"' in openapi
for marker_0280 in [
'DatabaseFormat::CsvPair', 'DatabaseFormat::Mmdb', 'ipv4_checksum_url: Option<String>',
'mmdb_checksum_url: Option<String>', 'validate_directory_format',
]:
assert marker_0280 in geoip_update_0273 or marker_0280 in (root / 'src/geoip.rs').read_text(), marker_0280
assert 'country.iso_code' in (root / 'langs/en_US.json').read_text()
assert 'user-country.mmdb' in settings_web_0273 and 'geoip-mmdb-url' in html
assert 'publisher checksums are intentionally not required' in (root / 'scripts/deploy/deploy_core.py').read_text().lower()
assert 'pub via_header: Option<String>' in cache_settings_0280 and 'via_header: Some("RustProxy".into())' in cache_settings_0280
assert 'http::header::VIA' in cache_entry_0280 and 'headers.append(' in cache_entry_0280
for marker_0280 in ['cache.bypass_query = false', 'cache.bypass_prefixes.clear()', 'cache.via_header = None']:
assert marker_0280 in runtime_types_0280, marker_0280
assert 'cache_invalidation(&base, &wire_only)' in runtime_tests_0280 and 'CacheInvalidation::None' in runtime_tests_0280
assert 'listener-active-item' in runtime_web_0280 and 'listener-active-feature' in runtime_web_0280
assert 'cache-via-enabled' in cache_web_0280 and 'via_header:' in cache_web_0280
assert 'location-header-direction location-header-editor' in vhost_core_0280
print("PASS: 0.28.0 manifest/package, shared system-statistics/runtime metadata, Settings logging, retained H2, external-packaging/Grafana/Prometheus/404-host/custom-location/path/cache/dashboard/Nagios UI/source contracts, stopped legacy-renewal removal, session/admin/transport contracts, deterministic package source and embedded SQLite schema-v8 migrations.")
print("NOT VERIFIED: Rust parsing, types, compilation, linking or runtime behavior. Run ./dev.sh test.")