Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- tasks/backcountry/environment/candidate-abi/websitebench/__init__.py +1 -0
- tasks/backcountry/environment/candidate-abi/websitebench/harbor/__init__.py +1 -0
- tasks/backcountry/environment/candidate-abi/websitebench/harbor/candidate_preflight.py +179 -0
- tasks/backcountry/environment/candidate-abi/websitebench/harbor/compiler.py +1128 -0
- tasks/backcountry/environment/candidate-abi/websitebench/harbor/sandbox.py +841 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/404.html +11 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/_account_nav.html +12 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/_icons.html +5 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/_tile.html +38 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/account.html +42 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/base.html +221 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/brands.html +13 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/cart.html +93 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/checkout.html +44 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/forgot_password.html +34 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/home.html +101 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/informational.html +19 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/order_detail.html +42 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/orders.html +41 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/pdp.html +223 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/plp.html +106 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/register.html +42 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/signin.html +36 -0
- tasks/backcountry/environment/reference/clone/frontend/templates/wishlist.html +20 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/BEA/BEA1WYK/PIN.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/BRK/BRK006S/BKOILLEA.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/BRK/BRK006S/HABOILLEA.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/BRK/BRK006S/TOBOILLEA.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/BRK/BRKX0B3/BLASUE.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/BRK/BRKX0B3/PURSAGSUE.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/BRK/BRKX0B3/TAUSUE.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/BRK/BRKX0CT/TAU.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/CCN/CCN000K/HAVBLU.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/CCN/CCN000K/JUGRTALI.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/CCN/CCN000K/SAN.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/CCN/CCN000K/SEDRED.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/CCN/CCN000K/WHIMAR.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/CON/CONF03O/BLA.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/CON/CONF03O/BLABLACHI.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/CON/CONF03O/TAN.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/DAK/DAKZ75O/WHI.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/DAK/DAKZ75P/WHI.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/DAK/DAKZ7X2/ROBGRECAM.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/DAK/DAKZ838/CAR.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/DAK/DAKZ838/MIDBLO.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/DAK/DAKZ839/MIDBLO.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/DAK/DAKZ83T/BLA.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/DEU/DEU000K/BK.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/DEU/DEU000K/BLUSPR.jpg +3 -0
- tasks/backcountry/environment/reference/clone/static/assets/items/small/DEU/DEU000K/CAM.jpg +3 -0
tasks/backcountry/environment/candidate-abi/websitebench/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
"""Public WebsiteBench candidate ABI tooling."""
|
tasks/backcountry/environment/candidate-abi/websitebench/harbor/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
"""Public Harbor candidate ABI tooling."""
|
tasks/backcountry/environment/candidate-abi/websitebench/harbor/candidate_preflight.py
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Agent-visible preflight for the public Harbor candidate runtime ABI."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import argparse
|
| 6 |
+
import json
|
| 7 |
+
import socket
|
| 8 |
+
import sys
|
| 9 |
+
import tempfile
|
| 10 |
+
from pathlib import Path
|
| 11 |
+
from typing import Sequence
|
| 12 |
+
|
| 13 |
+
from .compiler import (
|
| 14 |
+
CompilerSandboxError,
|
| 15 |
+
RuntimeInfrastructureError,
|
| 16 |
+
compile_candidate,
|
| 17 |
+
validate_runtime_lifecycle,
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
FORBIDDEN_PRIVATE_ROOT = b"/app/repo"
|
| 22 |
+
NONPORTABLE_PYTHON_SHEBANG = b"#!/usr/bin/python3"
|
| 23 |
+
PORTABLE_PYTHON_SHEBANG = b"#!/usr/bin/env python3"
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def _first_line(path: Path) -> bytes:
|
| 27 |
+
with path.open("rb") as handle:
|
| 28 |
+
return handle.readline(4097).rstrip(b"\r\n")
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def _contains(path: Path, needle: bytes) -> bool:
|
| 32 |
+
overlap = max(0, len(needle) - 1)
|
| 33 |
+
previous = b""
|
| 34 |
+
with path.open("rb") as handle:
|
| 35 |
+
while chunk := handle.read(1024 * 1024):
|
| 36 |
+
value = previous + chunk
|
| 37 |
+
if needle in value:
|
| 38 |
+
return True
|
| 39 |
+
previous = value[-overlap:] if overlap else b""
|
| 40 |
+
return False
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
def validate_portable_candidate_paths(
|
| 44 |
+
compile_script: Path, executable: Path | None = None
|
| 45 |
+
) -> None:
|
| 46 |
+
"""Reject paths that work in the Agent checkout but not the private build."""
|
| 47 |
+
|
| 48 |
+
if _contains(compile_script, FORBIDDEN_PRIVATE_ROOT):
|
| 49 |
+
raise CompilerSandboxError(
|
| 50 |
+
"compile.sh hard-codes /app/repo; the verifier relocates the candidate "
|
| 51 |
+
"to a private build root. Use paths relative to the current directory "
|
| 52 |
+
"or $WEBSITEBENCH_BUILD_ROOT."
|
| 53 |
+
)
|
| 54 |
+
if _first_line(compile_script) == NONPORTABLE_PYTHON_SHEBANG:
|
| 55 |
+
raise CompilerSandboxError(
|
| 56 |
+
"compile.sh uses the non-portable #!/usr/bin/python3 shebang; use "
|
| 57 |
+
"#!/usr/bin/env python3."
|
| 58 |
+
)
|
| 59 |
+
if executable is None:
|
| 60 |
+
return
|
| 61 |
+
if _first_line(executable) == NONPORTABLE_PYTHON_SHEBANG:
|
| 62 |
+
raise CompilerSandboxError(
|
| 63 |
+
"executable uses the non-portable #!/usr/bin/python3 shebang; use "
|
| 64 |
+
"#!/usr/bin/env python3."
|
| 65 |
+
)
|
| 66 |
+
if _contains(executable, FORBIDDEN_PRIVATE_ROOT):
|
| 67 |
+
raise CompilerSandboxError(
|
| 68 |
+
"executable contains /app/repo; runtime files live in the private "
|
| 69 |
+
"build root. Resolve resources relative to executable, not /app/repo."
|
| 70 |
+
)
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
def _free_port() -> int:
|
| 74 |
+
with socket.socket() as probe:
|
| 75 |
+
probe.bind(("127.0.0.1", 0))
|
| 76 |
+
return int(probe.getsockname()[1])
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
def _build_log(private_root: Path) -> str:
|
| 80 |
+
path = private_root / "build.log"
|
| 81 |
+
try:
|
| 82 |
+
value = path.read_text(encoding="utf-8", errors="replace")
|
| 83 |
+
except OSError:
|
| 84 |
+
return ""
|
| 85 |
+
return value[-65536:]
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
def run_preflight(
|
| 89 |
+
candidate_root: Path,
|
| 90 |
+
*,
|
| 91 |
+
timeout: float = 300.0,
|
| 92 |
+
seed: int = 0,
|
| 93 |
+
timezone: str = "UTC",
|
| 94 |
+
) -> dict[str, object]:
|
| 95 |
+
candidate = candidate_root.resolve(strict=True)
|
| 96 |
+
compile_script = candidate / "compile.sh"
|
| 97 |
+
if not compile_script.is_file():
|
| 98 |
+
raise CompilerSandboxError("candidate root does not contain compile.sh")
|
| 99 |
+
validate_portable_candidate_paths(compile_script)
|
| 100 |
+
with tempfile.TemporaryDirectory(prefix="websitebench-candidate-preflight-") as raw:
|
| 101 |
+
working_root = Path(raw)
|
| 102 |
+
private_root = working_root / "compiler"
|
| 103 |
+
try:
|
| 104 |
+
artifact = compile_candidate(
|
| 105 |
+
candidate,
|
| 106 |
+
private_root,
|
| 107 |
+
timeout=timeout,
|
| 108 |
+
seed=seed,
|
| 109 |
+
timezone=timezone,
|
| 110 |
+
)
|
| 111 |
+
except CompilerSandboxError as exc:
|
| 112 |
+
log = _build_log(private_root)
|
| 113 |
+
if log:
|
| 114 |
+
raise CompilerSandboxError(f"{exc}\ncompiler output:\n{log}") from exc
|
| 115 |
+
raise
|
| 116 |
+
validate_portable_candidate_paths(
|
| 117 |
+
artifact.build_root / "compile.sh", artifact.executable
|
| 118 |
+
)
|
| 119 |
+
lifecycle = validate_runtime_lifecycle(
|
| 120 |
+
artifact,
|
| 121 |
+
port=_free_port(),
|
| 122 |
+
seed=seed,
|
| 123 |
+
working_root=working_root / "runtime-preflight",
|
| 124 |
+
worker_access_roots=(working_root,),
|
| 125 |
+
timezone=timezone,
|
| 126 |
+
)
|
| 127 |
+
if lifecycle.get("valid") is not True:
|
| 128 |
+
failed = sorted(
|
| 129 |
+
key
|
| 130 |
+
for key, value in lifecycle.items()
|
| 131 |
+
if key not in {"deployment_abi", "tree_sha256", "valid"}
|
| 132 |
+
and value is not True
|
| 133 |
+
)
|
| 134 |
+
raise CompilerSandboxError(
|
| 135 |
+
"candidate runtime ABI lifecycle failed: " + ",".join(failed)
|
| 136 |
+
)
|
| 137 |
+
return {
|
| 138 |
+
"schema": "websitebench.harbor.candidate-preflight",
|
| 139 |
+
"status": "valid",
|
| 140 |
+
"candidate_root": str(candidate),
|
| 141 |
+
"tree_sha256": artifact.tree_sha256,
|
| 142 |
+
"lifecycle": lifecycle,
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
def _parser() -> argparse.ArgumentParser:
|
| 147 |
+
parser = argparse.ArgumentParser(
|
| 148 |
+
description="Check a candidate with the formal private compile/runtime ABI."
|
| 149 |
+
)
|
| 150 |
+
parser.add_argument("candidate_root", nargs="?", type=Path, default=Path.cwd())
|
| 151 |
+
parser.add_argument("--timeout", type=float, default=300.0)
|
| 152 |
+
parser.add_argument("--seed", type=int, default=0)
|
| 153 |
+
parser.add_argument("--timezone", default="UTC")
|
| 154 |
+
return parser
|
| 155 |
+
|
| 156 |
+
|
| 157 |
+
def main(arguments: Sequence[str] | None = None) -> int:
|
| 158 |
+
values = _parser().parse_args(arguments)
|
| 159 |
+
try:
|
| 160 |
+
report = run_preflight(
|
| 161 |
+
values.candidate_root,
|
| 162 |
+
timeout=values.timeout,
|
| 163 |
+
seed=values.seed,
|
| 164 |
+
timezone=values.timezone,
|
| 165 |
+
)
|
| 166 |
+
except (
|
| 167 |
+
CompilerSandboxError,
|
| 168 |
+
RuntimeInfrastructureError,
|
| 169 |
+
OSError,
|
| 170 |
+
ValueError,
|
| 171 |
+
) as exc:
|
| 172 |
+
print(f"candidate ABI preflight failed: {exc}", file=sys.stderr)
|
| 173 |
+
return 2
|
| 174 |
+
print(json.dumps(report, indent=2, sort_keys=True))
|
| 175 |
+
return 0
|
| 176 |
+
|
| 177 |
+
|
| 178 |
+
if __name__ == "__main__":
|
| 179 |
+
raise SystemExit(main())
|
tasks/backcountry/environment/candidate-abi/websitebench/harbor/compiler.py
ADDED
|
@@ -0,0 +1,1128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Quarantined compiler and runtime for the Harbor compile-executable ABI."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import ctypes
|
| 6 |
+
import errno
|
| 7 |
+
import hashlib
|
| 8 |
+
import json
|
| 9 |
+
import os
|
| 10 |
+
import shutil
|
| 11 |
+
import signal
|
| 12 |
+
import stat
|
| 13 |
+
import subprocess
|
| 14 |
+
import time
|
| 15 |
+
import urllib.error
|
| 16 |
+
import urllib.request
|
| 17 |
+
from dataclasses import dataclass
|
| 18 |
+
from pathlib import Path
|
| 19 |
+
from typing import Any, Iterable, Mapping, Sequence
|
| 20 |
+
|
| 21 |
+
try: # pragma: no cover - unavailable on Windows authoring hosts
|
| 22 |
+
import resource
|
| 23 |
+
except ImportError: # pragma: no cover
|
| 24 |
+
resource = None # type: ignore[assignment]
|
| 25 |
+
|
| 26 |
+
from . import sandbox
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
DEPLOYMENT_ABI = "websitebench.harbor.compile-executable"
|
| 30 |
+
COMPILE_ENTRYPOINT = "compile.sh"
|
| 31 |
+
EXECUTABLE_ENTRYPOINT = "executable"
|
| 32 |
+
HEALTH_PATH = "/healthz"
|
| 33 |
+
# The contract moved to /healthz (ADR-0010) because every reference site and
|
| 34 |
+
# every manifest already served that path, while nothing ever implemented the
|
| 35 |
+
# benchmark-private one. Candidates built against the old instruction text keep
|
| 36 |
+
# working: probing falls back to these.
|
| 37 |
+
LEGACY_HEALTH_PATHS = ("/__websitebench/health",)
|
| 38 |
+
HEALTH_PATHS = (HEALTH_PATH, *LEGACY_HEALTH_PATHS)
|
| 39 |
+
HEALTH_BODY = {"status": "ok"}
|
| 40 |
+
RUNTIME_PROCESS_MODEL = {
|
| 41 |
+
"kind": "single-process",
|
| 42 |
+
"process_fork": False,
|
| 43 |
+
"threads": True,
|
| 44 |
+
"launcher": "direct-exec-or-shell-builtins-only",
|
| 45 |
+
}
|
| 46 |
+
DEFAULT_COMPILE_TIMEOUT = 900.0
|
| 47 |
+
MAX_LOG_BYTES = 256 * 1024 * 1024
|
| 48 |
+
WORKER_OS_UID = 10001
|
| 49 |
+
WORKER_OS_GID = 10001
|
| 50 |
+
_RUNTIME_PRIVATE_DIRECTORIES = (
|
| 51 |
+
"home",
|
| 52 |
+
"tmp",
|
| 53 |
+
"xdg-cache",
|
| 54 |
+
"xdg-config",
|
| 55 |
+
"xdg-data",
|
| 56 |
+
)
|
| 57 |
+
CANDIDATE_MAIL_ENVIRONMENT = frozenset(
|
| 58 |
+
{
|
| 59 |
+
"WEBSITEBENCH_MAIL_API_URL",
|
| 60 |
+
"WEBSITEBENCH_MAIL_API_TOKEN",
|
| 61 |
+
"WEBSITEBENCH_MAIL_FROM",
|
| 62 |
+
"WEBSITEBENCH_SMTP_HOST",
|
| 63 |
+
"WEBSITEBENCH_SMTP_PORT",
|
| 64 |
+
"WEBSITEBENCH_SMTP_FROM",
|
| 65 |
+
"WEBSITEBENCH_MAILBOX_BOOTSTRAP_URL",
|
| 66 |
+
"WEBSITEBENCH_MAILBOX_BOOTSTRAP_TOKEN",
|
| 67 |
+
}
|
| 68 |
+
)
|
| 69 |
+
CANDIDATE_EVALUATOR_ENVIRONMENT = frozenset(
|
| 70 |
+
{
|
| 71 |
+
"WEBSITEBENCH_VERIFIER_MODE",
|
| 72 |
+
"WEBSITEBENCH_VERIFIER_ALEX_SECRET",
|
| 73 |
+
"WEBSITEBENCH_VERIFIER_JORDAN_SECRET",
|
| 74 |
+
"WEBSITEBENCH_EVALUATOR_PRIMARY_SECRET",
|
| 75 |
+
"WEBSITEBENCH_EVALUATOR_SECONDARY_SECRET",
|
| 76 |
+
}
|
| 77 |
+
)
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
class CompilerSandboxError(RuntimeError):
|
| 81 |
+
"""The candidate artifact, compiler, or compiled runtime broke the ABI."""
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
class RuntimeInfrastructureError(RuntimeError):
|
| 85 |
+
"""The trusted runtime supervisor could not establish its worker boundary."""
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
def _runtime_worker_credentials() -> tuple[int, int] | None:
|
| 89 |
+
"""Return the fixed worker identity only for a privileged supervisor."""
|
| 90 |
+
|
| 91 |
+
if os.geteuid() == 0:
|
| 92 |
+
return WORKER_OS_UID, WORKER_OS_GID
|
| 93 |
+
return None
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
def _worker_execute_bit(metadata: os.stat_result, uid: int, gid: int) -> int:
|
| 97 |
+
if metadata.st_uid == uid:
|
| 98 |
+
return stat.S_IXUSR
|
| 99 |
+
if metadata.st_gid == gid:
|
| 100 |
+
return stat.S_IXGRP
|
| 101 |
+
return stat.S_IXOTH
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
def _worker_access_root(path: Path, roots: Sequence[Path]) -> Path:
|
| 105 |
+
matches = [root for root in roots if path == root or root in path.parents]
|
| 106 |
+
if not matches:
|
| 107 |
+
raise OSError(
|
| 108 |
+
errno.EPERM,
|
| 109 |
+
f"worker path is outside caller-declared access roots: {path}",
|
| 110 |
+
)
|
| 111 |
+
return max(matches, key=lambda root: len(root.parts))
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
def _make_worker_ancestors_traversable(
|
| 115 |
+
path: Path,
|
| 116 |
+
uid: int,
|
| 117 |
+
gid: int,
|
| 118 |
+
*,
|
| 119 |
+
access_root: Path,
|
| 120 |
+
) -> None:
|
| 121 |
+
"""Grant traverse only within one exact caller-declared task root."""
|
| 122 |
+
|
| 123 |
+
for boundary_parent in access_root.parents:
|
| 124 |
+
metadata = boundary_parent.stat()
|
| 125 |
+
if not stat.S_ISDIR(metadata.st_mode) or not (
|
| 126 |
+
stat.S_IMODE(metadata.st_mode)
|
| 127 |
+
& _worker_execute_bit(metadata, uid, gid)
|
| 128 |
+
):
|
| 129 |
+
raise OSError(
|
| 130 |
+
errno.EACCES,
|
| 131 |
+
f"worker access-root boundary is not traversable: {boundary_parent}",
|
| 132 |
+
)
|
| 133 |
+
|
| 134 |
+
ancestors = [path, *path.parents]
|
| 135 |
+
try:
|
| 136 |
+
boundary_index = ancestors.index(access_root)
|
| 137 |
+
except ValueError as exc: # guarded by _worker_access_root
|
| 138 |
+
raise OSError(errno.EPERM, "worker access-root containment changed") from exc
|
| 139 |
+
for ancestor in ancestors[: boundary_index + 1]:
|
| 140 |
+
metadata = ancestor.stat()
|
| 141 |
+
if not stat.S_ISDIR(metadata.st_mode):
|
| 142 |
+
raise OSError(errno.ENOTDIR, f"worker ancestor is not a directory: {ancestor}")
|
| 143 |
+
mode = stat.S_IMODE(metadata.st_mode)
|
| 144 |
+
execute_bit = _worker_execute_bit(metadata, uid, gid)
|
| 145 |
+
if not mode & execute_bit:
|
| 146 |
+
ancestor.chmod(mode | execute_bit)
|
| 147 |
+
|
| 148 |
+
|
| 149 |
+
def _prepare_runtime_directories(
|
| 150 |
+
build: Path,
|
| 151 |
+
data: Path,
|
| 152 |
+
credentials: tuple[int, int] | None,
|
| 153 |
+
*,
|
| 154 |
+
worker_access_roots: Sequence[Path],
|
| 155 |
+
) -> None:
|
| 156 |
+
"""Create private runtime state and make it usable by the worker identity."""
|
| 157 |
+
|
| 158 |
+
data.mkdir(parents=True, exist_ok=True, mode=0o700)
|
| 159 |
+
private_directories = [data]
|
| 160 |
+
for name in _RUNTIME_PRIVATE_DIRECTORIES:
|
| 161 |
+
directory = data / name
|
| 162 |
+
directory.mkdir(parents=True, exist_ok=True, mode=0o700)
|
| 163 |
+
private_directories.append(directory)
|
| 164 |
+
|
| 165 |
+
for directory in private_directories:
|
| 166 |
+
metadata = directory.lstat()
|
| 167 |
+
if not stat.S_ISDIR(metadata.st_mode):
|
| 168 |
+
raise OSError(
|
| 169 |
+
errno.ENOTDIR,
|
| 170 |
+
f"runtime private path is not a directory: {directory}",
|
| 171 |
+
)
|
| 172 |
+
|
| 173 |
+
if credentials is not None:
|
| 174 |
+
uid, gid = credentials
|
| 175 |
+
roots: list[Path] = []
|
| 176 |
+
for raw_root in worker_access_roots:
|
| 177 |
+
absolute = Path(raw_root).absolute()
|
| 178 |
+
root = absolute.resolve(strict=True)
|
| 179 |
+
metadata = absolute.lstat()
|
| 180 |
+
if (
|
| 181 |
+
root == Path(root.anchor)
|
| 182 |
+
or root != absolute
|
| 183 |
+
or not stat.S_ISDIR(metadata.st_mode)
|
| 184 |
+
):
|
| 185 |
+
raise OSError(errno.EPERM, f"invalid worker access root: {raw_root}")
|
| 186 |
+
if root not in roots:
|
| 187 |
+
roots.append(root)
|
| 188 |
+
if not roots:
|
| 189 |
+
raise OSError(errno.EPERM, "worker access roots were not declared")
|
| 190 |
+
for directory in private_directories:
|
| 191 |
+
os.chown(directory, uid, gid, follow_symlinks=False)
|
| 192 |
+
for target in (build, data):
|
| 193 |
+
access_root = _worker_access_root(target, roots)
|
| 194 |
+
_make_worker_ancestors_traversable(
|
| 195 |
+
target,
|
| 196 |
+
uid,
|
| 197 |
+
gid,
|
| 198 |
+
access_root=access_root,
|
| 199 |
+
)
|
| 200 |
+
|
| 201 |
+
for directory in private_directories:
|
| 202 |
+
directory.chmod(0o700)
|
| 203 |
+
|
| 204 |
+
|
| 205 |
+
def _proc_status_identity(path: Path) -> tuple[tuple[int, ...], tuple[int, ...], int]:
|
| 206 |
+
"""Read real/effective/saved/fs IDs and PPid from a proc status file."""
|
| 207 |
+
|
| 208 |
+
fields: dict[str, tuple[int, ...]] = {}
|
| 209 |
+
try:
|
| 210 |
+
for line in path.read_text(encoding="ascii").splitlines():
|
| 211 |
+
name, separator, value = line.partition(":")
|
| 212 |
+
if separator and name in {"Uid", "Gid", "PPid"}:
|
| 213 |
+
fields[name] = tuple(int(item) for item in value.split())
|
| 214 |
+
except (OSError, UnicodeError, ValueError) as exc:
|
| 215 |
+
raise OSError(errno.EIO, f"process identity is unreadable: {path}") from exc
|
| 216 |
+
if len(fields.get("Uid", ())) != 4 or len(fields.get("Gid", ())) != 4:
|
| 217 |
+
raise OSError(errno.EIO, f"process identity is incomplete: {path}")
|
| 218 |
+
if len(fields.get("PPid", ())) != 1:
|
| 219 |
+
raise OSError(errno.EIO, f"process parent identity is incomplete: {path}")
|
| 220 |
+
return fields["Uid"], fields["Gid"], fields["PPid"][0]
|
| 221 |
+
|
| 222 |
+
|
| 223 |
+
@dataclass(frozen=True)
|
| 224 |
+
class CompiledArtifact:
|
| 225 |
+
source_root: Path
|
| 226 |
+
build_root: Path
|
| 227 |
+
executable: Path
|
| 228 |
+
tree_sha256: str
|
| 229 |
+
build_log: Path
|
| 230 |
+
|
| 231 |
+
|
| 232 |
+
def _safe_name(name: str) -> bool:
|
| 233 |
+
return (
|
| 234 |
+
bool(name)
|
| 235 |
+
and name not in {".", ".."}
|
| 236 |
+
and "/" not in name
|
| 237 |
+
and "\x00" not in name
|
| 238 |
+
)
|
| 239 |
+
|
| 240 |
+
|
| 241 |
+
def _tree_entries(root: Path) -> Iterable[tuple[Path, os.stat_result]]:
|
| 242 |
+
"""Walk with lstat only; never follow candidate-authored links."""
|
| 243 |
+
|
| 244 |
+
stack = [root]
|
| 245 |
+
while stack:
|
| 246 |
+
directory = stack.pop()
|
| 247 |
+
with os.scandir(directory) as iterator:
|
| 248 |
+
entries = sorted(iterator, key=lambda item: os.fsencode(item.name))
|
| 249 |
+
subdirectories: list[Path] = []
|
| 250 |
+
for entry in entries:
|
| 251 |
+
if not _safe_name(entry.name):
|
| 252 |
+
raise CompilerSandboxError(f"unsafe artifact name: {entry.name!r}")
|
| 253 |
+
path = Path(entry.path)
|
| 254 |
+
metadata = entry.stat(follow_symlinks=False)
|
| 255 |
+
yield path, metadata
|
| 256 |
+
if stat.S_ISDIR(metadata.st_mode):
|
| 257 |
+
subdirectories.append(path)
|
| 258 |
+
stack.extend(reversed(subdirectories))
|
| 259 |
+
|
| 260 |
+
|
| 261 |
+
def validate_artifact_tree(root: Path | str) -> list[Path]:
|
| 262 |
+
"""Reject links, special files, multiple links, and paths outside ``root``."""
|
| 263 |
+
|
| 264 |
+
resolved = Path(root).resolve(strict=True)
|
| 265 |
+
root_stat = resolved.lstat()
|
| 266 |
+
if not stat.S_ISDIR(root_stat.st_mode):
|
| 267 |
+
raise CompilerSandboxError("candidate artifact root must be a directory")
|
| 268 |
+
files: list[Path] = []
|
| 269 |
+
for path, metadata in _tree_entries(resolved):
|
| 270 |
+
try:
|
| 271 |
+
relative = path.relative_to(resolved)
|
| 272 |
+
except ValueError as exc: # defensive: scandir paths must remain below root
|
| 273 |
+
raise CompilerSandboxError(f"artifact path escapes root: {path}") from exc
|
| 274 |
+
if not relative.parts or any(
|
| 275 |
+
part in {"", ".", ".."} for part in relative.parts
|
| 276 |
+
):
|
| 277 |
+
raise CompilerSandboxError(f"unsafe artifact path: {relative}")
|
| 278 |
+
if stat.S_ISLNK(metadata.st_mode):
|
| 279 |
+
raise CompilerSandboxError(f"symbolic links are forbidden: {relative}")
|
| 280 |
+
if stat.S_ISREG(metadata.st_mode):
|
| 281 |
+
if metadata.st_nlink != 1:
|
| 282 |
+
raise CompilerSandboxError(
|
| 283 |
+
f"hard-linked files are forbidden: {relative}"
|
| 284 |
+
)
|
| 285 |
+
files.append(path)
|
| 286 |
+
elif not stat.S_ISDIR(metadata.st_mode):
|
| 287 |
+
raise CompilerSandboxError(f"special files are forbidden: {relative}")
|
| 288 |
+
return files
|
| 289 |
+
|
| 290 |
+
|
| 291 |
+
def quarantine_artifact(source: Path | str, destination: Path | str) -> Path:
|
| 292 |
+
"""Copy `/app/repo` into a fresh private build root without link semantics."""
|
| 293 |
+
|
| 294 |
+
source_root = Path(source).resolve(strict=True)
|
| 295 |
+
destination_root = Path(destination).resolve()
|
| 296 |
+
validate_artifact_tree(source_root)
|
| 297 |
+
if destination_root.exists():
|
| 298 |
+
raise FileExistsError(f"private build root already exists: {destination_root}")
|
| 299 |
+
destination_root.mkdir(parents=True, mode=0o700)
|
| 300 |
+
try:
|
| 301 |
+
for path, metadata in _tree_entries(source_root):
|
| 302 |
+
relative = path.relative_to(source_root)
|
| 303 |
+
target = destination_root / relative
|
| 304 |
+
if stat.S_ISDIR(metadata.st_mode):
|
| 305 |
+
target.mkdir(mode=stat.S_IMODE(metadata.st_mode) | 0o700)
|
| 306 |
+
else:
|
| 307 |
+
target.parent.mkdir(parents=True, exist_ok=True)
|
| 308 |
+
with (
|
| 309 |
+
path.open("rb") as source_handle,
|
| 310 |
+
target.open("xb") as target_handle,
|
| 311 |
+
):
|
| 312 |
+
shutil.copyfileobj(source_handle, target_handle, length=1024 * 1024)
|
| 313 |
+
target_handle.flush()
|
| 314 |
+
os.fsync(target_handle.fileno())
|
| 315 |
+
target.chmod(stat.S_IMODE(metadata.st_mode))
|
| 316 |
+
validate_artifact_tree(destination_root)
|
| 317 |
+
except BaseException:
|
| 318 |
+
shutil.rmtree(destination_root, ignore_errors=True)
|
| 319 |
+
raise
|
| 320 |
+
return destination_root
|
| 321 |
+
|
| 322 |
+
|
| 323 |
+
def _compile_environment(
|
| 324 |
+
build_root: Path, data_root: Path, seed: int, timezone: str
|
| 325 |
+
) -> dict[str, str]:
|
| 326 |
+
# This is an allowlist, not a copy of the verifier environment. In
|
| 327 |
+
# particular no provider, cloud, source, or hidden-fixture credential can
|
| 328 |
+
# reach compile.sh.
|
| 329 |
+
return {
|
| 330 |
+
"PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
| 331 |
+
"LANG": "C.UTF-8",
|
| 332 |
+
"LC_ALL": "C.UTF-8",
|
| 333 |
+
"HOST": "127.0.0.1",
|
| 334 |
+
"PORT": "3000",
|
| 335 |
+
"DATA_DIR": str(data_root),
|
| 336 |
+
"SEED": str(seed),
|
| 337 |
+
"TZ": timezone,
|
| 338 |
+
"HOME": str(data_root / "home"),
|
| 339 |
+
"TMPDIR": str(data_root / "tmp"),
|
| 340 |
+
"XDG_CACHE_HOME": str(data_root / "xdg-cache"),
|
| 341 |
+
"XDG_CONFIG_HOME": str(data_root / "xdg-config"),
|
| 342 |
+
"XDG_DATA_HOME": str(data_root / "xdg-data"),
|
| 343 |
+
"WEBSITEBENCH_DEPLOYMENT_ABI": DEPLOYMENT_ABI,
|
| 344 |
+
"WEBSITEBENCH_BUILD_ROOT": str(build_root),
|
| 345 |
+
}
|
| 346 |
+
|
| 347 |
+
|
| 348 |
+
def _install_socket_deny_filter() -> None:
|
| 349 |
+
"""Deny sockets and process-group escape while allowing compiler children."""
|
| 350 |
+
|
| 351 |
+
(
|
| 352 |
+
audit_arch,
|
| 353 |
+
socket_syscall,
|
| 354 |
+
_fcntl_syscall,
|
| 355 |
+
seccomp_syscall,
|
| 356 |
+
_denied,
|
| 357 |
+
) = sandbox._architecture()
|
| 358 |
+
escape_syscalls = (109, 112) if audit_arch == 0xC000003E else (154, 157)
|
| 359 |
+
instructions = [
|
| 360 |
+
(sandbox.BPF_LD_W_ABS, 0, 0, 4),
|
| 361 |
+
(sandbox.BPF_JMP_JEQ_K, 1, 0, audit_arch),
|
| 362 |
+
(sandbox.BPF_RET_K, 0, 0, sandbox.SECCOMP_RET_KILL_PROCESS),
|
| 363 |
+
(sandbox.BPF_LD_W_ABS, 0, 0, 0),
|
| 364 |
+
(sandbox.BPF_JMP_JEQ_K, 0, 1, socket_syscall),
|
| 365 |
+
(
|
| 366 |
+
sandbox.BPF_RET_K,
|
| 367 |
+
0,
|
| 368 |
+
0,
|
| 369 |
+
sandbox.SECCOMP_RET_ERRNO | errno.EPERM,
|
| 370 |
+
),
|
| 371 |
+
]
|
| 372 |
+
for syscall_number in escape_syscalls:
|
| 373 |
+
instructions.extend(
|
| 374 |
+
[
|
| 375 |
+
(sandbox.BPF_JMP_JEQ_K, 0, 1, syscall_number),
|
| 376 |
+
(
|
| 377 |
+
sandbox.BPF_RET_K,
|
| 378 |
+
0,
|
| 379 |
+
0,
|
| 380 |
+
sandbox.SECCOMP_RET_ERRNO | errno.EPERM,
|
| 381 |
+
),
|
| 382 |
+
]
|
| 383 |
+
)
|
| 384 |
+
instructions.append((sandbox.BPF_RET_K, 0, 0, sandbox.SECCOMP_RET_ALLOW))
|
| 385 |
+
filters = (sandbox._SockFilter * len(instructions))(
|
| 386 |
+
*(sandbox._SockFilter(*instruction) for instruction in instructions)
|
| 387 |
+
)
|
| 388 |
+
program = sandbox._SockFprog(len(instructions), filters)
|
| 389 |
+
libc = ctypes.CDLL(None, use_errno=True)
|
| 390 |
+
if libc.prctl(sandbox.PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) != 0:
|
| 391 |
+
raise OSError(ctypes.get_errno(), "cannot set compiler no_new_privs")
|
| 392 |
+
result = int(
|
| 393 |
+
libc.syscall(
|
| 394 |
+
seccomp_syscall,
|
| 395 |
+
sandbox.SECCOMP_SET_MODE_FILTER,
|
| 396 |
+
0,
|
| 397 |
+
ctypes.byref(program),
|
| 398 |
+
)
|
| 399 |
+
)
|
| 400 |
+
if result != 0:
|
| 401 |
+
raise OSError(ctypes.get_errno(), "cannot install compiler network filter")
|
| 402 |
+
|
| 403 |
+
|
| 404 |
+
def _compiler_preexec(
|
| 405 |
+
build_root: Path, data_root: Path, memory_mb: int, cpu_seconds: int
|
| 406 |
+
) -> None:
|
| 407 |
+
os.umask(0o077)
|
| 408 |
+
if resource is not None:
|
| 409 |
+
memory = memory_mb * 1024 * 1024
|
| 410 |
+
resource.setrlimit(resource.RLIMIT_AS, (memory, memory))
|
| 411 |
+
resource.setrlimit(resource.RLIMIT_CPU, (cpu_seconds, cpu_seconds + 5))
|
| 412 |
+
resource.setrlimit(resource.RLIMIT_NOFILE, (1024, 1024))
|
| 413 |
+
resource.setrlimit(resource.RLIMIT_FSIZE, (MAX_LOG_BYTES, MAX_LOG_BYTES))
|
| 414 |
+
# Root and data are deliberately the same writable private tree for
|
| 415 |
+
# compilation. Landlock grants system toolchains read/execute access and
|
| 416 |
+
# grants no TCP bind/connect ports. It also withholds shared filesystem
|
| 417 |
+
# socket locations such as /run and /tmp.
|
| 418 |
+
sandbox._landlock(build_root, data_root, 1, set())
|
| 419 |
+
_install_socket_deny_filter()
|
| 420 |
+
|
| 421 |
+
|
| 422 |
+
def _process_group_alive(group: int) -> bool:
|
| 423 |
+
proc = Path("/proc")
|
| 424 |
+
if proc.is_dir():
|
| 425 |
+
for status_path in proc.glob("[0-9]*/stat"):
|
| 426 |
+
try:
|
| 427 |
+
raw = status_path.read_text(encoding="ascii")
|
| 428 |
+
fields = raw[raw.rfind(")") + 2 :].split()
|
| 429 |
+
if int(fields[2]) == group and fields[0] != "Z":
|
| 430 |
+
return True
|
| 431 |
+
except (OSError, UnicodeError, ValueError, IndexError):
|
| 432 |
+
continue
|
| 433 |
+
return False
|
| 434 |
+
try:
|
| 435 |
+
os.killpg(group, 0)
|
| 436 |
+
except (ProcessLookupError, PermissionError):
|
| 437 |
+
return False
|
| 438 |
+
return True
|
| 439 |
+
|
| 440 |
+
|
| 441 |
+
def _terminate_group(
|
| 442 |
+
process: subprocess.Popen[Any],
|
| 443 |
+
timeout: float = 10.0,
|
| 444 |
+
*,
|
| 445 |
+
accept_forced: bool = False,
|
| 446 |
+
) -> bool:
|
| 447 |
+
group = process.pid
|
| 448 |
+
if process.poll() is None:
|
| 449 |
+
try:
|
| 450 |
+
os.killpg(group, signal.SIGTERM)
|
| 451 |
+
except ProcessLookupError:
|
| 452 |
+
pass
|
| 453 |
+
deadline = time.monotonic() + timeout
|
| 454 |
+
while _process_group_alive(group) and time.monotonic() < deadline:
|
| 455 |
+
time.sleep(0.02)
|
| 456 |
+
graceful = not _process_group_alive(group)
|
| 457 |
+
if not graceful:
|
| 458 |
+
try:
|
| 459 |
+
os.killpg(group, signal.SIGKILL)
|
| 460 |
+
except ProcessLookupError:
|
| 461 |
+
pass
|
| 462 |
+
try:
|
| 463 |
+
process.wait(timeout=5)
|
| 464 |
+
except subprocess.TimeoutExpired:
|
| 465 |
+
return False
|
| 466 |
+
terminated = not _process_group_alive(group)
|
| 467 |
+
return graceful or (accept_forced and terminated)
|
| 468 |
+
|
| 469 |
+
|
| 470 |
+
def _stop_controlled_group(
|
| 471 |
+
process: subprocess.Popen[Any],
|
| 472 |
+
control_fd: int,
|
| 473 |
+
timeout: float = 10.0,
|
| 474 |
+
*,
|
| 475 |
+
accept_forced: bool = False,
|
| 476 |
+
) -> bool:
|
| 477 |
+
"""Ask the trusted sandbox launcher to stop its tracee, then reap the group."""
|
| 478 |
+
|
| 479 |
+
if process.poll() is None:
|
| 480 |
+
try:
|
| 481 |
+
os.write(control_fd, b"T")
|
| 482 |
+
except OSError:
|
| 483 |
+
pass
|
| 484 |
+
deadline = time.monotonic() + timeout
|
| 485 |
+
while _process_group_alive(process.pid) and time.monotonic() < deadline:
|
| 486 |
+
time.sleep(0.02)
|
| 487 |
+
graceful = not _process_group_alive(process.pid)
|
| 488 |
+
if not graceful:
|
| 489 |
+
try:
|
| 490 |
+
os.write(control_fd, b"K")
|
| 491 |
+
except OSError:
|
| 492 |
+
pass
|
| 493 |
+
time.sleep(0.1)
|
| 494 |
+
if _process_group_alive(process.pid):
|
| 495 |
+
try:
|
| 496 |
+
os.killpg(process.pid, signal.SIGKILL)
|
| 497 |
+
except ProcessLookupError:
|
| 498 |
+
pass
|
| 499 |
+
try:
|
| 500 |
+
process.wait(timeout=5)
|
| 501 |
+
except subprocess.TimeoutExpired:
|
| 502 |
+
return False
|
| 503 |
+
terminated = not _process_group_alive(process.pid)
|
| 504 |
+
return graceful or (accept_forced and terminated)
|
| 505 |
+
|
| 506 |
+
|
| 507 |
+
def _processes_referencing(root: Path, *, exclude: Sequence[int] = ()) -> list[int]:
|
| 508 |
+
references: list[int] = []
|
| 509 |
+
root_text = str(root.resolve())
|
| 510 |
+
excluded = set(exclude)
|
| 511 |
+
for process in Path("/proc").glob("[0-9]*"):
|
| 512 |
+
try:
|
| 513 |
+
pid = int(process.name)
|
| 514 |
+
if pid in excluded:
|
| 515 |
+
continue
|
| 516 |
+
cwd = os.readlink(process / "cwd")
|
| 517 |
+
command = (
|
| 518 |
+
(process / "cmdline")
|
| 519 |
+
.read_bytes()
|
| 520 |
+
.replace(b"\x00", b" ")
|
| 521 |
+
.decode("utf-8", errors="replace")
|
| 522 |
+
)
|
| 523 |
+
except (OSError, ValueError):
|
| 524 |
+
continue
|
| 525 |
+
if (
|
| 526 |
+
cwd == root_text
|
| 527 |
+
or cwd.startswith(root_text + os.sep)
|
| 528 |
+
or root_text in command
|
| 529 |
+
):
|
| 530 |
+
references.append(pid)
|
| 531 |
+
return sorted(references)
|
| 532 |
+
|
| 533 |
+
|
| 534 |
+
def tree_digest(root: Path | str) -> str:
|
| 535 |
+
resolved = Path(root).resolve(strict=True)
|
| 536 |
+
validate_artifact_tree(resolved)
|
| 537 |
+
digest = hashlib.sha256()
|
| 538 |
+
for path, metadata in _tree_entries(resolved):
|
| 539 |
+
relative = path.relative_to(resolved).as_posix().encode("utf-8")
|
| 540 |
+
kind = b"d" if stat.S_ISDIR(metadata.st_mode) else b"f"
|
| 541 |
+
digest.update(kind + b"\0" + relative + b"\0")
|
| 542 |
+
digest.update(f"{stat.S_IMODE(metadata.st_mode):04o}".encode("ascii") + b"\0")
|
| 543 |
+
if kind == b"f":
|
| 544 |
+
with path.open("rb") as handle:
|
| 545 |
+
for chunk in iter(lambda: handle.read(1024 * 1024), b""):
|
| 546 |
+
digest.update(chunk)
|
| 547 |
+
digest.update(b"\0")
|
| 548 |
+
return digest.hexdigest()
|
| 549 |
+
|
| 550 |
+
|
| 551 |
+
def freeze_build_tree(root: Path | str) -> str:
|
| 552 |
+
resolved = Path(root).resolve(strict=True)
|
| 553 |
+
validate_artifact_tree(resolved)
|
| 554 |
+
entries = list(_tree_entries(resolved))
|
| 555 |
+
for path, metadata in entries:
|
| 556 |
+
if stat.S_ISREG(metadata.st_mode):
|
| 557 |
+
executable = bool(stat.S_IMODE(metadata.st_mode) & 0o111)
|
| 558 |
+
path.chmod(0o555 if executable else 0o444)
|
| 559 |
+
for path, metadata in reversed(entries):
|
| 560 |
+
if stat.S_ISDIR(metadata.st_mode):
|
| 561 |
+
path.chmod(0o555)
|
| 562 |
+
resolved.chmod(0o555)
|
| 563 |
+
return tree_digest(resolved)
|
| 564 |
+
|
| 565 |
+
|
| 566 |
+
def compile_candidate(
|
| 567 |
+
source_root: Path | str,
|
| 568 |
+
private_root: Path | str,
|
| 569 |
+
*,
|
| 570 |
+
timeout: float = DEFAULT_COMPILE_TIMEOUT,
|
| 571 |
+
seed: int = 0,
|
| 572 |
+
timezone: str = "UTC",
|
| 573 |
+
memory_mb: int = 8192,
|
| 574 |
+
) -> CompiledArtifact:
|
| 575 |
+
"""Quarantine, compile offline once, validate, freeze, and hash the build."""
|
| 576 |
+
|
| 577 |
+
source = Path(source_root).resolve(strict=True)
|
| 578 |
+
private = Path(private_root).resolve()
|
| 579 |
+
if private.exists():
|
| 580 |
+
raise FileExistsError(f"private compiler root already exists: {private}")
|
| 581 |
+
private.mkdir(parents=True, mode=0o700)
|
| 582 |
+
build = private / "build"
|
| 583 |
+
log = private / "build.log"
|
| 584 |
+
quarantine_artifact(source, build)
|
| 585 |
+
data = build / ".websitebench-compile-data"
|
| 586 |
+
if data.exists():
|
| 587 |
+
if data.is_dir() and not data.is_symlink():
|
| 588 |
+
shutil.rmtree(data)
|
| 589 |
+
else:
|
| 590 |
+
data.unlink()
|
| 591 |
+
data.mkdir(mode=0o700)
|
| 592 |
+
for name in ("home", "tmp", "xdg-cache", "xdg-config", "xdg-data"):
|
| 593 |
+
(data / name).mkdir(mode=0o700)
|
| 594 |
+
compile_script = build / COMPILE_ENTRYPOINT
|
| 595 |
+
if not compile_script.is_file() or compile_script.is_symlink():
|
| 596 |
+
raise CompilerSandboxError("candidate root must contain regular compile.sh")
|
| 597 |
+
if compile_script.stat().st_nlink != 1 or not os.access(compile_script, os.X_OK):
|
| 598 |
+
raise CompilerSandboxError("compile.sh must be an independent executable file")
|
| 599 |
+
|
| 600 |
+
# A submitted executable is never trusted as compiler output.
|
| 601 |
+
preexisting = build / EXECUTABLE_ENTRYPOINT
|
| 602 |
+
if preexisting.exists():
|
| 603 |
+
if preexisting.is_dir():
|
| 604 |
+
shutil.rmtree(preexisting)
|
| 605 |
+
else:
|
| 606 |
+
preexisting.unlink()
|
| 607 |
+
|
| 608 |
+
environment = _compile_environment(build, data, seed, timezone)
|
| 609 |
+
with log.open("wb") as log_handle:
|
| 610 |
+
try:
|
| 611 |
+
process = subprocess.Popen(
|
| 612 |
+
[str(compile_script)],
|
| 613 |
+
cwd=build,
|
| 614 |
+
env=environment,
|
| 615 |
+
stdin=subprocess.DEVNULL,
|
| 616 |
+
stdout=log_handle,
|
| 617 |
+
stderr=subprocess.STDOUT,
|
| 618 |
+
start_new_session=True,
|
| 619 |
+
preexec_fn=lambda: _compiler_preexec(
|
| 620 |
+
build, build, memory_mb, max(1, int(timeout))
|
| 621 |
+
),
|
| 622 |
+
)
|
| 623 |
+
try:
|
| 624 |
+
return_code = process.wait(timeout=timeout)
|
| 625 |
+
except subprocess.TimeoutExpired as exc:
|
| 626 |
+
_terminate_group(process)
|
| 627 |
+
raise CompilerSandboxError(
|
| 628 |
+
f"compile.sh exceeded {timeout:g} seconds"
|
| 629 |
+
) from exc
|
| 630 |
+
if _process_group_alive(process.pid):
|
| 631 |
+
_terminate_group(process)
|
| 632 |
+
raise CompilerSandboxError(
|
| 633 |
+
"compile.sh left a child process or listener alive"
|
| 634 |
+
)
|
| 635 |
+
if return_code != 0:
|
| 636 |
+
raise CompilerSandboxError(f"compile.sh exited {return_code}")
|
| 637 |
+
finally:
|
| 638 |
+
log_handle.flush()
|
| 639 |
+
os.fsync(log_handle.fileno())
|
| 640 |
+
|
| 641 |
+
leaked = _processes_referencing(build, exclude=(os.getpid(),))
|
| 642 |
+
if leaked:
|
| 643 |
+
for pid in leaked:
|
| 644 |
+
try:
|
| 645 |
+
os.kill(pid, signal.SIGKILL)
|
| 646 |
+
except ProcessLookupError:
|
| 647 |
+
pass
|
| 648 |
+
raise CompilerSandboxError(f"compiler left detached processes: {leaked}")
|
| 649 |
+
if log.stat().st_size > MAX_LOG_BYTES:
|
| 650 |
+
raise CompilerSandboxError("compiler log exceeded 256 MiB")
|
| 651 |
+
|
| 652 |
+
shutil.rmtree(data)
|
| 653 |
+
validate_artifact_tree(build)
|
| 654 |
+
executable = build / EXECUTABLE_ENTRYPOINT
|
| 655 |
+
try:
|
| 656 |
+
metadata = executable.lstat()
|
| 657 |
+
except OSError as exc:
|
| 658 |
+
raise CompilerSandboxError(
|
| 659 |
+
"compile.sh did not produce root executable"
|
| 660 |
+
) from exc
|
| 661 |
+
if (
|
| 662 |
+
not stat.S_ISREG(metadata.st_mode)
|
| 663 |
+
or metadata.st_nlink != 1
|
| 664 |
+
or not stat.S_IMODE(metadata.st_mode) & 0o111
|
| 665 |
+
or executable.resolve() != executable
|
| 666 |
+
):
|
| 667 |
+
raise CompilerSandboxError(
|
| 668 |
+
"executable must be an independent regular executable at the build root"
|
| 669 |
+
)
|
| 670 |
+
digest = freeze_build_tree(build)
|
| 671 |
+
return CompiledArtifact(
|
| 672 |
+
source_root=source,
|
| 673 |
+
build_root=build,
|
| 674 |
+
executable=executable,
|
| 675 |
+
tree_sha256=digest,
|
| 676 |
+
build_log=log,
|
| 677 |
+
)
|
| 678 |
+
|
| 679 |
+
|
| 680 |
+
@dataclass
|
| 681 |
+
class ExecutableRuntime:
|
| 682 |
+
"""One foreground compiled candidate bound to one isolated DATA_DIR."""
|
| 683 |
+
|
| 684 |
+
build_root: Path
|
| 685 |
+
data_dir: Path
|
| 686 |
+
port: int
|
| 687 |
+
seed: int
|
| 688 |
+
timezone: str = "UTC"
|
| 689 |
+
log_path: Path | None = None
|
| 690 |
+
# RLIMIT_AS covers reserved virtual address space, not resident memory.
|
| 691 |
+
# Current Node/V8 runtimes reserve more than the 8192 MiB Harbor RSS
|
| 692 |
+
# budget before serving any request; keep the evaluator's cgroup budget
|
| 693 |
+
# authoritative while leaving enough address space for that reservation.
|
| 694 |
+
memory_mb: int = 16384
|
| 695 |
+
expected_tree_sha256: str | None = None
|
| 696 |
+
mailbox_environment: Mapping[str, str] | None = None
|
| 697 |
+
mailbox_connect_ports: frozenset[int] = frozenset()
|
| 698 |
+
evaluator_environment: Mapping[str, str] | None = None
|
| 699 |
+
worker_access_roots: tuple[Path, ...] = ()
|
| 700 |
+
process: subprocess.Popen[bytes] | None = None
|
| 701 |
+
_log_handle: Any | None = None
|
| 702 |
+
_cleanup_complete: bool = True
|
| 703 |
+
_control_write_fd: int | None = None
|
| 704 |
+
_broker_tid: int | None = None
|
| 705 |
+
_candidate_pid: int | None = None
|
| 706 |
+
|
| 707 |
+
def _environment(self) -> dict[str, str]:
|
| 708 |
+
data = self.data_dir.resolve()
|
| 709 |
+
environment = {
|
| 710 |
+
"PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
| 711 |
+
"LANG": "C.UTF-8",
|
| 712 |
+
"LC_ALL": "C.UTF-8",
|
| 713 |
+
"HOST": "127.0.0.1",
|
| 714 |
+
"PORT": str(self.port),
|
| 715 |
+
"DATA_DIR": str(data),
|
| 716 |
+
"SEED": str(self.seed),
|
| 717 |
+
"TZ": self.timezone,
|
| 718 |
+
"HOME": str(data / "home"),
|
| 719 |
+
"TMPDIR": str(data / "tmp"),
|
| 720 |
+
"XDG_CACHE_HOME": str(data / "xdg-cache"),
|
| 721 |
+
"XDG_CONFIG_HOME": str(data / "xdg-config"),
|
| 722 |
+
"XDG_DATA_HOME": str(data / "xdg-data"),
|
| 723 |
+
"WEBSITEBENCH_DEPLOYMENT_ABI": DEPLOYMENT_ABI,
|
| 724 |
+
}
|
| 725 |
+
if self.mailbox_environment is not None:
|
| 726 |
+
unknown = set(self.mailbox_environment) - CANDIDATE_MAIL_ENVIRONMENT
|
| 727 |
+
if unknown:
|
| 728 |
+
raise CompilerSandboxError(
|
| 729 |
+
f"candidate mailbox environment has unknown names: {sorted(unknown)}"
|
| 730 |
+
)
|
| 731 |
+
environment.update(
|
| 732 |
+
{name: str(value) for name, value in self.mailbox_environment.items()}
|
| 733 |
+
)
|
| 734 |
+
if self.evaluator_environment is not None:
|
| 735 |
+
unknown = set(self.evaluator_environment) - CANDIDATE_EVALUATOR_ENVIRONMENT
|
| 736 |
+
if unknown:
|
| 737 |
+
raise CompilerSandboxError(
|
| 738 |
+
"candidate evaluator environment has unknown names: "
|
| 739 |
+
f"{sorted(unknown)}"
|
| 740 |
+
)
|
| 741 |
+
if any(not str(value) for value in self.evaluator_environment.values()):
|
| 742 |
+
raise CompilerSandboxError(
|
| 743 |
+
"candidate evaluator environment values must be non-empty"
|
| 744 |
+
)
|
| 745 |
+
environment.update(
|
| 746 |
+
{name: str(value) for name, value in self.evaluator_environment.items()}
|
| 747 |
+
)
|
| 748 |
+
return environment
|
| 749 |
+
|
| 750 |
+
def _sandbox_command(
|
| 751 |
+
self,
|
| 752 |
+
*,
|
| 753 |
+
build: Path,
|
| 754 |
+
executable: Path,
|
| 755 |
+
control_read_fd: int,
|
| 756 |
+
broker_write_fd: int,
|
| 757 |
+
credentials: tuple[int, int] | None,
|
| 758 |
+
) -> list[str]:
|
| 759 |
+
sandbox_path = Path(sandbox.__file__).resolve(strict=True)
|
| 760 |
+
command = [
|
| 761 |
+
os.sys.executable,
|
| 762 |
+
str(sandbox_path),
|
| 763 |
+
"--root",
|
| 764 |
+
str(build),
|
| 765 |
+
"--data",
|
| 766 |
+
str(self.data_dir.resolve()),
|
| 767 |
+
"--bind-port",
|
| 768 |
+
str(self.port),
|
| 769 |
+
"--connect-port",
|
| 770 |
+
str(self.port),
|
| 771 |
+
]
|
| 772 |
+
for connect_port in sorted(self.mailbox_connect_ports):
|
| 773 |
+
command.extend(("--connect-port", str(connect_port)))
|
| 774 |
+
if credentials is not None:
|
| 775 |
+
uid, gid = credentials
|
| 776 |
+
command.extend(("--uid", str(uid), "--gid", str(gid)))
|
| 777 |
+
command.extend(
|
| 778 |
+
(
|
| 779 |
+
"--file-size-limit-bytes",
|
| 780 |
+
str(MAX_LOG_BYTES),
|
| 781 |
+
"--broker-tid-fd",
|
| 782 |
+
str(broker_write_fd),
|
| 783 |
+
"--control-fd",
|
| 784 |
+
str(control_read_fd),
|
| 785 |
+
"--",
|
| 786 |
+
str(executable),
|
| 787 |
+
)
|
| 788 |
+
)
|
| 789 |
+
return command
|
| 790 |
+
|
| 791 |
+
def _attest_worker_identity(
|
| 792 |
+
self,
|
| 793 |
+
*,
|
| 794 |
+
expected_uid: int,
|
| 795 |
+
expected_gid: int,
|
| 796 |
+
) -> None:
|
| 797 |
+
if self.process is None or self._broker_tid is None or self._candidate_pid is None:
|
| 798 |
+
raise OSError(errno.EIO, "sandbox identity proof is incomplete")
|
| 799 |
+
launcher_pid = self.process.pid
|
| 800 |
+
broker_status = Path(
|
| 801 |
+
f"/proc/{launcher_pid}/task/{self._broker_tid}/status"
|
| 802 |
+
)
|
| 803 |
+
candidate_status = Path(f"/proc/{self._candidate_pid}/status")
|
| 804 |
+
broker_uid, broker_gid, _broker_parent = _proc_status_identity(broker_status)
|
| 805 |
+
candidate_uid, candidate_gid, candidate_parent = _proc_status_identity(
|
| 806 |
+
candidate_status
|
| 807 |
+
)
|
| 808 |
+
expected_uids = (expected_uid,) * 4
|
| 809 |
+
expected_gids = (expected_gid,) * 4
|
| 810 |
+
if (
|
| 811 |
+
broker_uid != expected_uids
|
| 812 |
+
or broker_gid != expected_gids
|
| 813 |
+
or candidate_uid != expected_uids
|
| 814 |
+
or candidate_gid != expected_gids
|
| 815 |
+
or candidate_parent != launcher_pid
|
| 816 |
+
):
|
| 817 |
+
raise OSError(
|
| 818 |
+
errno.EPERM,
|
| 819 |
+
"sandbox broker or candidate retained an unexpected OS identity",
|
| 820 |
+
)
|
| 821 |
+
|
| 822 |
+
def _preexec(self) -> None:
|
| 823 |
+
os.umask(0o077)
|
| 824 |
+
if resource is not None:
|
| 825 |
+
memory = self.memory_mb * 1024 * 1024
|
| 826 |
+
resource.setrlimit(resource.RLIMIT_AS, (memory, memory))
|
| 827 |
+
resource.setrlimit(resource.RLIMIT_NOFILE, (1024, 1024))
|
| 828 |
+
resource.setrlimit(resource.RLIMIT_FSIZE, (MAX_LOG_BYTES, MAX_LOG_BYTES))
|
| 829 |
+
|
| 830 |
+
def start(self) -> None:
|
| 831 |
+
if not self._cleanup_complete:
|
| 832 |
+
raise CompilerSandboxError(
|
| 833 |
+
"runtime cleanup is incomplete; restart forbidden"
|
| 834 |
+
)
|
| 835 |
+
if self.process is not None and self.process.poll() is None:
|
| 836 |
+
raise CompilerSandboxError("compiled runtime is already running")
|
| 837 |
+
for connect_port in self.mailbox_connect_ports:
|
| 838 |
+
if not 1 <= connect_port <= 65535 or connect_port == self.port:
|
| 839 |
+
raise CompilerSandboxError("candidate mailbox connect port is invalid")
|
| 840 |
+
build = self.build_root.resolve(strict=True)
|
| 841 |
+
current_digest = tree_digest(build)
|
| 842 |
+
if current_digest == "": # pragma: no cover - digest is never empty
|
| 843 |
+
raise CompilerSandboxError("compiled build hash is unavailable")
|
| 844 |
+
if (
|
| 845 |
+
self.expected_tree_sha256 is not None
|
| 846 |
+
and current_digest != self.expected_tree_sha256
|
| 847 |
+
):
|
| 848 |
+
raise CompilerSandboxError("compiled build tree changed after freezing")
|
| 849 |
+
executable = build / EXECUTABLE_ENTRYPOINT
|
| 850 |
+
metadata = executable.lstat()
|
| 851 |
+
if not stat.S_ISREG(metadata.st_mode) or not metadata.st_mode & 0o111:
|
| 852 |
+
raise CompilerSandboxError("compiled executable contract changed")
|
| 853 |
+
credentials = _runtime_worker_credentials()
|
| 854 |
+
try:
|
| 855 |
+
_prepare_runtime_directories(
|
| 856 |
+
build,
|
| 857 |
+
self.data_dir.resolve(),
|
| 858 |
+
credentials,
|
| 859 |
+
worker_access_roots=self.worker_access_roots,
|
| 860 |
+
)
|
| 861 |
+
except OSError as exc:
|
| 862 |
+
raise RuntimeInfrastructureError(
|
| 863 |
+
"compiled runtime worker directories could not be prepared"
|
| 864 |
+
) from exc
|
| 865 |
+
if self.log_path is not None:
|
| 866 |
+
log = self.log_path.resolve()
|
| 867 |
+
data = self.data_dir.resolve()
|
| 868 |
+
if data not in log.parents:
|
| 869 |
+
raise CompilerSandboxError("runtime log must be inside DATA_DIR")
|
| 870 |
+
log.parent.mkdir(parents=True, exist_ok=True)
|
| 871 |
+
self._log_handle = log.open("ab")
|
| 872 |
+
control_read_fd, control_write_fd = os.pipe()
|
| 873 |
+
broker_read_fd, broker_write_fd = os.pipe()
|
| 874 |
+
os.set_blocking(broker_read_fd, False)
|
| 875 |
+
command = self._sandbox_command(
|
| 876 |
+
build=build,
|
| 877 |
+
executable=executable,
|
| 878 |
+
control_read_fd=control_read_fd,
|
| 879 |
+
broker_write_fd=broker_write_fd,
|
| 880 |
+
credentials=credentials,
|
| 881 |
+
)
|
| 882 |
+
try:
|
| 883 |
+
self.process = subprocess.Popen(
|
| 884 |
+
command,
|
| 885 |
+
cwd=build,
|
| 886 |
+
env=self._environment(),
|
| 887 |
+
stdin=subprocess.DEVNULL,
|
| 888 |
+
stdout=self._log_handle or subprocess.DEVNULL,
|
| 889 |
+
stderr=self._log_handle or subprocess.DEVNULL,
|
| 890 |
+
start_new_session=True,
|
| 891 |
+
preexec_fn=self._preexec,
|
| 892 |
+
pass_fds=(control_read_fd, broker_write_fd),
|
| 893 |
+
)
|
| 894 |
+
except BaseException:
|
| 895 |
+
os.close(control_read_fd)
|
| 896 |
+
os.close(control_write_fd)
|
| 897 |
+
os.close(broker_read_fd)
|
| 898 |
+
os.close(broker_write_fd)
|
| 899 |
+
self._close_log()
|
| 900 |
+
raise
|
| 901 |
+
os.close(control_read_fd)
|
| 902 |
+
os.close(broker_write_fd)
|
| 903 |
+
self._control_write_fd = control_write_fd
|
| 904 |
+
self._cleanup_complete = False
|
| 905 |
+
proof = b""
|
| 906 |
+
# Process creation can be delayed materially when several Harbor
|
| 907 |
+
# verifier shards contend for I/O. Identity proof is an
|
| 908 |
+
# infrastructure handshake, not candidate readiness, so give the
|
| 909 |
+
# trusted launcher enough time to report its already-created workers.
|
| 910 |
+
deadline = time.monotonic() + 15.0
|
| 911 |
+
try:
|
| 912 |
+
while b"\n" not in proof and time.monotonic() < deadline:
|
| 913 |
+
try:
|
| 914 |
+
proof += os.read(broker_read_fd, 128)
|
| 915 |
+
except BlockingIOError:
|
| 916 |
+
pass
|
| 917 |
+
if self.process.poll() is not None:
|
| 918 |
+
break
|
| 919 |
+
time.sleep(0.01)
|
| 920 |
+
except OSError as exc:
|
| 921 |
+
self.stop(timeout=1.0)
|
| 922 |
+
raise RuntimeInfrastructureError(
|
| 923 |
+
"compiled runtime sandbox identity proof could not be read"
|
| 924 |
+
) from exc
|
| 925 |
+
finally:
|
| 926 |
+
os.close(broker_read_fd)
|
| 927 |
+
try:
|
| 928 |
+
proof_fields = proof.splitlines()[0].split()
|
| 929 |
+
if len(proof_fields) != 2:
|
| 930 |
+
raise ValueError("sandbox proof must contain two process IDs")
|
| 931 |
+
self._broker_tid, self._candidate_pid = map(int, proof_fields)
|
| 932 |
+
except (ValueError, IndexError):
|
| 933 |
+
self._broker_tid = None
|
| 934 |
+
self._candidate_pid = None
|
| 935 |
+
if (
|
| 936 |
+
self._broker_tid is not None
|
| 937 |
+
and not Path(f"/proc/{self.process.pid}/task/{self._broker_tid}").is_dir()
|
| 938 |
+
):
|
| 939 |
+
self._broker_tid = None
|
| 940 |
+
if self._broker_tid is None or self._candidate_pid is None:
|
| 941 |
+
self.stop(timeout=1.0)
|
| 942 |
+
raise RuntimeInfrastructureError(
|
| 943 |
+
"compiled runtime sandbox did not attest its broker and candidate IDs"
|
| 944 |
+
)
|
| 945 |
+
expected_uid, expected_gid = credentials or (os.geteuid(), os.getegid())
|
| 946 |
+
try:
|
| 947 |
+
self._attest_worker_identity(
|
| 948 |
+
expected_uid=expected_uid,
|
| 949 |
+
expected_gid=expected_gid,
|
| 950 |
+
)
|
| 951 |
+
except OSError as exc:
|
| 952 |
+
self.stop(timeout=1.0)
|
| 953 |
+
raise RuntimeInfrastructureError(
|
| 954 |
+
"compiled runtime sandbox worker identity could not be verified"
|
| 955 |
+
) from exc
|
| 956 |
+
|
| 957 |
+
def ready(self, *, timeout: float = 30.0) -> bool:
|
| 958 |
+
deadline = time.monotonic() + timeout
|
| 959 |
+
urls = [f"http://127.0.0.1:{self.port}{path}" for path in HEALTH_PATHS]
|
| 960 |
+
while time.monotonic() < deadline:
|
| 961 |
+
if self.process is None or self.process.poll() is not None:
|
| 962 |
+
return False
|
| 963 |
+
for url in urls:
|
| 964 |
+
try:
|
| 965 |
+
request = urllib.request.Request(url, method="GET")
|
| 966 |
+
with urllib.request.urlopen(request, timeout=0.5) as response:
|
| 967 |
+
payload = response.read(4096)
|
| 968 |
+
if (
|
| 969 |
+
response.status == 200
|
| 970 |
+
and json.loads(payload) == HEALTH_BODY
|
| 971 |
+
):
|
| 972 |
+
return self.process.poll() is None
|
| 973 |
+
except (
|
| 974 |
+
OSError,
|
| 975 |
+
ValueError,
|
| 976 |
+
urllib.error.URLError,
|
| 977 |
+
json.JSONDecodeError,
|
| 978 |
+
):
|
| 979 |
+
pass
|
| 980 |
+
time.sleep(0.05)
|
| 981 |
+
return False
|
| 982 |
+
|
| 983 |
+
def stop(
|
| 984 |
+
self, *, timeout: float = 10.0, accept_forced: bool = False
|
| 985 |
+
) -> bool:
|
| 986 |
+
if self.process is None:
|
| 987 |
+
self._close_control()
|
| 988 |
+
self._close_log()
|
| 989 |
+
self._cleanup_complete = True
|
| 990 |
+
return True
|
| 991 |
+
if self._control_write_fd is None:
|
| 992 |
+
graceful = _terminate_group(
|
| 993 |
+
self.process, timeout, accept_forced=accept_forced
|
| 994 |
+
)
|
| 995 |
+
else:
|
| 996 |
+
graceful = _stop_controlled_group(
|
| 997 |
+
self.process,
|
| 998 |
+
self._control_write_fd,
|
| 999 |
+
timeout,
|
| 1000 |
+
accept_forced=accept_forced,
|
| 1001 |
+
)
|
| 1002 |
+
self._close_control()
|
| 1003 |
+
self._close_log()
|
| 1004 |
+
self._cleanup_complete = graceful
|
| 1005 |
+
self._broker_tid = None
|
| 1006 |
+
self._candidate_pid = None
|
| 1007 |
+
return graceful
|
| 1008 |
+
|
| 1009 |
+
def _close_control(self) -> None:
|
| 1010 |
+
if self._control_write_fd is not None:
|
| 1011 |
+
try:
|
| 1012 |
+
os.close(self._control_write_fd)
|
| 1013 |
+
except OSError:
|
| 1014 |
+
pass
|
| 1015 |
+
self._control_write_fd = None
|
| 1016 |
+
|
| 1017 |
+
def _close_log(self) -> None:
|
| 1018 |
+
if self._log_handle is not None:
|
| 1019 |
+
self._log_handle.flush()
|
| 1020 |
+
os.fsync(self._log_handle.fileno())
|
| 1021 |
+
self._log_handle.close()
|
| 1022 |
+
self._log_handle = None
|
| 1023 |
+
|
| 1024 |
+
|
| 1025 |
+
def validate_runtime_lifecycle(
|
| 1026 |
+
artifact: CompiledArtifact,
|
| 1027 |
+
*,
|
| 1028 |
+
port: int,
|
| 1029 |
+
seed: int,
|
| 1030 |
+
working_root: Path | str,
|
| 1031 |
+
worker_access_roots: Sequence[Path | str],
|
| 1032 |
+
timezone: str = "UTC",
|
| 1033 |
+
) -> dict[str, Any]:
|
| 1034 |
+
"""Probe health, foreground/SIGTERM, restart persistence and new-dir isolation."""
|
| 1035 |
+
|
| 1036 |
+
root = Path(working_root).resolve()
|
| 1037 |
+
root.mkdir(parents=True, exist_ok=True, mode=0o700)
|
| 1038 |
+
first_data = root / "data-first"
|
| 1039 |
+
second_data = root / "data-second"
|
| 1040 |
+
first_data.mkdir(mode=0o700)
|
| 1041 |
+
second_data.mkdir(mode=0o700)
|
| 1042 |
+
sentinel = first_data / ".websitebench-persistence"
|
| 1043 |
+
sentinel.write_text(f"{seed}\n", encoding="ascii")
|
| 1044 |
+
first = ExecutableRuntime(
|
| 1045 |
+
artifact.build_root,
|
| 1046 |
+
first_data,
|
| 1047 |
+
port,
|
| 1048 |
+
seed,
|
| 1049 |
+
timezone,
|
| 1050 |
+
first_data / "runtime.log",
|
| 1051 |
+
expected_tree_sha256=artifact.tree_sha256,
|
| 1052 |
+
worker_access_roots=tuple(Path(value) for value in worker_access_roots),
|
| 1053 |
+
)
|
| 1054 |
+
first.start()
|
| 1055 |
+
healthy = first.ready()
|
| 1056 |
+
graceful = first.stop(timeout=10.0)
|
| 1057 |
+
sentinel_persisted = sentinel.read_text(encoding="ascii") == f"{seed}\n"
|
| 1058 |
+
restarted = False
|
| 1059 |
+
if graceful:
|
| 1060 |
+
first.start()
|
| 1061 |
+
restarted = first.ready()
|
| 1062 |
+
graceful = first.stop(timeout=10.0) and graceful
|
| 1063 |
+
second = ExecutableRuntime(
|
| 1064 |
+
artifact.build_root,
|
| 1065 |
+
second_data,
|
| 1066 |
+
port,
|
| 1067 |
+
seed,
|
| 1068 |
+
timezone,
|
| 1069 |
+
second_data / "runtime.log",
|
| 1070 |
+
expected_tree_sha256=artifact.tree_sha256,
|
| 1071 |
+
worker_access_roots=tuple(Path(value) for value in worker_access_roots),
|
| 1072 |
+
)
|
| 1073 |
+
second.start()
|
| 1074 |
+
second_healthy = second.ready()
|
| 1075 |
+
second_graceful = second.stop(timeout=10.0)
|
| 1076 |
+
isolated = (
|
| 1077 |
+
second_healthy
|
| 1078 |
+
and second_graceful
|
| 1079 |
+
and not (second_data / sentinel.name).exists()
|
| 1080 |
+
)
|
| 1081 |
+
return {
|
| 1082 |
+
"deployment_abi": DEPLOYMENT_ABI,
|
| 1083 |
+
"health": healthy,
|
| 1084 |
+
"foreground": healthy,
|
| 1085 |
+
"sigterm": graceful,
|
| 1086 |
+
"restart": restarted,
|
| 1087 |
+
"persistence": sentinel_persisted,
|
| 1088 |
+
"new_data_dir_health": second_healthy,
|
| 1089 |
+
"new_data_dir_isolation": isolated,
|
| 1090 |
+
"tree_sha256": artifact.tree_sha256,
|
| 1091 |
+
"valid": all(
|
| 1092 |
+
(
|
| 1093 |
+
healthy,
|
| 1094 |
+
graceful,
|
| 1095 |
+
restarted,
|
| 1096 |
+
sentinel_persisted,
|
| 1097 |
+
second_healthy,
|
| 1098 |
+
second_graceful,
|
| 1099 |
+
isolated,
|
| 1100 |
+
)
|
| 1101 |
+
),
|
| 1102 |
+
}
|
| 1103 |
+
|
| 1104 |
+
|
| 1105 |
+
__all__ = [
|
| 1106 |
+
"COMPILE_ENTRYPOINT",
|
| 1107 |
+
"DEFAULT_COMPILE_TIMEOUT",
|
| 1108 |
+
"DEPLOYMENT_ABI",
|
| 1109 |
+
"EXECUTABLE_ENTRYPOINT",
|
| 1110 |
+
"HEALTH_BODY",
|
| 1111 |
+
"HEALTH_PATH",
|
| 1112 |
+
"HEALTH_PATHS",
|
| 1113 |
+
"LEGACY_HEALTH_PATHS",
|
| 1114 |
+
"MAX_LOG_BYTES",
|
| 1115 |
+
"RUNTIME_PROCESS_MODEL",
|
| 1116 |
+
"RuntimeInfrastructureError",
|
| 1117 |
+
"WORKER_OS_GID",
|
| 1118 |
+
"WORKER_OS_UID",
|
| 1119 |
+
"CompiledArtifact",
|
| 1120 |
+
"CompilerSandboxError",
|
| 1121 |
+
"ExecutableRuntime",
|
| 1122 |
+
"compile_candidate",
|
| 1123 |
+
"freeze_build_tree",
|
| 1124 |
+
"quarantine_artifact",
|
| 1125 |
+
"tree_digest",
|
| 1126 |
+
"validate_artifact_tree",
|
| 1127 |
+
"validate_runtime_lifecycle",
|
| 1128 |
+
]
|
tasks/backcountry/environment/candidate-abi/websitebench/harbor/sandbox.py
ADDED
|
@@ -0,0 +1,841 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Linux kernel sandbox launcher for untrusted Harbor candidates.
|
| 2 |
+
|
| 3 |
+
The launcher is executed by the privileged verifier, installs an irreversible
|
| 4 |
+
Landlock/seccomp policy, drops to the opaque worker UID, and only then execs the
|
| 5 |
+
candidate entrypoint. It deliberately has no dependency outside the standard
|
| 6 |
+
library so the formal verifier image has a small, inspectable trusted surface.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
from __future__ import annotations
|
| 10 |
+
|
| 11 |
+
import argparse
|
| 12 |
+
import array
|
| 13 |
+
import ctypes
|
| 14 |
+
import errno
|
| 15 |
+
import fcntl
|
| 16 |
+
import os
|
| 17 |
+
import platform
|
| 18 |
+
import resource
|
| 19 |
+
import signal
|
| 20 |
+
import socket
|
| 21 |
+
import stat
|
| 22 |
+
import struct
|
| 23 |
+
import threading
|
| 24 |
+
import time
|
| 25 |
+
from pathlib import Path
|
| 26 |
+
from typing import Sequence
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
PR_SET_NO_NEW_PRIVS = 38
|
| 30 |
+
PR_SET_DUMPABLE = 4
|
| 31 |
+
PR_SET_SECCOMP = 22
|
| 32 |
+
SECCOMP_MODE_FILTER = 2
|
| 33 |
+
SECCOMP_RET_KILL_PROCESS = 0x80000000
|
| 34 |
+
SECCOMP_RET_ERRNO = 0x00050000
|
| 35 |
+
SECCOMP_RET_USER_NOTIF = 0x7FC00000
|
| 36 |
+
SECCOMP_RET_ALLOW = 0x7FFF0000
|
| 37 |
+
SECCOMP_FILTER_FLAG_NEW_LISTENER = 1 << 3
|
| 38 |
+
SECCOMP_SET_MODE_FILTER = 1
|
| 39 |
+
SECCOMP_GET_ACTION_AVAIL = 2
|
| 40 |
+
|
| 41 |
+
BPF_LD_W_ABS = 0x20
|
| 42 |
+
BPF_JMP_JEQ_K = 0x15
|
| 43 |
+
BPF_JMP_JSET_K = 0x45
|
| 44 |
+
BPF_ALU_AND_K = 0x54
|
| 45 |
+
BPF_RET_K = 0x06
|
| 46 |
+
|
| 47 |
+
LANDLOCK_CREATE_RULESET_VERSION = 1
|
| 48 |
+
LANDLOCK_RULE_PATH_BENEATH = 1
|
| 49 |
+
LANDLOCK_RULE_NET_PORT = 2
|
| 50 |
+
LANDLOCK_ACCESS_FS_EXECUTE = 1 << 0
|
| 51 |
+
LANDLOCK_ACCESS_FS_WRITE_FILE = 1 << 1
|
| 52 |
+
LANDLOCK_ACCESS_FS_READ_FILE = 1 << 2
|
| 53 |
+
LANDLOCK_ACCESS_FS_READ_DIR = 1 << 3
|
| 54 |
+
LANDLOCK_ACCESS_FS_REMOVE_DIR = 1 << 4
|
| 55 |
+
LANDLOCK_ACCESS_FS_REMOVE_FILE = 1 << 5
|
| 56 |
+
LANDLOCK_ACCESS_FS_MAKE_CHAR = 1 << 6
|
| 57 |
+
LANDLOCK_ACCESS_FS_MAKE_DIR = 1 << 7
|
| 58 |
+
LANDLOCK_ACCESS_FS_MAKE_REG = 1 << 8
|
| 59 |
+
LANDLOCK_ACCESS_FS_MAKE_SOCK = 1 << 9
|
| 60 |
+
LANDLOCK_ACCESS_FS_MAKE_FIFO = 1 << 10
|
| 61 |
+
LANDLOCK_ACCESS_FS_MAKE_BLOCK = 1 << 11
|
| 62 |
+
LANDLOCK_ACCESS_FS_MAKE_SYM = 1 << 12
|
| 63 |
+
LANDLOCK_ACCESS_FS_REFER = 1 << 13
|
| 64 |
+
LANDLOCK_ACCESS_FS_TRUNCATE = 1 << 14
|
| 65 |
+
LANDLOCK_ACCESS_FS_IOCTL_DEV = 1 << 15
|
| 66 |
+
LANDLOCK_ACCESS_NET_BIND_TCP = 1 << 0
|
| 67 |
+
LANDLOCK_ACCESS_NET_CONNECT_TCP = 1 << 1
|
| 68 |
+
|
| 69 |
+
_FS_ABI_1 = (1 << 13) - 1
|
| 70 |
+
_FS_ABI_2 = _FS_ABI_1 | LANDLOCK_ACCESS_FS_REFER
|
| 71 |
+
_FS_ABI_3 = _FS_ABI_2 | LANDLOCK_ACCESS_FS_TRUNCATE
|
| 72 |
+
_FS_ABI_5 = _FS_ABI_3 | LANDLOCK_ACCESS_FS_IOCTL_DEV
|
| 73 |
+
_FS_READ_EXECUTE = (
|
| 74 |
+
LANDLOCK_ACCESS_FS_EXECUTE
|
| 75 |
+
| LANDLOCK_ACCESS_FS_READ_FILE
|
| 76 |
+
| LANDLOCK_ACCESS_FS_READ_DIR
|
| 77 |
+
)
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
class _RulesetAttr(ctypes.Structure):
|
| 81 |
+
_fields_ = [
|
| 82 |
+
("handled_access_fs", ctypes.c_uint64),
|
| 83 |
+
("handled_access_net", ctypes.c_uint64),
|
| 84 |
+
]
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
class _PathBeneathAttr(ctypes.Structure):
|
| 88 |
+
_fields_ = [
|
| 89 |
+
("allowed_access", ctypes.c_uint64),
|
| 90 |
+
("parent_fd", ctypes.c_int32),
|
| 91 |
+
("reserved", ctypes.c_uint32),
|
| 92 |
+
]
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
class _NetPortAttr(ctypes.Structure):
|
| 96 |
+
_fields_ = [("allowed_access", ctypes.c_uint64), ("port", ctypes.c_uint64)]
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
class _SockFilter(ctypes.Structure):
|
| 100 |
+
_fields_ = [
|
| 101 |
+
("code", ctypes.c_ushort),
|
| 102 |
+
("jt", ctypes.c_ubyte),
|
| 103 |
+
("jf", ctypes.c_ubyte),
|
| 104 |
+
("k", ctypes.c_uint32),
|
| 105 |
+
]
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
class _SockFprog(ctypes.Structure):
|
| 109 |
+
_fields_ = [("len", ctypes.c_ushort), ("filter", ctypes.POINTER(_SockFilter))]
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
_SECCOMP_NOTIF_FORMAT = "=QIIiIQQQQQQQ"
|
| 113 |
+
_SECCOMP_RESP_FORMAT = "=QqiI"
|
| 114 |
+
_SECCOMP_NOTIF_SIZE = struct.calcsize(_SECCOMP_NOTIF_FORMAT)
|
| 115 |
+
_SECCOMP_RESP_SIZE = struct.calcsize(_SECCOMP_RESP_FORMAT)
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
def _iowr(kind: int, number: int, size: int) -> int:
|
| 119 |
+
return (3 << 30) | (size << 16) | (kind << 8) | number
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
_SECCOMP_IOCTL_NOTIF_RECV = _iowr(ord("!"), 0, _SECCOMP_NOTIF_SIZE)
|
| 123 |
+
_SECCOMP_IOCTL_NOTIF_SEND = _iowr(ord("!"), 1, _SECCOMP_RESP_SIZE)
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
def _architecture() -> tuple[int, int, int, int, tuple[int, ...]]:
|
| 127 |
+
machine = platform.machine().lower()
|
| 128 |
+
if machine in {"x86_64", "amd64"}:
|
| 129 |
+
# AUDIT_ARCH_X86_64, socket(2), and shared cross-process facilities.
|
| 130 |
+
return (
|
| 131 |
+
0xC000003E,
|
| 132 |
+
41,
|
| 133 |
+
72,
|
| 134 |
+
317,
|
| 135 |
+
(
|
| 136 |
+
29,
|
| 137 |
+
30,
|
| 138 |
+
31,
|
| 139 |
+
57,
|
| 140 |
+
58,
|
| 141 |
+
64,
|
| 142 |
+
65,
|
| 143 |
+
66,
|
| 144 |
+
67,
|
| 145 |
+
68,
|
| 146 |
+
69,
|
| 147 |
+
70,
|
| 148 |
+
71,
|
| 149 |
+
109,
|
| 150 |
+
112,
|
| 151 |
+
240,
|
| 152 |
+
241,
|
| 153 |
+
242,
|
| 154 |
+
243,
|
| 155 |
+
244,
|
| 156 |
+
245,
|
| 157 |
+
248,
|
| 158 |
+
249,
|
| 159 |
+
250,
|
| 160 |
+
253,
|
| 161 |
+
254,
|
| 162 |
+
255,
|
| 163 |
+
294,
|
| 164 |
+
298,
|
| 165 |
+
300,
|
| 166 |
+
301,
|
| 167 |
+
425,
|
| 168 |
+
73,
|
| 169 |
+
),
|
| 170 |
+
)
|
| 171 |
+
if machine in {"aarch64", "arm64"}:
|
| 172 |
+
return (
|
| 173 |
+
0xC00000B7,
|
| 174 |
+
198,
|
| 175 |
+
25,
|
| 176 |
+
277,
|
| 177 |
+
tuple(range(180, 198))
|
| 178 |
+
+ (26, 27, 28, 32, 154, 157, 217, 218, 219, 241, 262, 263, 425),
|
| 179 |
+
)
|
| 180 |
+
raise OSError(errno.ENOTSUP, f"unsupported verifier architecture: {machine}")
|
| 181 |
+
|
| 182 |
+
|
| 183 |
+
def _syscalls() -> tuple[int, int, int]:
|
| 184 |
+
machine = platform.machine().lower()
|
| 185 |
+
if machine in {"x86_64", "amd64", "aarch64", "arm64"}:
|
| 186 |
+
return 444, 445, 446
|
| 187 |
+
raise OSError(errno.ENOTSUP, f"unsupported verifier architecture: {machine}")
|
| 188 |
+
|
| 189 |
+
|
| 190 |
+
def sandbox_runtime_fingerprint() -> dict[str, object]:
|
| 191 |
+
"""Return trusted kernel capabilities required by the candidate sandbox."""
|
| 192 |
+
|
| 193 |
+
audit_arch, socket_syscall, _fcntl_syscall, seccomp_syscall, _denied = (
|
| 194 |
+
_architecture()
|
| 195 |
+
)
|
| 196 |
+
create_ruleset, _add_rule, _restrict_self = _syscalls()
|
| 197 |
+
libc = ctypes.CDLL(None, use_errno=True)
|
| 198 |
+
abi = int(libc.syscall(create_ruleset, 0, 0, LANDLOCK_CREATE_RULESET_VERSION))
|
| 199 |
+
action = ctypes.c_uint32(SECCOMP_RET_USER_NOTIF)
|
| 200 |
+
user_notification = (
|
| 201 |
+
libc.syscall(
|
| 202 |
+
seccomp_syscall,
|
| 203 |
+
SECCOMP_GET_ACTION_AVAIL,
|
| 204 |
+
0,
|
| 205 |
+
ctypes.byref(action),
|
| 206 |
+
)
|
| 207 |
+
== 0
|
| 208 |
+
)
|
| 209 |
+
x32_unavailable = True
|
| 210 |
+
if audit_arch == 0xC000003E:
|
| 211 |
+
ctypes.set_errno(0)
|
| 212 |
+
result = libc.syscall(0x40000000 | socket_syscall, -1, -1, -1)
|
| 213 |
+
x32_unavailable = result == -1 and ctypes.get_errno() == errno.ENOSYS
|
| 214 |
+
return {
|
| 215 |
+
"schema": "websitebench.harbor.sandbox-runtime",
|
| 216 |
+
"architecture": platform.machine().lower(),
|
| 217 |
+
"landlock_abi": abi,
|
| 218 |
+
"seccomp_user_notification": user_notification,
|
| 219 |
+
"x32_unavailable": x32_unavailable,
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
|
| 223 |
+
def sandbox_preflight() -> dict[str, object]:
|
| 224 |
+
"""Fail closed before scoring when the verifier kernel cannot sandbox."""
|
| 225 |
+
|
| 226 |
+
fingerprint = sandbox_runtime_fingerprint()
|
| 227 |
+
if (
|
| 228 |
+
int(fingerprint["landlock_abi"]) < 4
|
| 229 |
+
or fingerprint["seccomp_user_notification"] is not True
|
| 230 |
+
or fingerprint["x32_unavailable"] is not True
|
| 231 |
+
):
|
| 232 |
+
raise OSError(errno.ENOTSUP, f"candidate sandbox unavailable: {fingerprint}")
|
| 233 |
+
child = os.fork()
|
| 234 |
+
if child == 0:
|
| 235 |
+
try:
|
| 236 |
+
_landlock(Path("/"), Path("/tmp"), 65534, {65534})
|
| 237 |
+
listener = _seccomp()
|
| 238 |
+
os.close(listener)
|
| 239 |
+
os._exit(0)
|
| 240 |
+
except BaseException:
|
| 241 |
+
os._exit(1)
|
| 242 |
+
_waited, status = os.waitpid(child, 0)
|
| 243 |
+
if not os.WIFEXITED(status) or os.WEXITSTATUS(status) != 0:
|
| 244 |
+
raise OSError(errno.ENOTSUP, "candidate sandbox enforcement probe failed")
|
| 245 |
+
fingerprint["enforcement_probe_passed"] = True
|
| 246 |
+
return fingerprint
|
| 247 |
+
|
| 248 |
+
|
| 249 |
+
def _landlock(
|
| 250 |
+
root: Path,
|
| 251 |
+
data: Path,
|
| 252 |
+
bind_port: int,
|
| 253 |
+
connect_ports: set[int],
|
| 254 |
+
read_paths: Sequence[Path] = (),
|
| 255 |
+
) -> None:
|
| 256 |
+
libc = ctypes.CDLL(None, use_errno=True)
|
| 257 |
+
create_ruleset, add_rule, restrict_self = _syscalls()
|
| 258 |
+
abi = int(libc.syscall(create_ruleset, 0, 0, LANDLOCK_CREATE_RULESET_VERSION))
|
| 259 |
+
if abi < 4:
|
| 260 |
+
code = ctypes.get_errno() if abi < 0 else errno.ENOTSUP
|
| 261 |
+
raise OSError(code, "Landlock ABI 4 or newer is required")
|
| 262 |
+
|
| 263 |
+
handled_fs = _FS_ABI_1
|
| 264 |
+
if abi >= 2:
|
| 265 |
+
handled_fs = _FS_ABI_2
|
| 266 |
+
if abi >= 3:
|
| 267 |
+
handled_fs = _FS_ABI_3
|
| 268 |
+
if abi >= 5:
|
| 269 |
+
handled_fs = _FS_ABI_5
|
| 270 |
+
handled_net = LANDLOCK_ACCESS_NET_BIND_TCP | LANDLOCK_ACCESS_NET_CONNECT_TCP
|
| 271 |
+
attributes = _RulesetAttr(handled_fs, handled_net)
|
| 272 |
+
ruleset_fd = int(
|
| 273 |
+
libc.syscall(
|
| 274 |
+
create_ruleset,
|
| 275 |
+
ctypes.byref(attributes),
|
| 276 |
+
ctypes.sizeof(attributes),
|
| 277 |
+
0,
|
| 278 |
+
)
|
| 279 |
+
)
|
| 280 |
+
if ruleset_fd < 0:
|
| 281 |
+
raise OSError(ctypes.get_errno(), "cannot create Landlock ruleset")
|
| 282 |
+
|
| 283 |
+
def add_path(path: Path, access: int) -> None:
|
| 284 |
+
if not path.exists():
|
| 285 |
+
return
|
| 286 |
+
descriptor = os.open(path, os.O_PATH | os.O_CLOEXEC)
|
| 287 |
+
try:
|
| 288 |
+
rule = _PathBeneathAttr(access & handled_fs, descriptor, 0)
|
| 289 |
+
if (
|
| 290 |
+
libc.syscall(
|
| 291 |
+
add_rule,
|
| 292 |
+
ruleset_fd,
|
| 293 |
+
LANDLOCK_RULE_PATH_BENEATH,
|
| 294 |
+
ctypes.byref(rule),
|
| 295 |
+
0,
|
| 296 |
+
)
|
| 297 |
+
!= 0
|
| 298 |
+
):
|
| 299 |
+
raise OSError(ctypes.get_errno(), f"cannot allow sandbox path: {path}")
|
| 300 |
+
finally:
|
| 301 |
+
os.close(descriptor)
|
| 302 |
+
|
| 303 |
+
try:
|
| 304 |
+
for path in (
|
| 305 |
+
root,
|
| 306 |
+
Path("/usr"),
|
| 307 |
+
Path("/bin"),
|
| 308 |
+
Path("/lib"),
|
| 309 |
+
Path("/lib64"),
|
| 310 |
+
Path("/etc"),
|
| 311 |
+
*read_paths,
|
| 312 |
+
):
|
| 313 |
+
add_path(path, _FS_READ_EXECUTE)
|
| 314 |
+
for path in (
|
| 315 |
+
Path("/dev/null"),
|
| 316 |
+
Path("/dev/zero"),
|
| 317 |
+
Path("/dev/random"),
|
| 318 |
+
Path("/dev/urandom"),
|
| 319 |
+
Path("/dev/full"),
|
| 320 |
+
Path("/dev/tty"),
|
| 321 |
+
):
|
| 322 |
+
add_path(path, LANDLOCK_ACCESS_FS_READ_FILE | LANDLOCK_ACCESS_FS_WRITE_FILE)
|
| 323 |
+
add_path(data, handled_fs)
|
| 324 |
+
|
| 325 |
+
for access, port in (
|
| 326 |
+
(LANDLOCK_ACCESS_NET_BIND_TCP, bind_port),
|
| 327 |
+
*(
|
| 328 |
+
(LANDLOCK_ACCESS_NET_CONNECT_TCP, port)
|
| 329 |
+
for port in sorted(connect_ports)
|
| 330 |
+
),
|
| 331 |
+
):
|
| 332 |
+
rule = _NetPortAttr(access, port)
|
| 333 |
+
if (
|
| 334 |
+
libc.syscall(
|
| 335 |
+
add_rule,
|
| 336 |
+
ruleset_fd,
|
| 337 |
+
LANDLOCK_RULE_NET_PORT,
|
| 338 |
+
ctypes.byref(rule),
|
| 339 |
+
0,
|
| 340 |
+
)
|
| 341 |
+
!= 0
|
| 342 |
+
):
|
| 343 |
+
raise OSError(ctypes.get_errno(), "cannot add Landlock TCP rule")
|
| 344 |
+
|
| 345 |
+
if libc.prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) != 0:
|
| 346 |
+
raise OSError(ctypes.get_errno(), "cannot set no_new_privs")
|
| 347 |
+
if libc.syscall(restrict_self, ruleset_fd, 0) != 0:
|
| 348 |
+
raise OSError(ctypes.get_errno(), "cannot enforce Landlock ruleset")
|
| 349 |
+
finally:
|
| 350 |
+
os.close(ruleset_fd)
|
| 351 |
+
|
| 352 |
+
|
| 353 |
+
def _seccomp() -> int:
|
| 354 |
+
"""Install the filter and return its user-notification listener."""
|
| 355 |
+
|
| 356 |
+
audit_arch, socket_syscall, fcntl_syscall, seccomp_syscall, denied = _architecture()
|
| 357 |
+
instructions: list[tuple[int, int, int, int]] = [
|
| 358 |
+
(BPF_LD_W_ABS, 0, 0, 4),
|
| 359 |
+
(BPF_JMP_JEQ_K, 1, 0, audit_arch),
|
| 360 |
+
(BPF_RET_K, 0, 0, SECCOMP_RET_KILL_PROCESS),
|
| 361 |
+
(BPF_LD_W_ABS, 0, 0, 0),
|
| 362 |
+
]
|
| 363 |
+
if audit_arch == 0xC000003E:
|
| 364 |
+
instructions.extend(
|
| 365 |
+
[
|
| 366 |
+
(BPF_JMP_JSET_K, 0, 1, 0x40000000),
|
| 367 |
+
(BPF_RET_K, 0, 0, SECCOMP_RET_ERRNO | errno.EPERM),
|
| 368 |
+
]
|
| 369 |
+
)
|
| 370 |
+
# Force clone3 callers onto the inspectable clone/fork fallback, then deny
|
| 371 |
+
# only process-style clone(SIGCHLD). Thread creation has a zero exit-signal
|
| 372 |
+
# byte and remains available to ASGI runtimes.
|
| 373 |
+
clone_syscall = 56 if audit_arch == 0xC000003E else 220
|
| 374 |
+
instructions.extend(
|
| 375 |
+
[
|
| 376 |
+
(BPF_JMP_JEQ_K, 0, 1, 435),
|
| 377 |
+
(BPF_RET_K, 0, 0, SECCOMP_RET_ERRNO | errno.ENOSYS),
|
| 378 |
+
(BPF_LD_W_ABS, 0, 0, 0),
|
| 379 |
+
(BPF_JMP_JEQ_K, 0, 4, clone_syscall),
|
| 380 |
+
(BPF_LD_W_ABS, 0, 0, 16),
|
| 381 |
+
(BPF_ALU_AND_K, 0, 0, 0xFF),
|
| 382 |
+
(BPF_JMP_JEQ_K, 0, 1, signal.SIGCHLD),
|
| 383 |
+
(BPF_RET_K, 0, 0, SECCOMP_RET_ERRNO | errno.EPERM),
|
| 384 |
+
(BPF_LD_W_ABS, 0, 0, 0),
|
| 385 |
+
]
|
| 386 |
+
)
|
| 387 |
+
for number in denied:
|
| 388 |
+
instructions.extend(
|
| 389 |
+
[
|
| 390 |
+
(BPF_JMP_JEQ_K, 0, 1, number),
|
| 391 |
+
(BPF_RET_K, 0, 0, SECCOMP_RET_ERRNO | errno.EPERM),
|
| 392 |
+
]
|
| 393 |
+
)
|
| 394 |
+
# Classic and OFD byte-range locks are executed by the trusted broker.
|
| 395 |
+
# The tracee is never continued after a pathname/fd check: another tracee
|
| 396 |
+
# thread could otherwise replace the descriptor between check and use.
|
| 397 |
+
brokered_fcntl_commands = (5, 6, 7, 36, 37, 38)
|
| 398 |
+
instructions.extend(
|
| 399 |
+
[
|
| 400 |
+
(
|
| 401 |
+
BPF_JMP_JEQ_K,
|
| 402 |
+
0,
|
| 403 |
+
2 * len(brokered_fcntl_commands) + 2,
|
| 404 |
+
fcntl_syscall,
|
| 405 |
+
),
|
| 406 |
+
(BPF_LD_W_ABS, 0, 0, 24),
|
| 407 |
+
]
|
| 408 |
+
)
|
| 409 |
+
for command in brokered_fcntl_commands:
|
| 410 |
+
instructions.extend(
|
| 411 |
+
[
|
| 412 |
+
(BPF_JMP_JEQ_K, 0, 1, command),
|
| 413 |
+
(BPF_RET_K, 0, 0, SECCOMP_RET_USER_NOTIF),
|
| 414 |
+
]
|
| 415 |
+
)
|
| 416 |
+
instructions.append((BPF_LD_W_ABS, 0, 0, 0))
|
| 417 |
+
# socket(domain, type, protocol): permit only IPv4/IPv6 SOCK_STREAM.
|
| 418 |
+
instructions.extend(
|
| 419 |
+
[
|
| 420 |
+
(BPF_JMP_JEQ_K, 0, 8, socket_syscall),
|
| 421 |
+
(BPF_LD_W_ABS, 0, 0, 16),
|
| 422 |
+
(BPF_JMP_JEQ_K, 2, 0, 2),
|
| 423 |
+
(BPF_JMP_JEQ_K, 1, 0, 10),
|
| 424 |
+
(BPF_RET_K, 0, 0, SECCOMP_RET_ERRNO | errno.EPERM),
|
| 425 |
+
(BPF_LD_W_ABS, 0, 0, 24),
|
| 426 |
+
(BPF_ALU_AND_K, 0, 0, 0xF),
|
| 427 |
+
(BPF_JMP_JEQ_K, 1, 0, 1),
|
| 428 |
+
(BPF_RET_K, 0, 0, SECCOMP_RET_ERRNO | errno.EPERM),
|
| 429 |
+
(BPF_RET_K, 0, 0, SECCOMP_RET_ALLOW),
|
| 430 |
+
]
|
| 431 |
+
)
|
| 432 |
+
filters = (_SockFilter * len(instructions))(
|
| 433 |
+
*(_SockFilter(*instruction) for instruction in instructions)
|
| 434 |
+
)
|
| 435 |
+
program = _SockFprog(len(instructions), filters)
|
| 436 |
+
libc = ctypes.CDLL(None, use_errno=True)
|
| 437 |
+
listener = int(
|
| 438 |
+
libc.syscall(
|
| 439 |
+
seccomp_syscall,
|
| 440 |
+
SECCOMP_SET_MODE_FILTER,
|
| 441 |
+
SECCOMP_FILTER_FLAG_NEW_LISTENER,
|
| 442 |
+
ctypes.byref(program),
|
| 443 |
+
)
|
| 444 |
+
)
|
| 445 |
+
if listener < 0:
|
| 446 |
+
raise OSError(ctypes.get_errno(), "cannot install candidate seccomp filter")
|
| 447 |
+
return listener
|
| 448 |
+
|
| 449 |
+
|
| 450 |
+
def _send_fd(channel: socket.socket, descriptor: int) -> None:
|
| 451 |
+
descriptors = array.array("i", [descriptor])
|
| 452 |
+
channel.sendmsg(
|
| 453 |
+
[b"L"],
|
| 454 |
+
[(socket.SOL_SOCKET, socket.SCM_RIGHTS, descriptors.tobytes())],
|
| 455 |
+
)
|
| 456 |
+
|
| 457 |
+
|
| 458 |
+
def _receive_fd(channel: socket.socket) -> int:
|
| 459 |
+
descriptors = array.array("i")
|
| 460 |
+
message, ancillary, _flags, _address = channel.recvmsg(
|
| 461 |
+
1, socket.CMSG_SPACE(descriptors.itemsize)
|
| 462 |
+
)
|
| 463 |
+
if message != b"L":
|
| 464 |
+
raise OSError(errno.EIO, "candidate sandbox listener was not delivered")
|
| 465 |
+
for level, kind, payload in ancillary:
|
| 466 |
+
if level == socket.SOL_SOCKET and kind == socket.SCM_RIGHTS:
|
| 467 |
+
descriptors.frombytes(payload[: descriptors.itemsize])
|
| 468 |
+
return int(descriptors[0])
|
| 469 |
+
raise OSError(errno.EIO, "candidate sandbox listener fd is missing")
|
| 470 |
+
|
| 471 |
+
|
| 472 |
+
def _tracee_process_id(thread_id: int) -> int:
|
| 473 |
+
try:
|
| 474 |
+
for line in Path(f"/proc/{thread_id}/status").read_text().splitlines():
|
| 475 |
+
if line.startswith("Tgid:"):
|
| 476 |
+
return int(line.partition(":")[2].strip())
|
| 477 |
+
except (OSError, ValueError):
|
| 478 |
+
pass
|
| 479 |
+
raise OSError(errno.ESRCH, "cannot identify candidate process")
|
| 480 |
+
|
| 481 |
+
|
| 482 |
+
def _capture_worker_file(pid: int, descriptor: int, data: Path) -> int:
|
| 483 |
+
"""Atomically capture a regular data-dir inode from a tracee descriptor."""
|
| 484 |
+
|
| 485 |
+
captured = os.open(f"/proc/{pid}/fd/{descriptor}", os.O_RDWR | os.O_CLOEXEC)
|
| 486 |
+
try:
|
| 487 |
+
metadata = os.fstat(captured)
|
| 488 |
+
if not stat.S_ISREG(metadata.st_mode):
|
| 489 |
+
raise OSError(errno.EPERM, "candidate locks require a regular file")
|
| 490 |
+
target_text = os.readlink(f"/proc/self/fd/{captured}")
|
| 491 |
+
if target_text.endswith(" (deleted)"):
|
| 492 |
+
target_text = target_text[: -len(" (deleted)")]
|
| 493 |
+
target = Path(target_text).resolve()
|
| 494 |
+
if target != data and data not in target.parents:
|
| 495 |
+
raise OSError(errno.EPERM, "candidate lock target is outside data dir")
|
| 496 |
+
return captured
|
| 497 |
+
except BaseException:
|
| 498 |
+
os.close(captured)
|
| 499 |
+
raise
|
| 500 |
+
|
| 501 |
+
|
| 502 |
+
def _read_tracee(pid: int, address: int, size: int) -> bytes:
|
| 503 |
+
descriptor = os.open(f"/proc/{pid}/mem", os.O_RDONLY | os.O_CLOEXEC)
|
| 504 |
+
try:
|
| 505 |
+
value = os.pread(descriptor, size, address)
|
| 506 |
+
finally:
|
| 507 |
+
os.close(descriptor)
|
| 508 |
+
if len(value) != size:
|
| 509 |
+
raise OSError(errno.EFAULT, "candidate fcntl argument is unreadable")
|
| 510 |
+
return value
|
| 511 |
+
|
| 512 |
+
|
| 513 |
+
def _write_tracee(pid: int, address: int, value: bytes) -> None:
|
| 514 |
+
descriptor = os.open(f"/proc/{pid}/mem", os.O_WRONLY | os.O_CLOEXEC)
|
| 515 |
+
try:
|
| 516 |
+
written = os.pwrite(descriptor, value, address)
|
| 517 |
+
finally:
|
| 518 |
+
os.close(descriptor)
|
| 519 |
+
if written != len(value):
|
| 520 |
+
raise OSError(errno.EFAULT, "candidate fcntl result is unwritable")
|
| 521 |
+
|
| 522 |
+
|
| 523 |
+
def _prune_closed_lock_files(
|
| 524 |
+
process_id: int,
|
| 525 |
+
locked_files: dict[tuple[int, int, int], int],
|
| 526 |
+
) -> None:
|
| 527 |
+
"""Release broker descriptors once the tracee has closed their inode.
|
| 528 |
+
|
| 529 |
+
SQLite creates and removes WAL/SHM files as short-lived connections come
|
| 530 |
+
and go. Keeping one broker descriptor for every historical inode pins both
|
| 531 |
+
deleted files and file descriptors until process exit, eventually turning
|
| 532 |
+
ordinary repeated requests into ``SQLITE_IOERR`` under ``RLIMIT_NOFILE``.
|
| 533 |
+
An OFD lock is no longer useful after the tracee has closed every descriptor
|
| 534 |
+
for that inode, so prune it before brokering the next lock operation.
|
| 535 |
+
"""
|
| 536 |
+
|
| 537 |
+
open_inodes: set[tuple[int, int]] = set()
|
| 538 |
+
try:
|
| 539 |
+
entries = list(Path(f"/proc/{process_id}/fd").iterdir())
|
| 540 |
+
except OSError:
|
| 541 |
+
return
|
| 542 |
+
for entry in entries:
|
| 543 |
+
try:
|
| 544 |
+
metadata = entry.stat()
|
| 545 |
+
except OSError:
|
| 546 |
+
continue
|
| 547 |
+
open_inodes.add((metadata.st_dev, metadata.st_ino))
|
| 548 |
+
for key, descriptor in list(locked_files.items()):
|
| 549 |
+
owner, device, inode = key
|
| 550 |
+
if owner == process_id and (device, inode) not in open_inodes:
|
| 551 |
+
os.close(descriptor)
|
| 552 |
+
del locked_files[key]
|
| 553 |
+
|
| 554 |
+
|
| 555 |
+
def _broker_fcntl(
|
| 556 |
+
pid: int,
|
| 557 |
+
descriptor: int,
|
| 558 |
+
command: int,
|
| 559 |
+
argument: int,
|
| 560 |
+
data: Path,
|
| 561 |
+
locked_files: dict[tuple[int, int, int], int],
|
| 562 |
+
) -> int:
|
| 563 |
+
"""Execute a byte-range lock without continuing the untrusted syscall."""
|
| 564 |
+
|
| 565 |
+
process_id = _tracee_process_id(pid)
|
| 566 |
+
_prune_closed_lock_files(process_id, locked_files)
|
| 567 |
+
captured = _capture_worker_file(pid, descriptor, data)
|
| 568 |
+
metadata = os.fstat(captured)
|
| 569 |
+
key = (process_id, metadata.st_dev, metadata.st_ino)
|
| 570 |
+
broker_descriptor = locked_files.get(key)
|
| 571 |
+
if broker_descriptor is None:
|
| 572 |
+
locked_files[key] = captured
|
| 573 |
+
broker_descriptor = captured
|
| 574 |
+
else:
|
| 575 |
+
os.close(captured)
|
| 576 |
+
|
| 577 |
+
flock_value = bytearray(_read_tracee(pid, argument, 32))
|
| 578 |
+
# Linux requires l_pid to be zero for OFD lock operations. Classic
|
| 579 |
+
# F_SETLK callers do not own that output-only field, so normalize it when
|
| 580 |
+
# translating the request.
|
| 581 |
+
flock_value[24:28] = b"\0\0\0\0"
|
| 582 |
+
translations = {
|
| 583 |
+
5: 36, # F_GETLK -> F_OFD_GETLK
|
| 584 |
+
6: 37, # F_SETLK -> F_OFD_SETLK
|
| 585 |
+
7: 37, # F_SETLKW stays fail-fast so the broker cannot deadlock.
|
| 586 |
+
36: 36,
|
| 587 |
+
37: 37,
|
| 588 |
+
38: 37,
|
| 589 |
+
}
|
| 590 |
+
result = fcntl.fcntl(broker_descriptor, translations[command], bytes(flock_value))
|
| 591 |
+
if command in {5, 36}:
|
| 592 |
+
if not isinstance(result, bytes):
|
| 593 |
+
raise OSError(errno.EIO, "candidate lock query returned no structure")
|
| 594 |
+
_write_tracee(pid, argument, result.ljust(32, b"\0")[:32])
|
| 595 |
+
return 0
|
| 596 |
+
|
| 597 |
+
|
| 598 |
+
def _lock_broker(listener: int, data: Path) -> None:
|
| 599 |
+
locked_files: dict[tuple[int, int, int], int] = {}
|
| 600 |
+
try:
|
| 601 |
+
while True:
|
| 602 |
+
request = bytearray(_SECCOMP_NOTIF_SIZE)
|
| 603 |
+
try:
|
| 604 |
+
fcntl.ioctl(listener, _SECCOMP_IOCTL_NOTIF_RECV, request, True)
|
| 605 |
+
except OSError as exc:
|
| 606 |
+
if exc.errno in {errno.EINTR, errno.ENOENT, errno.EBADF}:
|
| 607 |
+
if exc.errno == errno.EINTR:
|
| 608 |
+
continue
|
| 609 |
+
return
|
| 610 |
+
raise
|
| 611 |
+
unpacked = struct.unpack(_SECCOMP_NOTIF_FORMAT, request)
|
| 612 |
+
identifier, pid = int(unpacked[0]), int(unpacked[1])
|
| 613 |
+
try:
|
| 614 |
+
value = _broker_fcntl(
|
| 615 |
+
pid,
|
| 616 |
+
int(unpacked[6]),
|
| 617 |
+
int(unpacked[7]),
|
| 618 |
+
int(unpacked[8]),
|
| 619 |
+
data,
|
| 620 |
+
locked_files,
|
| 621 |
+
)
|
| 622 |
+
error = 0
|
| 623 |
+
except OSError as exc:
|
| 624 |
+
value = 0
|
| 625 |
+
error = -(exc.errno or errno.EPERM)
|
| 626 |
+
response = bytearray(
|
| 627 |
+
struct.pack(_SECCOMP_RESP_FORMAT, identifier, value, error, 0)
|
| 628 |
+
)
|
| 629 |
+
try:
|
| 630 |
+
fcntl.ioctl(listener, _SECCOMP_IOCTL_NOTIF_SEND, response, True)
|
| 631 |
+
except OSError as exc:
|
| 632 |
+
if exc.errno != errno.ENOENT:
|
| 633 |
+
raise
|
| 634 |
+
finally:
|
| 635 |
+
for descriptor in locked_files.values():
|
| 636 |
+
os.close(descriptor)
|
| 637 |
+
|
| 638 |
+
|
| 639 |
+
def _drop_credentials(uid: int | None, gid: int | None) -> None:
|
| 640 |
+
"""Irreversibly adopt the requested worker identity, when configured."""
|
| 641 |
+
|
| 642 |
+
if uid is None or gid is None:
|
| 643 |
+
return
|
| 644 |
+
os.setgroups([])
|
| 645 |
+
os.setgid(gid)
|
| 646 |
+
os.setuid(uid)
|
| 647 |
+
if os.geteuid() != uid or os.getegid() != gid or os.getgroups():
|
| 648 |
+
raise OSError(errno.EPERM, "worker credential drop did not take effect")
|
| 649 |
+
|
| 650 |
+
|
| 651 |
+
def _kill_and_reap(child_pid: int) -> None:
|
| 652 |
+
try:
|
| 653 |
+
os.kill(child_pid, signal.SIGKILL)
|
| 654 |
+
except ProcessLookupError:
|
| 655 |
+
pass
|
| 656 |
+
try:
|
| 657 |
+
os.waitpid(child_pid, 0)
|
| 658 |
+
except ChildProcessError:
|
| 659 |
+
pass
|
| 660 |
+
|
| 661 |
+
|
| 662 |
+
def sandbox_exec(
|
| 663 |
+
command: Sequence[str],
|
| 664 |
+
*,
|
| 665 |
+
root: Path,
|
| 666 |
+
data: Path,
|
| 667 |
+
bind_port: int,
|
| 668 |
+
connect_ports: set[int],
|
| 669 |
+
uid: int | None,
|
| 670 |
+
gid: int | None,
|
| 671 |
+
file_size_limit_bytes: int | None,
|
| 672 |
+
read_paths: Sequence[Path] = (),
|
| 673 |
+
broker_tid_fd: int | None = None,
|
| 674 |
+
control_fd: int | None = None,
|
| 675 |
+
) -> None:
|
| 676 |
+
root = root.resolve(strict=True)
|
| 677 |
+
data = data.resolve(strict=True)
|
| 678 |
+
parent_channel, child_channel = socket.socketpair()
|
| 679 |
+
child_pid = os.fork()
|
| 680 |
+
if child_pid == 0:
|
| 681 |
+
parent_channel.close()
|
| 682 |
+
if control_fd is not None:
|
| 683 |
+
os.close(control_fd)
|
| 684 |
+
if broker_tid_fd is not None:
|
| 685 |
+
os.close(broker_tid_fd)
|
| 686 |
+
stage = "landlock"
|
| 687 |
+
try:
|
| 688 |
+
_landlock(root, data, bind_port, connect_ports, read_paths)
|
| 689 |
+
stage = "resource limits"
|
| 690 |
+
if file_size_limit_bytes is not None:
|
| 691 |
+
resource.setrlimit(
|
| 692 |
+
resource.RLIMIT_FSIZE,
|
| 693 |
+
(file_size_limit_bytes, file_size_limit_bytes),
|
| 694 |
+
)
|
| 695 |
+
if uid is not None and gid is not None:
|
| 696 |
+
stage = "credential drop"
|
| 697 |
+
_drop_credentials(uid, gid)
|
| 698 |
+
stage = "lock broker access"
|
| 699 |
+
libc = ctypes.CDLL(None, use_errno=True)
|
| 700 |
+
if libc.prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) != 0:
|
| 701 |
+
raise OSError(ctypes.get_errno(), "cannot enable lock broker access")
|
| 702 |
+
stage = "seccomp"
|
| 703 |
+
listener = _seccomp()
|
| 704 |
+
stage = "listener handoff"
|
| 705 |
+
_send_fd(child_channel, listener)
|
| 706 |
+
os.close(listener)
|
| 707 |
+
child_channel.close()
|
| 708 |
+
stage = "candidate cwd"
|
| 709 |
+
os.chdir(root)
|
| 710 |
+
stage = "candidate exec"
|
| 711 |
+
os.execv(command[0], list(command))
|
| 712 |
+
except BaseException as exc:
|
| 713 |
+
message = f"candidate sandbox setup failed during {stage}: {exc}\n".encode(
|
| 714 |
+
"utf-8", "replace"
|
| 715 |
+
)
|
| 716 |
+
try:
|
| 717 |
+
os.write(2, message)
|
| 718 |
+
except OSError:
|
| 719 |
+
pass
|
| 720 |
+
os._exit(126)
|
| 721 |
+
|
| 722 |
+
child_channel.close()
|
| 723 |
+
try:
|
| 724 |
+
listener = _receive_fd(parent_channel)
|
| 725 |
+
except BaseException:
|
| 726 |
+
_kill_and_reap(child_pid)
|
| 727 |
+
raise
|
| 728 |
+
finally:
|
| 729 |
+
parent_channel.close()
|
| 730 |
+
try:
|
| 731 |
+
_drop_credentials(uid, gid)
|
| 732 |
+
except BaseException:
|
| 733 |
+
os.close(listener)
|
| 734 |
+
_kill_and_reap(child_pid)
|
| 735 |
+
raise
|
| 736 |
+
broker_errors: list[BaseException] = []
|
| 737 |
+
if control_fd is not None:
|
| 738 |
+
os.set_blocking(control_fd, False)
|
| 739 |
+
|
| 740 |
+
def broker() -> None:
|
| 741 |
+
try:
|
| 742 |
+
_lock_broker(listener, data)
|
| 743 |
+
except BaseException as exc:
|
| 744 |
+
broker_errors.append(exc)
|
| 745 |
+
|
| 746 |
+
broker_thread = threading.Thread(target=broker, daemon=True)
|
| 747 |
+
broker_thread.start()
|
| 748 |
+
if broker_tid_fd is not None:
|
| 749 |
+
try:
|
| 750 |
+
native_id = broker_thread.native_id
|
| 751 |
+
if native_id is None:
|
| 752 |
+
raise OSError(errno.EIO, "lock broker thread has no native id")
|
| 753 |
+
os.write(
|
| 754 |
+
broker_tid_fd,
|
| 755 |
+
f"{native_id} {child_pid}\n".encode("ascii"),
|
| 756 |
+
)
|
| 757 |
+
except BaseException:
|
| 758 |
+
os.close(listener)
|
| 759 |
+
_kill_and_reap(child_pid)
|
| 760 |
+
broker_thread.join(timeout=1)
|
| 761 |
+
if control_fd is not None:
|
| 762 |
+
os.close(control_fd)
|
| 763 |
+
raise
|
| 764 |
+
finally:
|
| 765 |
+
os.close(broker_tid_fd)
|
| 766 |
+
status = 0
|
| 767 |
+
while True:
|
| 768 |
+
if control_fd is not None:
|
| 769 |
+
try:
|
| 770 |
+
requested = os.read(control_fd, 4096)
|
| 771 |
+
except (BlockingIOError, OSError):
|
| 772 |
+
requested = b""
|
| 773 |
+
for marker in requested:
|
| 774 |
+
requested_signal = {
|
| 775 |
+
ord("T"): signal.SIGTERM,
|
| 776 |
+
ord("K"): signal.SIGKILL,
|
| 777 |
+
}.get(marker)
|
| 778 |
+
if requested_signal is not None:
|
| 779 |
+
try:
|
| 780 |
+
os.kill(child_pid, requested_signal)
|
| 781 |
+
except ProcessLookupError:
|
| 782 |
+
pass
|
| 783 |
+
waited, status = os.waitpid(child_pid, os.WNOHANG)
|
| 784 |
+
if waited == child_pid:
|
| 785 |
+
break
|
| 786 |
+
if broker_errors:
|
| 787 |
+
os.kill(child_pid, signal.SIGKILL)
|
| 788 |
+
_waited, status = os.waitpid(child_pid, 0)
|
| 789 |
+
break
|
| 790 |
+
time.sleep(0.01)
|
| 791 |
+
if control_fd is not None:
|
| 792 |
+
os.close(control_fd)
|
| 793 |
+
os.close(listener)
|
| 794 |
+
broker_thread.join(timeout=1)
|
| 795 |
+
if broker_errors:
|
| 796 |
+
raise OSError(errno.EIO, "candidate lock broker failed") from broker_errors[0]
|
| 797 |
+
# The trusted launcher/broker completed normally. Candidate business exit
|
| 798 |
+
# status is observed through readiness/lifecycle, while a nonzero launcher
|
| 799 |
+
# status remains reserved for audit infrastructure failure.
|
| 800 |
+
os._exit(0)
|
| 801 |
+
|
| 802 |
+
|
| 803 |
+
def main(argv: Sequence[str] | None = None) -> int:
|
| 804 |
+
parser = argparse.ArgumentParser()
|
| 805 |
+
parser.add_argument("--root", type=Path, required=True)
|
| 806 |
+
parser.add_argument("--data", type=Path, required=True)
|
| 807 |
+
parser.add_argument("--bind-port", type=int, required=True)
|
| 808 |
+
parser.add_argument("--connect-port", type=int, action="append", default=[])
|
| 809 |
+
parser.add_argument("--uid", type=int)
|
| 810 |
+
parser.add_argument("--gid", type=int)
|
| 811 |
+
parser.add_argument("--file-size-limit-bytes", type=int)
|
| 812 |
+
parser.add_argument("--read-path", type=Path, action="append", default=[])
|
| 813 |
+
parser.add_argument("--broker-tid-fd", type=int)
|
| 814 |
+
parser.add_argument("--control-fd", type=int)
|
| 815 |
+
parser.add_argument("command", nargs=argparse.REMAINDER)
|
| 816 |
+
arguments = parser.parse_args(argv)
|
| 817 |
+
command = arguments.command
|
| 818 |
+
if command[:1] == ["--"]:
|
| 819 |
+
command = command[1:]
|
| 820 |
+
if not command:
|
| 821 |
+
parser.error("candidate command is required")
|
| 822 |
+
if (arguments.uid is None) != (arguments.gid is None):
|
| 823 |
+
parser.error("uid and gid must be provided together")
|
| 824 |
+
sandbox_exec(
|
| 825 |
+
command,
|
| 826 |
+
root=arguments.root,
|
| 827 |
+
data=arguments.data,
|
| 828 |
+
bind_port=arguments.bind_port,
|
| 829 |
+
connect_ports=set(arguments.connect_port),
|
| 830 |
+
uid=arguments.uid,
|
| 831 |
+
gid=arguments.gid,
|
| 832 |
+
file_size_limit_bytes=arguments.file_size_limit_bytes,
|
| 833 |
+
read_paths=arguments.read_path,
|
| 834 |
+
broker_tid_fd=arguments.broker_tid_fd,
|
| 835 |
+
control_fd=arguments.control_fd,
|
| 836 |
+
)
|
| 837 |
+
return 127
|
| 838 |
+
|
| 839 |
+
|
| 840 |
+
if __name__ == "__main__":
|
| 841 |
+
raise SystemExit(main())
|
tasks/backcountry/environment/reference/clone/frontend/templates/404.html
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
{% block title %}Page Not Found | Backcountry.com{% endblock %}
|
| 3 |
+
{% block content %}
|
| 4 |
+
<div class="page">
|
| 5 |
+
<div class="emptystate">
|
| 6 |
+
<h2>We can't find that page</h2>
|
| 7 |
+
<p>The page you were looking for is no longer available.</p>
|
| 8 |
+
<p><a class="btn btn--secondary btn--sm" href="/cat/travel">Shop Travel</a></p>
|
| 9 |
+
</div>
|
| 10 |
+
</div>
|
| 11 |
+
{% endblock %}
|
tasks/backcountry/environment/reference/clone/frontend/templates/_account_nav.html
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% macro account_nav(section) %}
|
| 2 |
+
<aside class="account__nav" aria-label="Account">
|
| 3 |
+
<ul>
|
| 4 |
+
<li><a class="{{ 'is-active' if section == 'overview' }}" href="/account">Account Overview</a></li>
|
| 5 |
+
<li><a class="{{ 'is-active' if section == 'orders' }}" href="/account/order-history">Order History</a></li>
|
| 6 |
+
<li><a class="{{ 'is-active' if section == 'wishlist' }}" href="/account/wishlist">Wish List</a></li>
|
| 7 |
+
</ul>
|
| 8 |
+
<form method="post" action="/account/signout" style="margin-top:16px">
|
| 9 |
+
<button class="btn btn--secondary btn--sm" type="submit">Sign Out</button>
|
| 10 |
+
</form>
|
| 11 |
+
</aside>
|
| 12 |
+
{% endmacro %}
|
tasks/backcountry/environment/reference/clone/frontend/templates/_icons.html
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{# Masthead icons transcribed from the source header's inline SVG. #}
|
| 2 |
+
{% macro icon_account() %}<svg viewBox="0 0 128 128" class="chakra-avatar__svg css-16ite8i" role="img" aria-label=" avatar"><path fill="currentColor" d="M103,102.1388 C93.094,111.92 79.3504,118 64.1638,118 C48.8056,118 34.9294,111.768 25,101.7892 L25,95.2 C25,86.8096 31.981,80 40.6,80 L87.4,80 C96.019,80 103,86.8096 103,95.2 L103,102.1388 Z"></path><path fill="currentColor" d="M63.9961647,24 C51.2938136,24 41,34.2938136 41,46.9961647 C41,59.7061864 51.2938136,70 63.9961647,70 C76.6985159,70 87,59.7061864 87,46.9961647 C87,34.2938136 76.6985159,24 63.9961647,24"></path></svg>{% endmacro %}
|
| 3 |
+
{% macro icon_cart() %}<svg viewBox="0 0 20 18" focusable="false" class="chakra-icon css-3otfuf"><path d="M18.1202 9.40542L19.9789 3.43961C20.0974 2.9263 19.7011 2.4375 19.1663 2.4375H5.52806L5.20979 0.905908C5.13049 0.524155 4.78924 0.25 4.39337 0.25H0.833334C0.37309 0.25 0 0.617261 0 1.07031V1.61719C0 2.07024 0.37309 2.4375 0.833334 2.4375H3.25983L5.69899 14.176C5.11545 14.5063 4.72222 15.1258 4.72222 15.8359C4.72222 16.893 5.59278 17.75 6.66667 17.75C7.74056 17.75 8.61111 16.893 8.61111 15.8359C8.61111 15.3002 8.38726 14.8162 8.02695 14.4688H15.3064C14.9461 14.8162 14.7222 15.3002 14.7222 15.8359C14.7222 16.893 15.5928 17.75 16.6667 17.75C17.7406 17.75 18.6111 16.893 18.6111 15.8359C18.6111 15.0781 18.1636 14.4232 17.5146 14.1131L17.7062 13.2834C17.8247 12.7701 17.4283 12.2812 16.8936 12.2812H7.57351L7.12899 10.0439H17.3076C17.6967 10.0439 18.034 9.7789 18.1202 9.40542Z"></path></svg>{% endmacro %}
|
| 4 |
+
{% macro icon_expert() %}<svg viewBox="0 0 10 16" focusable="false" class="chakra-icon css-onkibi"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 0V1.52547V12.5774V16L2.44187 13.7118L4.99978 11.3152L7.55828 13.7118L10 15.9995V0H0Z" fill="#36827F"></path></svg>{% endmacro %}
|
| 5 |
+
{% macro icon_search() %}<svg viewBox="0 0 24 24" focusable="false" class="chakra-icon css-a4aeo8" aria-hidden="true"><path fill="currentColor" d="M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z"></path></svg>{% endmacro %}
|
tasks/backcountry/environment/reference/clone/frontend/templates/_tile.html
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% macro tile(p) %}
|
| 2 |
+
<div class="tile" data-id="PLI" data-index="{{ p.listingIndex }}">
|
| 3 |
+
{% if p.badge %}
|
| 4 |
+
<div class="tile__badge" data-id="productBadge">
|
| 5 |
+
<img src="/static/assets/brand/gearhead-top-pick.svg" alt="{{ p.badge }}" height="26">
|
| 6 |
+
</div>
|
| 7 |
+
{% else %}<div class="tile__badge--empty"></div>{% endif %}
|
| 8 |
+
<a class="tile__imagelink" href="{{ p.slug }}">
|
| 9 |
+
<div class="tile__image">
|
| 10 |
+
<img data-id="image" src="{{ (default_color(p).image if default_color(p) else p.mainImage) or p.mainImage }}"
|
| 11 |
+
alt="{{ p.title }}" loading="lazy" width="300" height="300">
|
| 12 |
+
</div>
|
| 13 |
+
</a>
|
| 14 |
+
<div class="tile__swatches">
|
| 15 |
+
{% for c in p.colors[:5] %}
|
| 16 |
+
<a class="tile__swatch{% if loop.first %} is-selected{% endif %}" data-id="colorTile"
|
| 17 |
+
href="{{ p.slug }}?color={{ c.name | urlencode }}" title="{{ c.name }}">
|
| 18 |
+
<img src="{{ c.thumb or c.swatch }}" alt="{{ c.name }}" loading="lazy" width="35" height="35">
|
| 19 |
+
</a>
|
| 20 |
+
{% endfor %}
|
| 21 |
+
{% if p.colors | length > 5 %}<span class="tile__more">+{{ p.colors | length - 5 }}</span>{% endif %}
|
| 22 |
+
</div>
|
| 23 |
+
<p class="tile__brand" data-id="brandName">{{ p.brand }}</p>
|
| 24 |
+
<h2 class="tile__title" data-id="title"><a href="{{ p.slug }}">{{ p.title }}</a></h2>
|
| 25 |
+
{% if p.colors %}<p class="tile__colors" data-id="colorsCount">{{ p.colors | length }} color{{ '' if p.colors | length == 1 else 's' }}</p>{% endif %}
|
| 26 |
+
<div class="tile__price">
|
| 27 |
+
<span data-id="price">{{ price_label(p) }}</span>
|
| 28 |
+
{% if list_price_label(p) %}<span class="was">{{ list_price_label(p) }}</span>{% endif %}
|
| 29 |
+
{% if discount_label(p) %}<span class="tile__sale" data-id="salePrice">{{ discount_label(p) }}</span>{% endif %}
|
| 30 |
+
</div>
|
| 31 |
+
{% if p.reviews.count %}
|
| 32 |
+
<div class="tile__rating">
|
| 33 |
+
<span class="stars" data-id="reviewRating" aria-hidden="true">{{ stars(p.reviews.average) }}</span>
|
| 34 |
+
<span data-id="reviewCount">({{ p.reviews.count }})</span>
|
| 35 |
+
</div>
|
| 36 |
+
{% endif %}
|
| 37 |
+
</div>
|
| 38 |
+
{% endmacro %}
|
tasks/backcountry/environment/reference/clone/frontend/templates/account.html
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
{% from "_account_nav.html" import account_nav %}
|
| 3 |
+
{% block title %}Account Overview | Backcountry.com{% endblock %}
|
| 4 |
+
{% block content %}
|
| 5 |
+
<div class="page">
|
| 6 |
+
<h1 class="plp__head">Hi, {{ member.first_name }}!</h1>
|
| 7 |
+
<div class="account">
|
| 8 |
+
{{ account_nav(account_section) }}
|
| 9 |
+
<div>
|
| 10 |
+
<div class="card">
|
| 11 |
+
<h2>{{ member.tier }}</h2>
|
| 12 |
+
<p class="cart__line-variant">{{ member.email }}</p>
|
| 13 |
+
<p class="cart__line-variant">Earn 10% cash back on all purchases.</p>
|
| 14 |
+
</div>
|
| 15 |
+
<div class="card">
|
| 16 |
+
<h2>Recent Orders</h2>
|
| 17 |
+
{% if orders %}
|
| 18 |
+
{% for o in orders %}
|
| 19 |
+
<p class="cart__line-variant">
|
| 20 |
+
<a href="/account/orders/{{ o.order_number }}">{{ o.order_number }}</a> —
|
| 21 |
+
{{ o.placed_on }} — {{ o.status }} — {{ o.total | money }}</p>
|
| 22 |
+
{% endfor %}
|
| 23 |
+
<p><a href="/account/order-history">View all orders</a></p>
|
| 24 |
+
{% else %}<p class="cart__line-variant">No orders yet.</p>{% endif %}
|
| 25 |
+
</div>
|
| 26 |
+
<div class="card">
|
| 27 |
+
<h2>Address Book</h2>
|
| 28 |
+
{% for a in addresses %}
|
| 29 |
+
<p class="cart__line-variant"><strong>{{ a.label }}{% if a.is_default %} (Default){% endif %}</strong><br>
|
| 30 |
+
{{ a.recipient }}<br>{{ a.line1 }}{% if a.line2 %}, {{ a.line2 }}{% endif %}<br>
|
| 31 |
+
{{ a.city }}, {{ a.region }} {{ a.postal_code }}<br>{{ a.country }}</p>
|
| 32 |
+
{% endfor %}
|
| 33 |
+
</div>
|
| 34 |
+
<div class="card">
|
| 35 |
+
<h2>Wish List</h2>
|
| 36 |
+
<p class="cart__line-variant">{{ wishlist_count }} item{{ '' if wishlist_count == 1 else 's' }} saved.
|
| 37 |
+
<a href="/account/wishlist">View wish list</a></p>
|
| 38 |
+
</div>
|
| 39 |
+
</div>
|
| 40 |
+
</div>
|
| 41 |
+
</div>
|
| 42 |
+
{% endblock %}
|
tasks/backcountry/environment/reference/clone/frontend/templates/base.html
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!doctype html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="utf-8">
|
| 5 |
+
<meta name="viewport" content="width=1200">
|
| 6 |
+
<title>{% block title %}Backcountry - Outdoor Gear & Clothing for Ski, Snowboard, Camp, & More{% endblock %}</title>
|
| 7 |
+
<link rel="stylesheet" href="{{ static_version('/static/css/tokens.css') }}">
|
| 8 |
+
<link rel="stylesheet" href="{{ static_version('/static/css/site.css') }}">
|
| 9 |
+
</head>
|
| 10 |
+
{% from "_icons.html" import icon_account, icon_cart, icon_expert, icon_search %}
|
| 11 |
+
<body>
|
| 12 |
+
<a class="skip" href="#content">Skip To Content</a>
|
| 13 |
+
<a class="skip" href="#search-term">Skip To Search</a>
|
| 14 |
+
|
| 15 |
+
{% if not bare_chrome %}
|
| 16 |
+
<div class="announcebar" data-id="global-text-banner">
|
| 17 |
+
<div class="announcebar__inner">
|
| 18 |
+
<a class="announcebar__util" href="/info/loyalty">What's Summit Club?</a>
|
| 19 |
+
<button class="announcebar__arrow" type="button" data-announce="prev" aria-label="Previous Slide">‹</button>
|
| 20 |
+
<div class="announcebar__track" data-announce-track>
|
| 21 |
+
{% for a in chrome.announcements %}
|
| 22 |
+
<a class="announcebar__slide{% if loop.first %} is-active{% endif %}" data-id="global-text-banner-link" href="{{ a.href }}">
|
| 23 |
+
<p>{{ a.text }} <span>{{ a.cta }}</span></p>
|
| 24 |
+
</a>
|
| 25 |
+
{% endfor %}
|
| 26 |
+
</div>
|
| 27 |
+
<button class="announcebar__arrow" type="button" data-announce="next" aria-label="Next Slide">›</button>
|
| 28 |
+
<a class="announcebar__util announcebar__util--right" href="/sc/retail-stores">Find Your Store</a>
|
| 29 |
+
</div>
|
| 30 |
+
</div>
|
| 31 |
+
|
| 32 |
+
<header data-id="header">
|
| 33 |
+
<div class="masthead">
|
| 34 |
+
<a class="masthead__logo logo" data-id="header-logo" href="/" aria-label="Home Page">
|
| 35 |
+
<span class="visually-hidden">Home Page</span>
|
| 36 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1700 308" focusable="false" class="chakra-icon css-qe02r7"><path d="M382.74 231.76V223.37C397.76 221.6 399.53 220.06 399.53 208.13V100.34C399.53 88.4098 397.76 86.8598 382.74 85.0998V76.7098H458.07C492.31 76.7098 511.97 89.7398 511.97 115.36C511.97 137.67 491.65 148.94 470.44 151.15C499.82 152.26 521.25 165.95 521.25 189.8C521.25 217.41 500.49 231.77 461.17 231.77H382.75L382.74 231.76ZM437.08 86.1898V146.49H445.47C465.79 146.49 475.96 136.11 475.96 115.79C475.96 95.4698 464.47 86.1898 445.25 86.1898H437.08ZM437.08 157.32V207.25C437.08 219.18 441.72 222.27 454.31 222.27H456.3C473.97 222.27 484.36 211.22 484.36 189.36C484.36 169.48 473.53 157.33 449.68 157.33H437.09L437.08 157.32Z"></path><path d="M628.37 207.46C628.37 213.87 629.48 218.51 635 218.51C638.31 218.51 641.19 217.63 643.17 216.74L644.5 222.04C637.87 229.55 629.03 233.97 617.55 233.97C605.18 233.97 596.79 226.9 593.92 214.97C587.07 224.25 576.02 233.52 560.12 233.52C541.79 233.52 529.42 222.69 529.42 204.36C529.42 186.03 542.9 177.41 559.02 171.45L593.26 159.3V138.76C593.26 127.27 589.73 119.32 579.56 119.32C570.06 119.32 566.08 126.83 566.08 137.43C566.08 142.07 566.74 146.71 568.07 151.79L546.86 154.66C540.67 152.67 536.48 147.59 536.48 140.08C536.48 120.87 556.36 111.58 581.99 111.58C611.37 111.58 628.38 121.52 628.38 148.91V207.45L628.37 207.46ZM593.24 209V167.91L577.56 174.1C568.95 177.64 563.42 182.05 563.42 194.65C563.42 206.14 568.28 214.31 579.76 214.31C584.84 214.31 588.38 212.32 593.24 209.01V209Z"></path><path d="M763.01 78.2198C763.01 75.0498 764.21 71.4798 750.2 71.5898V63.8298L792.61 51.8398H798.35L798.79 214.75C798.79 222.04 802.32 223.14 812.04 223.81V231.76H750.19V223.81C759.91 223.15 763.44 222.04 763.44 214.75L763 78.2198H763.01ZM835.02 137.88C839.88 133.46 841.87 130.81 841.87 127.94C841.87 123.74 838.34 122.86 828.17 121.75V113.8H876.54V121.75C868.81 123.08 863.95 124.4 858.42 129.92L831.03 155.54L881.17 226.22V231.75H843.84L800.77 169.02L835.01 137.87L835.02 137.88Z"></path><path d="M986.29 175.2C986.29 137.87 1011.25 111.59 1045.71 111.59C1080.17 111.59 1104.91 134.79 1104.91 170.35C1104.91 207.68 1079.73 233.96 1045.27 233.96C1010.81 233.96 986.29 210.76 986.29 175.2ZM1067.14 178.96C1067.14 144.5 1060.73 120.2 1044.61 120.2C1029.81 120.2 1023.84 138.1 1023.84 166.59C1023.84 201.05 1030.25 225.35 1046.38 225.35C1061.18 225.35 1067.14 207.45 1067.14 178.96Z"></path><path d="M1228.55 207.46C1228.55 214.97 1229.17 222.65 1236.91 223.09L1242.25 223.47V231.76H1199.16L1193.23 231.01L1193.21 212.77C1184.6 222.93 1172.89 233.97 1154.33 233.97C1134.67 233.97 1121.64 222.71 1121.64 197.52V141.63C1121.64 134.79 1120.1 130.8 1112.14 129.04L1108.83 128.38V120.87L1152.35 111.81H1158.31L1157.2 138.98V193.54C1157.2 205.91 1161.84 213.2 1173.33 213.2C1181.06 213.2 1186.58 210.33 1193.21 206.79V141.63C1193.21 134.79 1191.67 130.8 1183.72 129.04L1180.41 128.38V120.87L1223.7 111.81H1229.89L1228.57 138.54V207.46H1228.55Z"></path><path d="M1337.86 150.24C1337.86 138.75 1333.67 132.79 1321.95 132.79C1313.77 132.79 1306.26 135.88 1300.08 139.86V214.74C1300.08 222.03 1303.18 223.13 1312.67 223.8V231.75H1251.48V223.8C1260.98 223.14 1264.51 222.03 1264.51 214.74V136.76L1251.7 129.03V123.95L1294.33 111.58H1300.96L1300.08 133.45C1308.92 122.62 1321.51 111.58 1340.95 111.58C1361.93 111.58 1373.42 123.51 1373.42 147.58V214.73C1373.42 222.02 1376.96 223.12 1386.45 223.79V231.74H1325.26V223.79C1334.76 223.13 1337.85 222.02 1337.85 214.73V150.23L1337.86 150.24Z"></path><path d="M1436.09 113.8H1463.48V124.85H1436.09V197.97C1436.09 210.12 1440.73 215.2 1450.23 215.2C1455.97 215.2 1461.05 213.21 1466.36 209.24L1469.45 213.66C1461.72 226.03 1450.01 233.98 1433.22 233.98C1414.22 233.98 1400.53 224.26 1400.53 198.86V124.86H1387.28V118.67C1403.62 111.83 1418.21 99.2299 1428.58 84.4299H1436.09V113.81V113.8Z"></path><path d="M1521.36 212.1C1521.36 221.38 1526.21 222.48 1539.47 223.81V231.76H1472.76V223.81C1482.26 223.15 1485.79 222.04 1485.79 214.75V136.77L1472.98 129.04V123.96L1515.61 111.59H1522.24L1521.36 144.94C1531.08 119.98 1538.15 111.59 1551.62 111.59C1556.48 111.59 1560.01 113.13 1562 115.35V142.3H1557.36C1543.45 142.3 1531.96 142.96 1521.36 152.46V212.1Z"></path><path d="M1646.55 115.61V125.38L1647.51 125.49C1655.97 126.46 1660.25 129.59 1660.25 134.8C1660.25 136.29 1659.76 137.84 1659.2 139.33L1642.68 190.11L1621.7 135.12C1621.28 133.87 1621.09 132.89 1621.09 131.93C1621.09 128.62 1623.97 126.52 1629.66 125.71L1630.59 125.57V115.61H1570.11V126.25L1571.05 126.37C1580.22 127.58 1582.35 132.74 1587.01 144.06C1587.92 146.28 1588.93 148.71 1590.09 151.37L1625.87 232.15L1615.94 257.34C1612.07 264 1603.15 264.51 1597.35 263.57C1591.91 262.69 1588.04 260.48 1584.05 256.74L1578.13 273.9C1579.47 283.53 1587.32 289.19 1599.75 289.19C1612.18 289.19 1623.22 283.6 1628.27 271.07L1680.37 144.92C1685.7 131.92 1689.83 127.61 1698.81 125.69L1699.67 125.51V115.6H1646.56L1646.55 115.61Z"></path><path d="M696.14 123.44C695.13 123.76 694.15 124.16 693.23 124.63C683.93 129.36 679.2 138.51 676.84 148.14C671.3 170.66 678.42 201.88 703.8 208.53C706.95 209.35 710.2 209.78 713.45 209.75C728.82 209.58 736.17 201.07 743.49 194.29L747.91 196.72C742.28 219.7 725.78 234.56 699.86 234.56C679.04 234.56 660.57 222.4 652.42 203.23C641.81 178.27 646.13 146.31 665.29 126.59C680.86 110.57 706.87 107.52 727.13 115.38C728.49 115.91 732.05 117.59 734.85 119.57C737.37 121.35 745.02 129.63 744.58 138.62C744.17 147.12 732.21 148.1 729.94 148.18C728.91 148.21 719.75 148.25 719.72 146.67C719.59 139.65 719.82 138.06 717.07 131.4C713.58 122.95 703.98 120.93 696.12 123.44H696.14Z"></path><path d="M927.5 123.33C926.49 123.65 925.51 124.05 924.59 124.52C915.29 129.25 910.57 138.4 908.2 148.03C902.66 170.55 909.78 201.77 935.16 208.42C938.31 209.24 941.56 209.67 944.81 209.64C960.18 209.47 967.52 200.96 974.85 194.18L979.27 196.61C973.64 219.59 957.14 234.45 931.22 234.45C910.4 234.45 891.94 222.29 883.78 203.12C873.16 178.16 877.49 146.2 896.65 126.48C912.22 110.46 938.23 107.41 958.49 115.27C959.85 115.8 963.41 117.48 966.22 119.46C968.74 121.24 976.39 129.52 975.95 138.51C975.54 147.01 963.58 147.99 961.31 148.07C960.28 148.1 951.12 148.14 951.09 146.56C950.96 139.54 951.19 137.95 948.44 131.3C944.95 122.85 935.35 120.83 927.49 123.34L927.5 123.33Z"></path><path d="M215.76 202.77C210.76 196.82 209.36 189.3 213.11 183.58C215.82 179.24 217.35 174.27 217.56 169.16C217.67 160.24 207.23 147 192.67 144.26C183.82 142.61 174.05 142.57 166.48 141.55C145.4 138.76 139.36 130.13 139.36 121.86C139.36 111.79 149.27 109.03 153.44 108.49C170.68 106.35 191.78 118.2 207.01 140.21C197.85 111.9 178.57 98.3999 156.15 91.9899C179.23 93.7799 193.89 104.3 208.98 123.69C197.73 88.26 166.39 78.8799 148.96 77.8799C128.78 76.6999 112.96 81.7199 100.42 97.1399C99.78 97.9099 98.78 99.2599 98.1 100.18C97.58 100.88 97.12 101.62 96.72 102.38C96.22 103.31 95.77 104.28 95.38 105.27C94.1 108.95 93.12 112.73 92.43 116.58C91.41 121.14 89.91 125.58 87.95 129.82C89.16 131.69 90.97 133.08 93.09 133.78C93.09 133.86 91.91 135.83 93.44 140.21C94.47 143.17 96.76 145.19 97.06 148.84C97.33 152.01 94.78 156.92 94.78 156.92C94.78 156.92 101.29 152.69 102.42 148.69C103.37 145.34 101.78 143.71 102.22 140.27C102.41 138.31 103.42 136.53 105.01 135.36C107.56 133.74 110.96 134.48 112.59 137.03C113.38 138.27 113.64 139.76 113.31 141.19C112.37 145.45 108.31 152.93 105.22 160.96C100.72 172.51 103.08 180.43 112.02 191.3C111.52 207.61 106.49 226.16 107.08 230.34C107.36 232.28 108.61 232.93 110.56 233.08H120.75L122.35 226.97C130.1 192 152.21 183.16 173.61 185.89C187.59 187.65 203.62 203.17 202.14 226.14C201.99 228.21 201.29 229.74 201.86 230.99C202.6 232.56 203.8 232.99 205.61 233.12H216.49L218.48 230.51C216.66 227.26 213.99 211 215.73 202.81H215.75L215.76 202.77ZM104.31 117.31C102.5 117.5 100.87 116.2 100.68 114.4C100.49 112.6 101.79 110.97 103.6 110.78C105.41 110.59 107.04 111.89 107.23 113.69C107.42 115.49 106.11 117.11 104.31 117.31Z"></path><path d="M153.22 307.68C68.6 307.68 0 238.81 0 153.84C0 68.87 68.6 0 153.22 0C237.84 0 306.44 68.88 306.44 153.84C306.35 238.77 237.8 307.59 153.22 307.68ZM153.22 28.66C84.37 28.66 28.55 84.71 28.55 153.84C28.55 222.97 84.37 279.02 153.22 279.02C222.07 279.02 277.89 222.97 277.89 153.84C277.82 84.73 222.04 28.74 153.22 28.66Z"></path></svg>
|
| 37 |
+
</a>
|
| 38 |
+
<form class="masthead__search" data-id="search-form" action="/search" method="get" role="search">
|
| 39 |
+
<label class="visually-hidden" for="search-term">Search</label>
|
| 40 |
+
<button type="submit" aria-label="Submit">{{ icon_search() }}</button>
|
| 41 |
+
<input id="search-term" data-id="searchBar" type="search" name="q" autocomplete="off"
|
| 42 |
+
value="{{ search_query or '' }}" placeholder="Search gear & apparel">
|
| 43 |
+
</form>
|
| 44 |
+
<span></span>
|
| 45 |
+
<a class="masthead__expert" data-id="expert-help" href="/service/bc-help-center">{{ icon_expert() }}Expert Help</a>
|
| 46 |
+
<span class="masthead__account-group">
|
| 47 |
+
{% if member %}
|
| 48 |
+
<a class="masthead__account" data-id="header-account-link" href="/account">
|
| 49 |
+
{{ icon_account() }}
|
| 50 |
+
<span class="masthead__account-text">
|
| 51 |
+
<span class="masthead__account-hi">Hi, {{ member.first_name }}!</span>
|
| 52 |
+
<span class="masthead__account-tier">{{ member.tier }}</span>
|
| 53 |
+
</span>
|
| 54 |
+
</a>
|
| 55 |
+
{% else %}
|
| 56 |
+
<a class="masthead__account" data-id="header-account-link" href="/account/signin">
|
| 57 |
+
{{ icon_account() }}
|
| 58 |
+
<span class="masthead__account-text">
|
| 59 |
+
<span class="masthead__account-hi">Sign In</span>
|
| 60 |
+
<span class="masthead__account-tier">For Member Perks</span>
|
| 61 |
+
</span>
|
| 62 |
+
</a>
|
| 63 |
+
{% endif %}
|
| 64 |
+
</span>
|
| 65 |
+
<a class="masthead__cart" data-id="header-cart-button" href="/cart"
|
| 66 |
+
aria-label="Cart, Contains {{ cart_count }} Items">
|
| 67 |
+
{{ icon_cart() }}
|
| 68 |
+
<span class="masthead__cart-count" data-id="cart-count">{{ cart_count }}</span>
|
| 69 |
+
</a>
|
| 70 |
+
</div>
|
| 71 |
+
|
| 72 |
+
<nav class="mainnav" data-id="main-nav" aria-label="Primary">
|
| 73 |
+
<ul>
|
| 74 |
+
{% for item in nav %}
|
| 75 |
+
<li class="mainnav__item" data-id="nav-item-{{ item.key }}">
|
| 76 |
+
<a class="mainnav__link{% if active_nav == item.key %} is-active{% endif %}"
|
| 77 |
+
href="{{ item.href or '#' }}" data-id="header-item-title">{{ item.label }}</a>
|
| 78 |
+
{% if item.columns %}
|
| 79 |
+
<div class="flyout" data-id="flyout-{{ item.key }}">
|
| 80 |
+
<div class="flyout__grid" data-id="layoutGrid">
|
| 81 |
+
{% for col in item.columns %}
|
| 82 |
+
{% if col.kind == 'promo' %}
|
| 83 |
+
<div class="flyout__promo" data-id="gridItem">
|
| 84 |
+
<a href="{{ col.href }}">
|
| 85 |
+
<img src="{{ col.file }}" alt="{{ col.alt }}" width="140" height="140" loading="lazy">
|
| 86 |
+
{% if col.caption %}<p>{{ col.caption }}</p>{% endif %}
|
| 87 |
+
</a>
|
| 88 |
+
</div>
|
| 89 |
+
{% else %}
|
| 90 |
+
<div class="flyout__col" data-id="flyoutLinksSection"
|
| 91 |
+
style="flex-basis: {{ col.width or 143 }}px">
|
| 92 |
+
{% for block in col.blocks %}
|
| 93 |
+
{% if block.type == 'heading' %}
|
| 94 |
+
<a class="flyout__heading" href="{{ block.href }}"
|
| 95 |
+
data-id="flyout-section-{{ block.label | slugify }}">{{ block.label }}</a>
|
| 96 |
+
{% else %}
|
| 97 |
+
<ul style="column-count: {{ block.columns or 1 }}">
|
| 98 |
+
{% for link in block.links %}<li><a href="{{ link.href }}">{{ link.label }}</a></li>{% endfor %}
|
| 99 |
+
</ul>
|
| 100 |
+
{% endif %}
|
| 101 |
+
{% endfor %}
|
| 102 |
+
</div>
|
| 103 |
+
{% endif %}
|
| 104 |
+
{% endfor %}
|
| 105 |
+
</div>
|
| 106 |
+
</div>
|
| 107 |
+
{% endif %}
|
| 108 |
+
</li>
|
| 109 |
+
{% endfor %}
|
| 110 |
+
</ul>
|
| 111 |
+
</nav>
|
| 112 |
+
</header>
|
| 113 |
+
|
| 114 |
+
{% if show_campaign %}
|
| 115 |
+
<div class="campaign" data-id="cmsCampaignBanner">
|
| 116 |
+
<div class="campaign__inner" data-id="campaignBannerContainer">
|
| 117 |
+
{% for c in chrome.campaign %}
|
| 118 |
+
<div class="campaign__cell">
|
| 119 |
+
<strong><a href="{{ c.href }}">{{ c.heading }}</a></strong>
|
| 120 |
+
<a href="{{ c.href }}">{{ c.sub }}</a>
|
| 121 |
+
</div>
|
| 122 |
+
{% endfor %}
|
| 123 |
+
</div>
|
| 124 |
+
</div>
|
| 125 |
+
{% endif %}
|
| 126 |
+
|
| 127 |
+
{% else %}
|
| 128 |
+
<header class="masthead masthead--simple" data-id="simplified-cart-header">
|
| 129 |
+
<a class="masthead__logo logo" href="/" aria-label="Home Page">
|
| 130 |
+
<span class="visually-hidden">Home Page</span>
|
| 131 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1700 308" focusable="false" class="chakra-icon css-qe02r7"><path d="M382.74 231.76V223.37C397.76 221.6 399.53 220.06 399.53 208.13V100.34C399.53 88.4098 397.76 86.8598 382.74 85.0998V76.7098H458.07C492.31 76.7098 511.97 89.7398 511.97 115.36C511.97 137.67 491.65 148.94 470.44 151.15C499.82 152.26 521.25 165.95 521.25 189.8C521.25 217.41 500.49 231.77 461.17 231.77H382.75L382.74 231.76ZM437.08 86.1898V146.49H445.47C465.79 146.49 475.96 136.11 475.96 115.79C475.96 95.4698 464.47 86.1898 445.25 86.1898H437.08ZM437.08 157.32V207.25C437.08 219.18 441.72 222.27 454.31 222.27H456.3C473.97 222.27 484.36 211.22 484.36 189.36C484.36 169.48 473.53 157.33 449.68 157.33H437.09L437.08 157.32Z"></path><path d="M628.37 207.46C628.37 213.87 629.48 218.51 635 218.51C638.31 218.51 641.19 217.63 643.17 216.74L644.5 222.04C637.87 229.55 629.03 233.97 617.55 233.97C605.18 233.97 596.79 226.9 593.92 214.97C587.07 224.25 576.02 233.52 560.12 233.52C541.79 233.52 529.42 222.69 529.42 204.36C529.42 186.03 542.9 177.41 559.02 171.45L593.26 159.3V138.76C593.26 127.27 589.73 119.32 579.56 119.32C570.06 119.32 566.08 126.83 566.08 137.43C566.08 142.07 566.74 146.71 568.07 151.79L546.86 154.66C540.67 152.67 536.48 147.59 536.48 140.08C536.48 120.87 556.36 111.58 581.99 111.58C611.37 111.58 628.38 121.52 628.38 148.91V207.45L628.37 207.46ZM593.24 209V167.91L577.56 174.1C568.95 177.64 563.42 182.05 563.42 194.65C563.42 206.14 568.28 214.31 579.76 214.31C584.84 214.31 588.38 212.32 593.24 209.01V209Z"></path><path d="M763.01 78.2198C763.01 75.0498 764.21 71.4798 750.2 71.5898V63.8298L792.61 51.8398H798.35L798.79 214.75C798.79 222.04 802.32 223.14 812.04 223.81V231.76H750.19V223.81C759.91 223.15 763.44 222.04 763.44 214.75L763 78.2198H763.01ZM835.02 137.88C839.88 133.46 841.87 130.81 841.87 127.94C841.87 123.74 838.34 122.86 828.17 121.75V113.8H876.54V121.75C868.81 123.08 863.95 124.4 858.42 129.92L831.03 155.54L881.17 226.22V231.75H843.84L800.77 169.02L835.01 137.87L835.02 137.88Z"></path><path d="M986.29 175.2C986.29 137.87 1011.25 111.59 1045.71 111.59C1080.17 111.59 1104.91 134.79 1104.91 170.35C1104.91 207.68 1079.73 233.96 1045.27 233.96C1010.81 233.96 986.29 210.76 986.29 175.2ZM1067.14 178.96C1067.14 144.5 1060.73 120.2 1044.61 120.2C1029.81 120.2 1023.84 138.1 1023.84 166.59C1023.84 201.05 1030.25 225.35 1046.38 225.35C1061.18 225.35 1067.14 207.45 1067.14 178.96Z"></path><path d="M1228.55 207.46C1228.55 214.97 1229.17 222.65 1236.91 223.09L1242.25 223.47V231.76H1199.16L1193.23 231.01L1193.21 212.77C1184.6 222.93 1172.89 233.97 1154.33 233.97C1134.67 233.97 1121.64 222.71 1121.64 197.52V141.63C1121.64 134.79 1120.1 130.8 1112.14 129.04L1108.83 128.38V120.87L1152.35 111.81H1158.31L1157.2 138.98V193.54C1157.2 205.91 1161.84 213.2 1173.33 213.2C1181.06 213.2 1186.58 210.33 1193.21 206.79V141.63C1193.21 134.79 1191.67 130.8 1183.72 129.04L1180.41 128.38V120.87L1223.7 111.81H1229.89L1228.57 138.54V207.46H1228.55Z"></path><path d="M1337.86 150.24C1337.86 138.75 1333.67 132.79 1321.95 132.79C1313.77 132.79 1306.26 135.88 1300.08 139.86V214.74C1300.08 222.03 1303.18 223.13 1312.67 223.8V231.75H1251.48V223.8C1260.98 223.14 1264.51 222.03 1264.51 214.74V136.76L1251.7 129.03V123.95L1294.33 111.58H1300.96L1300.08 133.45C1308.92 122.62 1321.51 111.58 1340.95 111.58C1361.93 111.58 1373.42 123.51 1373.42 147.58V214.73C1373.42 222.02 1376.96 223.12 1386.45 223.79V231.74H1325.26V223.79C1334.76 223.13 1337.85 222.02 1337.85 214.73V150.23L1337.86 150.24Z"></path><path d="M1436.09 113.8H1463.48V124.85H1436.09V197.97C1436.09 210.12 1440.73 215.2 1450.23 215.2C1455.97 215.2 1461.05 213.21 1466.36 209.24L1469.45 213.66C1461.72 226.03 1450.01 233.98 1433.22 233.98C1414.22 233.98 1400.53 224.26 1400.53 198.86V124.86H1387.28V118.67C1403.62 111.83 1418.21 99.2299 1428.58 84.4299H1436.09V113.81V113.8Z"></path><path d="M1521.36 212.1C1521.36 221.38 1526.21 222.48 1539.47 223.81V231.76H1472.76V223.81C1482.26 223.15 1485.79 222.04 1485.79 214.75V136.77L1472.98 129.04V123.96L1515.61 111.59H1522.24L1521.36 144.94C1531.08 119.98 1538.15 111.59 1551.62 111.59C1556.48 111.59 1560.01 113.13 1562 115.35V142.3H1557.36C1543.45 142.3 1531.96 142.96 1521.36 152.46V212.1Z"></path><path d="M1646.55 115.61V125.38L1647.51 125.49C1655.97 126.46 1660.25 129.59 1660.25 134.8C1660.25 136.29 1659.76 137.84 1659.2 139.33L1642.68 190.11L1621.7 135.12C1621.28 133.87 1621.09 132.89 1621.09 131.93C1621.09 128.62 1623.97 126.52 1629.66 125.71L1630.59 125.57V115.61H1570.11V126.25L1571.05 126.37C1580.22 127.58 1582.35 132.74 1587.01 144.06C1587.92 146.28 1588.93 148.71 1590.09 151.37L1625.87 232.15L1615.94 257.34C1612.07 264 1603.15 264.51 1597.35 263.57C1591.91 262.69 1588.04 260.48 1584.05 256.74L1578.13 273.9C1579.47 283.53 1587.32 289.19 1599.75 289.19C1612.18 289.19 1623.22 283.6 1628.27 271.07L1680.37 144.92C1685.7 131.92 1689.83 127.61 1698.81 125.69L1699.67 125.51V115.6H1646.56L1646.55 115.61Z"></path><path d="M696.14 123.44C695.13 123.76 694.15 124.16 693.23 124.63C683.93 129.36 679.2 138.51 676.84 148.14C671.3 170.66 678.42 201.88 703.8 208.53C706.95 209.35 710.2 209.78 713.45 209.75C728.82 209.58 736.17 201.07 743.49 194.29L747.91 196.72C742.28 219.7 725.78 234.56 699.86 234.56C679.04 234.56 660.57 222.4 652.42 203.23C641.81 178.27 646.13 146.31 665.29 126.59C680.86 110.57 706.87 107.52 727.13 115.38C728.49 115.91 732.05 117.59 734.85 119.57C737.37 121.35 745.02 129.63 744.58 138.62C744.17 147.12 732.21 148.1 729.94 148.18C728.91 148.21 719.75 148.25 719.72 146.67C719.59 139.65 719.82 138.06 717.07 131.4C713.58 122.95 703.98 120.93 696.12 123.44H696.14Z"></path><path d="M927.5 123.33C926.49 123.65 925.51 124.05 924.59 124.52C915.29 129.25 910.57 138.4 908.2 148.03C902.66 170.55 909.78 201.77 935.16 208.42C938.31 209.24 941.56 209.67 944.81 209.64C960.18 209.47 967.52 200.96 974.85 194.18L979.27 196.61C973.64 219.59 957.14 234.45 931.22 234.45C910.4 234.45 891.94 222.29 883.78 203.12C873.16 178.16 877.49 146.2 896.65 126.48C912.22 110.46 938.23 107.41 958.49 115.27C959.85 115.8 963.41 117.48 966.22 119.46C968.74 121.24 976.39 129.52 975.95 138.51C975.54 147.01 963.58 147.99 961.31 148.07C960.28 148.1 951.12 148.14 951.09 146.56C950.96 139.54 951.19 137.95 948.44 131.3C944.95 122.85 935.35 120.83 927.49 123.34L927.5 123.33Z"></path><path d="M215.76 202.77C210.76 196.82 209.36 189.3 213.11 183.58C215.82 179.24 217.35 174.27 217.56 169.16C217.67 160.24 207.23 147 192.67 144.26C183.82 142.61 174.05 142.57 166.48 141.55C145.4 138.76 139.36 130.13 139.36 121.86C139.36 111.79 149.27 109.03 153.44 108.49C170.68 106.35 191.78 118.2 207.01 140.21C197.85 111.9 178.57 98.3999 156.15 91.9899C179.23 93.7799 193.89 104.3 208.98 123.69C197.73 88.26 166.39 78.8799 148.96 77.8799C128.78 76.6999 112.96 81.7199 100.42 97.1399C99.78 97.9099 98.78 99.2599 98.1 100.18C97.58 100.88 97.12 101.62 96.72 102.38C96.22 103.31 95.77 104.28 95.38 105.27C94.1 108.95 93.12 112.73 92.43 116.58C91.41 121.14 89.91 125.58 87.95 129.82C89.16 131.69 90.97 133.08 93.09 133.78C93.09 133.86 91.91 135.83 93.44 140.21C94.47 143.17 96.76 145.19 97.06 148.84C97.33 152.01 94.78 156.92 94.78 156.92C94.78 156.92 101.29 152.69 102.42 148.69C103.37 145.34 101.78 143.71 102.22 140.27C102.41 138.31 103.42 136.53 105.01 135.36C107.56 133.74 110.96 134.48 112.59 137.03C113.38 138.27 113.64 139.76 113.31 141.19C112.37 145.45 108.31 152.93 105.22 160.96C100.72 172.51 103.08 180.43 112.02 191.3C111.52 207.61 106.49 226.16 107.08 230.34C107.36 232.28 108.61 232.93 110.56 233.08H120.75L122.35 226.97C130.1 192 152.21 183.16 173.61 185.89C187.59 187.65 203.62 203.17 202.14 226.14C201.99 228.21 201.29 229.74 201.86 230.99C202.6 232.56 203.8 232.99 205.61 233.12H216.49L218.48 230.51C216.66 227.26 213.99 211 215.73 202.81H215.75L215.76 202.77ZM104.31 117.31C102.5 117.5 100.87 116.2 100.68 114.4C100.49 112.6 101.79 110.97 103.6 110.78C105.41 110.59 107.04 111.89 107.23 113.69C107.42 115.49 106.11 117.11 104.31 117.31Z"></path><path d="M153.22 307.68C68.6 307.68 0 238.81 0 153.84C0 68.87 68.6 0 153.22 0C237.84 0 306.44 68.88 306.44 153.84C306.35 238.77 237.8 307.59 153.22 307.68ZM153.22 28.66C84.37 28.66 28.55 84.71 28.55 153.84C28.55 222.97 84.37 279.02 153.22 279.02C222.07 279.02 277.89 222.97 277.89 153.84C277.82 84.73 222.04 28.74 153.22 28.66Z"></path></svg>
|
| 132 |
+
</a>
|
| 133 |
+
<span></span>
|
| 134 |
+
{% if member %}
|
| 135 |
+
<a class="masthead__account" data-id="header-account-link" href="/account">
|
| 136 |
+
{{ icon_account() }}
|
| 137 |
+
<span class="masthead__account-text">
|
| 138 |
+
<span class="masthead__account-hi">Hi, {{ member.first_name }}!</span>
|
| 139 |
+
<span class="masthead__account-tier">{{ member.tier }}</span>
|
| 140 |
+
</span>
|
| 141 |
+
</a>
|
| 142 |
+
{% else %}
|
| 143 |
+
<a class="masthead__account" data-id="header-account-link" href="/account/signin">
|
| 144 |
+
{{ icon_account() }}
|
| 145 |
+
<span class="masthead__account-text">
|
| 146 |
+
<span class="masthead__account-hi">Sign In</span>
|
| 147 |
+
<span class="masthead__account-tier">For Member Perks</span>
|
| 148 |
+
</span>
|
| 149 |
+
</a>
|
| 150 |
+
{% endif %}
|
| 151 |
+
</header>
|
| 152 |
+
{% endif %}
|
| 153 |
+
|
| 154 |
+
<main id="content" data-id="{{ main_data_id or 'main' }}">
|
| 155 |
+
{% block content %}{% endblock %}
|
| 156 |
+
</main>
|
| 157 |
+
|
| 158 |
+
{% if not bare_chrome %}
|
| 159 |
+
<footer data-id="footer">
|
| 160 |
+
<div class="footer__help" data-id="footer-contact">
|
| 161 |
+
<div class="footer__help-inner">
|
| 162 |
+
<p class="footer__help-heading" data-id="footer-contact-heading">{{ chrome.footer.help_heading }}</p>
|
| 163 |
+
<p class="footer__help-sub">{{ chrome.footer.help_sub }}</p>
|
| 164 |
+
<ul class="footer__contacts">
|
| 165 |
+
{% for c in chrome.footer.contacts %}
|
| 166 |
+
<li>{% if c.href %}<a href="{{ c.href }}">{{ c.label }}</a>
|
| 167 |
+
{% else %}<a href="/service/bc-help-center">{{ c.label }}</a>{% endif %}</li>
|
| 168 |
+
{% endfor %}
|
| 169 |
+
</ul>
|
| 170 |
+
</div>
|
| 171 |
+
</div>
|
| 172 |
+
<div class="footer__cols">
|
| 173 |
+
{% for col in chrome.footer.columns %}
|
| 174 |
+
<section class="footer__col" data-id="footer-section-{{ col.heading | slugify }}">
|
| 175 |
+
<p class="footer__col-heading" data-id="footer-section-heading-{{ col.heading | slugify }}">{{ col.heading }}</p>
|
| 176 |
+
<ul>{% for label, href in col.links %}<li><a href="{{ href }}">{{ label }}</a></li>{% endfor %}</ul>
|
| 177 |
+
</section>
|
| 178 |
+
{% endfor %}
|
| 179 |
+
<section class="footer__col footer__col--signup">
|
| 180 |
+
<form class="footer__form" data-id="emailForm" method="post" action="/subscribe/email">
|
| 181 |
+
<p class="footer__col-heading">{{ chrome.footer.email_signup.heading }}</p>
|
| 182 |
+
<label class="visually-hidden" for="footer-email">{{ chrome.footer.email_signup.placeholder }}</label>
|
| 183 |
+
<div class="footer__form-row">
|
| 184 |
+
<input id="footer-email" name="email" type="email" required
|
| 185 |
+
placeholder="{{ chrome.footer.email_signup.placeholder }}">
|
| 186 |
+
<button type="submit">{{ chrome.footer.email_signup.cta }}</button>
|
| 187 |
+
</div>
|
| 188 |
+
</form>
|
| 189 |
+
<form class="footer__form" data-id="phoneNumberForm" method="post" action="/subscribe/sms">
|
| 190 |
+
<p class="footer__col-heading">{{ chrome.footer.sms_signup.heading }}</p>
|
| 191 |
+
<p class="footer__signup-sub">{{ chrome.footer.sms_signup.sub }}</p>
|
| 192 |
+
<p class="footer__disclaimer">{{ chrome.footer.sms_signup.disclaimer }}</p>
|
| 193 |
+
<label class="visually-hidden" for="footer-phone">{{ chrome.footer.sms_signup.placeholder }}</label>
|
| 194 |
+
<div class="footer__form-row">
|
| 195 |
+
<input id="footer-phone" name="phone" type="tel" required
|
| 196 |
+
placeholder="{{ chrome.footer.sms_signup.placeholder }}">
|
| 197 |
+
<button type="submit">{{ chrome.footer.sms_signup.cta }}</button>
|
| 198 |
+
</div>
|
| 199 |
+
</form>
|
| 200 |
+
</section>
|
| 201 |
+
</div>
|
| 202 |
+
<div class="footer__legal" data-id="footer-legal">
|
| 203 |
+
<span class="logo logo--footer"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1700 308" focusable="false" class="chakra-icon css-qe02r7"><path d="M382.74 231.76V223.37C397.76 221.6 399.53 220.06 399.53 208.13V100.34C399.53 88.4098 397.76 86.8598 382.74 85.0998V76.7098H458.07C492.31 76.7098 511.97 89.7398 511.97 115.36C511.97 137.67 491.65 148.94 470.44 151.15C499.82 152.26 521.25 165.95 521.25 189.8C521.25 217.41 500.49 231.77 461.17 231.77H382.75L382.74 231.76ZM437.08 86.1898V146.49H445.47C465.79 146.49 475.96 136.11 475.96 115.79C475.96 95.4698 464.47 86.1898 445.25 86.1898H437.08ZM437.08 157.32V207.25C437.08 219.18 441.72 222.27 454.31 222.27H456.3C473.97 222.27 484.36 211.22 484.36 189.36C484.36 169.48 473.53 157.33 449.68 157.33H437.09L437.08 157.32Z"></path><path d="M628.37 207.46C628.37 213.87 629.48 218.51 635 218.51C638.31 218.51 641.19 217.63 643.17 216.74L644.5 222.04C637.87 229.55 629.03 233.97 617.55 233.97C605.18 233.97 596.79 226.9 593.92 214.97C587.07 224.25 576.02 233.52 560.12 233.52C541.79 233.52 529.42 222.69 529.42 204.36C529.42 186.03 542.9 177.41 559.02 171.45L593.26 159.3V138.76C593.26 127.27 589.73 119.32 579.56 119.32C570.06 119.32 566.08 126.83 566.08 137.43C566.08 142.07 566.74 146.71 568.07 151.79L546.86 154.66C540.67 152.67 536.48 147.59 536.48 140.08C536.48 120.87 556.36 111.58 581.99 111.58C611.37 111.58 628.38 121.52 628.38 148.91V207.45L628.37 207.46ZM593.24 209V167.91L577.56 174.1C568.95 177.64 563.42 182.05 563.42 194.65C563.42 206.14 568.28 214.31 579.76 214.31C584.84 214.31 588.38 212.32 593.24 209.01V209Z"></path><path d="M763.01 78.2198C763.01 75.0498 764.21 71.4798 750.2 71.5898V63.8298L792.61 51.8398H798.35L798.79 214.75C798.79 222.04 802.32 223.14 812.04 223.81V231.76H750.19V223.81C759.91 223.15 763.44 222.04 763.44 214.75L763 78.2198H763.01ZM835.02 137.88C839.88 133.46 841.87 130.81 841.87 127.94C841.87 123.74 838.34 122.86 828.17 121.75V113.8H876.54V121.75C868.81 123.08 863.95 124.4 858.42 129.92L831.03 155.54L881.17 226.22V231.75H843.84L800.77 169.02L835.01 137.87L835.02 137.88Z"></path><path d="M986.29 175.2C986.29 137.87 1011.25 111.59 1045.71 111.59C1080.17 111.59 1104.91 134.79 1104.91 170.35C1104.91 207.68 1079.73 233.96 1045.27 233.96C1010.81 233.96 986.29 210.76 986.29 175.2ZM1067.14 178.96C1067.14 144.5 1060.73 120.2 1044.61 120.2C1029.81 120.2 1023.84 138.1 1023.84 166.59C1023.84 201.05 1030.25 225.35 1046.38 225.35C1061.18 225.35 1067.14 207.45 1067.14 178.96Z"></path><path d="M1228.55 207.46C1228.55 214.97 1229.17 222.65 1236.91 223.09L1242.25 223.47V231.76H1199.16L1193.23 231.01L1193.21 212.77C1184.6 222.93 1172.89 233.97 1154.33 233.97C1134.67 233.97 1121.64 222.71 1121.64 197.52V141.63C1121.64 134.79 1120.1 130.8 1112.14 129.04L1108.83 128.38V120.87L1152.35 111.81H1158.31L1157.2 138.98V193.54C1157.2 205.91 1161.84 213.2 1173.33 213.2C1181.06 213.2 1186.58 210.33 1193.21 206.79V141.63C1193.21 134.79 1191.67 130.8 1183.72 129.04L1180.41 128.38V120.87L1223.7 111.81H1229.89L1228.57 138.54V207.46H1228.55Z"></path><path d="M1337.86 150.24C1337.86 138.75 1333.67 132.79 1321.95 132.79C1313.77 132.79 1306.26 135.88 1300.08 139.86V214.74C1300.08 222.03 1303.18 223.13 1312.67 223.8V231.75H1251.48V223.8C1260.98 223.14 1264.51 222.03 1264.51 214.74V136.76L1251.7 129.03V123.95L1294.33 111.58H1300.96L1300.08 133.45C1308.92 122.62 1321.51 111.58 1340.95 111.58C1361.93 111.58 1373.42 123.51 1373.42 147.58V214.73C1373.42 222.02 1376.96 223.12 1386.45 223.79V231.74H1325.26V223.79C1334.76 223.13 1337.85 222.02 1337.85 214.73V150.23L1337.86 150.24Z"></path><path d="M1436.09 113.8H1463.48V124.85H1436.09V197.97C1436.09 210.12 1440.73 215.2 1450.23 215.2C1455.97 215.2 1461.05 213.21 1466.36 209.24L1469.45 213.66C1461.72 226.03 1450.01 233.98 1433.22 233.98C1414.22 233.98 1400.53 224.26 1400.53 198.86V124.86H1387.28V118.67C1403.62 111.83 1418.21 99.2299 1428.58 84.4299H1436.09V113.81V113.8Z"></path><path d="M1521.36 212.1C1521.36 221.38 1526.21 222.48 1539.47 223.81V231.76H1472.76V223.81C1482.26 223.15 1485.79 222.04 1485.79 214.75V136.77L1472.98 129.04V123.96L1515.61 111.59H1522.24L1521.36 144.94C1531.08 119.98 1538.15 111.59 1551.62 111.59C1556.48 111.59 1560.01 113.13 1562 115.35V142.3H1557.36C1543.45 142.3 1531.96 142.96 1521.36 152.46V212.1Z"></path><path d="M1646.55 115.61V125.38L1647.51 125.49C1655.97 126.46 1660.25 129.59 1660.25 134.8C1660.25 136.29 1659.76 137.84 1659.2 139.33L1642.68 190.11L1621.7 135.12C1621.28 133.87 1621.09 132.89 1621.09 131.93C1621.09 128.62 1623.97 126.52 1629.66 125.71L1630.59 125.57V115.61H1570.11V126.25L1571.05 126.37C1580.22 127.58 1582.35 132.74 1587.01 144.06C1587.92 146.28 1588.93 148.71 1590.09 151.37L1625.87 232.15L1615.94 257.34C1612.07 264 1603.15 264.51 1597.35 263.57C1591.91 262.69 1588.04 260.48 1584.05 256.74L1578.13 273.9C1579.47 283.53 1587.32 289.19 1599.75 289.19C1612.18 289.19 1623.22 283.6 1628.27 271.07L1680.37 144.92C1685.7 131.92 1689.83 127.61 1698.81 125.69L1699.67 125.51V115.6H1646.56L1646.55 115.61Z"></path><path d="M696.14 123.44C695.13 123.76 694.15 124.16 693.23 124.63C683.93 129.36 679.2 138.51 676.84 148.14C671.3 170.66 678.42 201.88 703.8 208.53C706.95 209.35 710.2 209.78 713.45 209.75C728.82 209.58 736.17 201.07 743.49 194.29L747.91 196.72C742.28 219.7 725.78 234.56 699.86 234.56C679.04 234.56 660.57 222.4 652.42 203.23C641.81 178.27 646.13 146.31 665.29 126.59C680.86 110.57 706.87 107.52 727.13 115.38C728.49 115.91 732.05 117.59 734.85 119.57C737.37 121.35 745.02 129.63 744.58 138.62C744.17 147.12 732.21 148.1 729.94 148.18C728.91 148.21 719.75 148.25 719.72 146.67C719.59 139.65 719.82 138.06 717.07 131.4C713.58 122.95 703.98 120.93 696.12 123.44H696.14Z"></path><path d="M927.5 123.33C926.49 123.65 925.51 124.05 924.59 124.52C915.29 129.25 910.57 138.4 908.2 148.03C902.66 170.55 909.78 201.77 935.16 208.42C938.31 209.24 941.56 209.67 944.81 209.64C960.18 209.47 967.52 200.96 974.85 194.18L979.27 196.61C973.64 219.59 957.14 234.45 931.22 234.45C910.4 234.45 891.94 222.29 883.78 203.12C873.16 178.16 877.49 146.2 896.65 126.48C912.22 110.46 938.23 107.41 958.49 115.27C959.85 115.8 963.41 117.48 966.22 119.46C968.74 121.24 976.39 129.52 975.95 138.51C975.54 147.01 963.58 147.99 961.31 148.07C960.28 148.1 951.12 148.14 951.09 146.56C950.96 139.54 951.19 137.95 948.44 131.3C944.95 122.85 935.35 120.83 927.49 123.34L927.5 123.33Z"></path><path d="M215.76 202.77C210.76 196.82 209.36 189.3 213.11 183.58C215.82 179.24 217.35 174.27 217.56 169.16C217.67 160.24 207.23 147 192.67 144.26C183.82 142.61 174.05 142.57 166.48 141.55C145.4 138.76 139.36 130.13 139.36 121.86C139.36 111.79 149.27 109.03 153.44 108.49C170.68 106.35 191.78 118.2 207.01 140.21C197.85 111.9 178.57 98.3999 156.15 91.9899C179.23 93.7799 193.89 104.3 208.98 123.69C197.73 88.26 166.39 78.8799 148.96 77.8799C128.78 76.6999 112.96 81.7199 100.42 97.1399C99.78 97.9099 98.78 99.2599 98.1 100.18C97.58 100.88 97.12 101.62 96.72 102.38C96.22 103.31 95.77 104.28 95.38 105.27C94.1 108.95 93.12 112.73 92.43 116.58C91.41 121.14 89.91 125.58 87.95 129.82C89.16 131.69 90.97 133.08 93.09 133.78C93.09 133.86 91.91 135.83 93.44 140.21C94.47 143.17 96.76 145.19 97.06 148.84C97.33 152.01 94.78 156.92 94.78 156.92C94.78 156.92 101.29 152.69 102.42 148.69C103.37 145.34 101.78 143.71 102.22 140.27C102.41 138.31 103.42 136.53 105.01 135.36C107.56 133.74 110.96 134.48 112.59 137.03C113.38 138.27 113.64 139.76 113.31 141.19C112.37 145.45 108.31 152.93 105.22 160.96C100.72 172.51 103.08 180.43 112.02 191.3C111.52 207.61 106.49 226.16 107.08 230.34C107.36 232.28 108.61 232.93 110.56 233.08H120.75L122.35 226.97C130.1 192 152.21 183.16 173.61 185.89C187.59 187.65 203.62 203.17 202.14 226.14C201.99 228.21 201.29 229.74 201.86 230.99C202.6 232.56 203.8 232.99 205.61 233.12H216.49L218.48 230.51C216.66 227.26 213.99 211 215.73 202.81H215.75L215.76 202.77ZM104.31 117.31C102.5 117.5 100.87 116.2 100.68 114.4C100.49 112.6 101.79 110.97 103.6 110.78C105.41 110.59 107.04 111.89 107.23 113.69C107.42 115.49 106.11 117.11 104.31 117.31Z"></path><path d="M153.22 307.68C68.6 307.68 0 238.81 0 153.84C0 68.87 68.6 0 153.22 0C237.84 0 306.44 68.88 306.44 153.84C306.35 238.77 237.8 307.59 153.22 307.68ZM153.22 28.66C84.37 28.66 28.55 84.71 28.55 153.84C28.55 222.97 84.37 279.02 153.22 279.02C222.07 279.02 277.89 222.97 277.89 153.84C277.82 84.73 222.04 28.74 153.22 28.66Z"></path></svg></span>
|
| 204 |
+
<p data-id="footer-copyright">{{ chrome.footer.copyright }}</p>
|
| 205 |
+
<p class="footer__legal-links">
|
| 206 |
+
{% for label, href in chrome.footer.legal %}<a href="{{ href }}">{{ label }}</a>{% endfor %}
|
| 207 |
+
</p>
|
| 208 |
+
</div>
|
| 209 |
+
</footer>
|
| 210 |
+
{% else %}
|
| 211 |
+
<footer class="footer--simple" data-id="footer">
|
| 212 |
+
<p class="footer__legal-links">
|
| 213 |
+
{% for label, href in chrome.footer.legal %}<a href="{{ href }}">{{ label }}</a>{% endfor %}
|
| 214 |
+
</p>
|
| 215 |
+
<p data-id="footer-copyright">{{ chrome.footer.copyright }}</p>
|
| 216 |
+
</footer>
|
| 217 |
+
{% endif %}
|
| 218 |
+
|
| 219 |
+
<script src="{{ static_version('/static/js/site.js') }}" defer></script>
|
| 220 |
+
</body>
|
| 221 |
+
</html>
|
tasks/backcountry/environment/reference/clone/frontend/templates/brands.html
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
{% block title %}Shop All Brands | Backcountry.com{% endblock %}
|
| 3 |
+
{% block content %}
|
| 4 |
+
<div class="page">
|
| 5 |
+
<h1 class="plp__head">Shop All Brands</h1>
|
| 6 |
+
<div class="flyout__cols">
|
| 7 |
+
{% for b in brands %}
|
| 8 |
+
<div class="flyout__col"><a href="/brand/{{ b.slug }}">{{ b.name }}</a>
|
| 9 |
+
<span class="count"> ({{ b.slugs | length }})</span></div>
|
| 10 |
+
{% endfor %}
|
| 11 |
+
</div>
|
| 12 |
+
</div>
|
| 13 |
+
{% endblock %}
|
tasks/backcountry/environment/reference/clone/frontend/templates/cart.html
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
{% block title %}My Cart | Backcountry.com{% endblock %}
|
| 3 |
+
{% block content %}
|
| 4 |
+
<div class="page">
|
| 5 |
+
<div class="cart__tabs">
|
| 6 |
+
<a class="cart__tab{% if tab != 'wishlist' %} is-active{% endif %}" data-id="cart-tab" href="/cart">
|
| 7 |
+
Cart (<span data-id="cart-tab-count">{{ lines | map(attribute='quantity') | sum }}</span>)</a>
|
| 8 |
+
<a class="cart__tab{% if tab == 'wishlist' %} is-active{% endif %}" data-id="cart-wishlist-tab" href="/cart?tab=wishlist">
|
| 9 |
+
Wish List (<span data-id="cart-wishlist-count">{{ wishlist | length }}</span>)</a>
|
| 10 |
+
</div>
|
| 11 |
+
|
| 12 |
+
{% if tab == 'wishlist' %}
|
| 13 |
+
<h1 class="plp__head">Wish List</h1>
|
| 14 |
+
{% if wishlist %}
|
| 15 |
+
<div class="grid" data-id="cart-wishlist-model">
|
| 16 |
+
{% from "_tile.html" import tile %}
|
| 17 |
+
{% for item in wishlist %}{{ tile(item.product) }}{% endfor %}
|
| 18 |
+
</div>
|
| 19 |
+
{% else %}
|
| 20 |
+
<div class="emptystate"><h2>Your wish list is empty.</h2>
|
| 21 |
+
<p><a class="btn btn--secondary btn--sm" href="/cat/travel">Continue Shopping</a></p></div>
|
| 22 |
+
{% endif %}
|
| 23 |
+
|
| 24 |
+
{% elif lines %}
|
| 25 |
+
<div class="cart">
|
| 26 |
+
<div>
|
| 27 |
+
<h1 class="plp__head">My Cart</h1>
|
| 28 |
+
{% for line in lines %}
|
| 29 |
+
<div class="cart__line" data-id="cart-line">
|
| 30 |
+
<a href="{{ line.product_slug }}"><img src="{{ line.image }}" alt="{{ line.product.title if line.product }}" width="120" height="120"></a>
|
| 31 |
+
<div>
|
| 32 |
+
<p class="cart__line-brand">{{ line.product.brand if line.product }}</p>
|
| 33 |
+
<p class="cart__line-title"><a href="{{ line.product_slug }}">{{ line.product.title if line.product else line.product_slug }}</a></p>
|
| 34 |
+
<p class="cart__line-variant">Color: {{ line.color }}{% if line.size %} | Size: {{ line.size }}{% endif %}</p>
|
| 35 |
+
<p class="cart__line-variant">Item #{{ line.sku_id }}</p>
|
| 36 |
+
<div class="cart__line-actions">
|
| 37 |
+
<form method="post" action="/cart/update" class="qty">
|
| 38 |
+
<input type="hidden" name="sku" value="{{ line.sku_id }}">
|
| 39 |
+
<label class="visually-hidden" for="qty-{{ loop.index }}">Quantity</label>
|
| 40 |
+
<input id="qty-{{ loop.index }}" name="quantity" type="number" min="0" max="10" value="{{ line.quantity }}">
|
| 41 |
+
<button class="btn btn--secondary btn--sm" type="submit">Update</button>
|
| 42 |
+
</form>
|
| 43 |
+
<form method="post" action="/cart/remove">
|
| 44 |
+
<input type="hidden" name="sku" value="{{ line.sku_id }}">
|
| 45 |
+
<button type="submit">Remove</button>
|
| 46 |
+
</form>
|
| 47 |
+
<form method="post" action="/wishlist/toggle">
|
| 48 |
+
<input type="hidden" name="product" value="{{ line.product_slug }}">
|
| 49 |
+
<input type="hidden" name="color" value="{{ line.color }}">
|
| 50 |
+
<input type="hidden" name="back" value="/cart">
|
| 51 |
+
<button type="submit">Move To Wish List</button>
|
| 52 |
+
</form>
|
| 53 |
+
</div>
|
| 54 |
+
</div>
|
| 55 |
+
<div class="cart__line-price">
|
| 56 |
+
{{ line.line_total | money }}
|
| 57 |
+
{% if line.list_price > line.unit_price %}
|
| 58 |
+
<div class="tile__brand"><s>{{ (line.list_price * line.quantity) | money }}</s></div>
|
| 59 |
+
{% endif %}
|
| 60 |
+
</div>
|
| 61 |
+
</div>
|
| 62 |
+
{% endfor %}
|
| 63 |
+
</div>
|
| 64 |
+
|
| 65 |
+
<aside class="summary" data-id="order-summary">
|
| 66 |
+
<h2>Order Summary</h2>
|
| 67 |
+
<div class="summary__row"><span>Subtotal</span><span>{{ totals.subtotal | money }}</span></div>
|
| 68 |
+
{% if totals.savings %}
|
| 69 |
+
<div class="summary__row"><span>You Save</span><span>−{{ totals.savings | money }}</span></div>
|
| 70 |
+
{% endif %}
|
| 71 |
+
<div class="summary__row"><span>Shipping</span>
|
| 72 |
+
<span>{{ 'Free' if totals.shipping == 0 else totals.shipping | money }}</span></div>
|
| 73 |
+
<div class="summary__row"><span>Estimated Tax</span><span>{{ totals.tax | money }}</span></div>
|
| 74 |
+
<div class="summary__total"><span>Estimated Total</span><span>{{ totals.total | money }}</span></div>
|
| 75 |
+
{% if totals.shipping %}
|
| 76 |
+
<p class="footer__disclaimer">Add {{ (free_shipping_threshold - totals.subtotal) | money }} more for free shipping.</p>
|
| 77 |
+
{% endif %}
|
| 78 |
+
<a class="btn btn--block" href="/checkout">Checkout</a>
|
| 79 |
+
<a class="btn btn--secondary btn--block btn--sm" href="/cat/travel" style="margin-top:8px">Continue Shopping</a>
|
| 80 |
+
</aside>
|
| 81 |
+
</div>
|
| 82 |
+
|
| 83 |
+
{% else %}
|
| 84 |
+
<div class="emptystate" data-id="empty-cart">
|
| 85 |
+
<h2>My Cart</h2>
|
| 86 |
+
<p>Your cart is currently empty.</p>
|
| 87 |
+
<p><strong>Want to shop?</strong></p>
|
| 88 |
+
<p>This is the perfect opportunity to shop for the gear you've been wanting.</p>
|
| 89 |
+
<p><a class="btn btn--secondary btn--sm" href="/cat/travel">Continue Shopping</a></p>
|
| 90 |
+
</div>
|
| 91 |
+
{% endif %}
|
| 92 |
+
</div>
|
| 93 |
+
{% endblock %}
|
tasks/backcountry/environment/reference/clone/frontend/templates/checkout.html
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
{% block title %}Checkout | Backcountry.com{% endblock %}
|
| 3 |
+
{% block content %}
|
| 4 |
+
<div class="page">
|
| 5 |
+
<h1 class="plp__head">Checkout</h1>
|
| 6 |
+
<div class="cart">
|
| 7 |
+
<div>
|
| 8 |
+
<div class="card">
|
| 9 |
+
<h2>1. Shipping Address</h2>
|
| 10 |
+
{% if addresses %}
|
| 11 |
+
{% for a in addresses %}
|
| 12 |
+
<p class="cart__line-variant">{{ a.recipient }} — {{ a.line1 }}{% if a.line2 %}, {{ a.line2 }}{% endif %},
|
| 13 |
+
{{ a.city }}, {{ a.region }} {{ a.postal_code }}{% if a.is_default %} (Default){% endif %}</p>
|
| 14 |
+
{% endfor %}
|
| 15 |
+
{% else %}
|
| 16 |
+
<p class="cart__line-variant">Sign in to use a saved address.</p>
|
| 17 |
+
{% endif %}
|
| 18 |
+
</div>
|
| 19 |
+
<div class="card">
|
| 20 |
+
<h2>2. Delivery</h2>
|
| 21 |
+
<p class="cart__line-variant">Standard Ground —
|
| 22 |
+
{{ 'Free on orders over $69' if totals.shipping == 0 else totals.shipping | money }}</p>
|
| 23 |
+
</div>
|
| 24 |
+
<div class="card">
|
| 25 |
+
<h2>3. Payment</h2>
|
| 26 |
+
<p class="alert alert--info" role="note">
|
| 27 |
+
This offline clone stops at the checkout entry. Order submission and payment are outside its
|
| 28 |
+
frozen scope, so no order can be placed and no payment is processed here.
|
| 29 |
+
</p>
|
| 30 |
+
</div>
|
| 31 |
+
</div>
|
| 32 |
+
<aside class="summary">
|
| 33 |
+
<h2>Order Summary</h2>
|
| 34 |
+
<div class="summary__row"><span>Items</span><span>{{ line_count }}</span></div>
|
| 35 |
+
<div class="summary__row"><span>Subtotal</span><span>{{ totals.subtotal | money }}</span></div>
|
| 36 |
+
<div class="summary__row"><span>Shipping</span>
|
| 37 |
+
<span>{{ 'Free' if totals.shipping == 0 else totals.shipping | money }}</span></div>
|
| 38 |
+
<div class="summary__row"><span>Estimated Tax</span><span>{{ totals.tax | money }}</span></div>
|
| 39 |
+
<div class="summary__total"><span>Estimated Total</span><span>{{ totals.total | money }}</span></div>
|
| 40 |
+
<a class="btn btn--secondary btn--block btn--sm" href="/cart" style="margin-top:12px">Back To Cart</a>
|
| 41 |
+
</aside>
|
| 42 |
+
</div>
|
| 43 |
+
</div>
|
| 44 |
+
{% endblock %}
|
tasks/backcountry/environment/reference/clone/frontend/templates/forgot_password.html
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
{% block title %}Reset Password | Backcountry.com{% endblock %}
|
| 3 |
+
{% block content %}
|
| 4 |
+
<div class="page">
|
| 5 |
+
<h1 class="plp__head">Reset Password</h1>
|
| 6 |
+
{% if stage == 'reset' %}
|
| 7 |
+
<form class="form" method="post" action="/account/reset-password">
|
| 8 |
+
<p>Enter the code we sent to your email address and choose a new password.</p>
|
| 9 |
+
{% if errors.code %}<p class="alert alert--error" role="alert" data-id="reset-error">{{ errors.code }}</p>{% endif %}
|
| 10 |
+
<div class="form__field">
|
| 11 |
+
<label for="code">Reset Code</label>
|
| 12 |
+
<input id="code" name="code" inputmode="numeric" autocomplete="one-time-code" required
|
| 13 |
+
aria-invalid="{{ 'true' if errors.code else 'false' }}">
|
| 14 |
+
</div>
|
| 15 |
+
<div class="form__field">
|
| 16 |
+
<label for="password">New Password</label>
|
| 17 |
+
<input id="password" name="password" type="password" autocomplete="new-password" required>
|
| 18 |
+
</div>
|
| 19 |
+
<button class="btn btn--block" type="submit">Set New Password</button>
|
| 20 |
+
</form>
|
| 21 |
+
{% else %}
|
| 22 |
+
<form class="form" method="post" action="/account/forgot-password">
|
| 23 |
+
<p>Enter the email address on your account and we'll send a reset code.</p>
|
| 24 |
+
{% if errors.email %}<p class="alert alert--error" role="alert" data-id="forgot-error">{{ errors.email }}</p>{% endif %}
|
| 25 |
+
<div class="form__field">
|
| 26 |
+
<label for="email">Email Address</label>
|
| 27 |
+
<input id="email" name="email" type="email" autocomplete="username" required
|
| 28 |
+
aria-invalid="{{ 'true' if errors.email else 'false' }}">
|
| 29 |
+
</div>
|
| 30 |
+
<button class="btn btn--block" type="submit">Send Reset Code</button>
|
| 31 |
+
</form>
|
| 32 |
+
{% endif %}
|
| 33 |
+
</div>
|
| 34 |
+
{% endblock %}
|
tasks/backcountry/environment/reference/clone/frontend/templates/home.html
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
{% from "_tile.html" import tile %}
|
| 3 |
+
{% block content %}
|
| 4 |
+
<div class="home" data-id="home">
|
| 5 |
+
{% for s in home.sections %}
|
| 6 |
+
|
| 7 |
+
{% if s.kind == 'text-banner' %}
|
| 8 |
+
<a class="home__textbanner" data-id="cmsTextBanner" href="{{ s.href }}">
|
| 9 |
+
<div data-id="text-banner">
|
| 10 |
+
<strong>{{ s.heading }}</strong>
|
| 11 |
+
<span>{{ s.sub }}</span>
|
| 12 |
+
</div>
|
| 13 |
+
</a>
|
| 14 |
+
|
| 15 |
+
{% elif s.kind == 'hero' %}
|
| 16 |
+
<a class="home__hero" data-id="cmsOverlayHero" href="{{ s.href }}">
|
| 17 |
+
<img src="{{ s.file }}" alt="{{ s.alt }}" width="{{ s.imageWidth }}" height="{{ s.imageHeight }}">
|
| 18 |
+
</a>
|
| 19 |
+
|
| 20 |
+
{% elif s.kind == 'carousel' %}
|
| 21 |
+
<section class="home__carousel" data-id="cmsCarousel">
|
| 22 |
+
<div class="home__carousel-head">
|
| 23 |
+
{% if s.heading %}<h2>{{ s.heading }}</h2>{% endif %}
|
| 24 |
+
{% if s.arrows %}
|
| 25 |
+
<div class="home__arrows">
|
| 26 |
+
<button type="button" class="home__arrow" data-id="left-arrow" aria-label="Arrow left"
|
| 27 |
+
data-carousel-prev disabled>
|
| 28 |
+
<svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true">
|
| 29 |
+
<path d="M15 4 L7 12 L15 20" fill="none" stroke="currentColor" stroke-width="2"/>
|
| 30 |
+
</svg>
|
| 31 |
+
</button>
|
| 32 |
+
<button type="button" class="home__arrow" data-id="right-arrow" aria-label="Arrow right"
|
| 33 |
+
data-carousel-next>
|
| 34 |
+
<svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true">
|
| 35 |
+
<path d="M9 4 L17 12 L9 20" fill="none" stroke="currentColor" stroke-width="2"/>
|
| 36 |
+
</svg>
|
| 37 |
+
</button>
|
| 38 |
+
</div>
|
| 39 |
+
{% endif %}
|
| 40 |
+
</div>
|
| 41 |
+
<div class="home__carousel-track" data-id="carousel">
|
| 42 |
+
{% for c in s.cards %}
|
| 43 |
+
<div class="home__carousel-item" data-id="cmsCarouselItem" style="flex-basis: {{ c.width }}px">
|
| 44 |
+
<a class="home__card" data-id="cmsCard" href="{{ c.href }}">
|
| 45 |
+
{% if c.file %}
|
| 46 |
+
<img src="{{ c.file }}" alt="{{ c.alt }}" loading="lazy"
|
| 47 |
+
width="{{ c.imageWidth }}" height="{{ c.imageHeight }}">
|
| 48 |
+
{% endif %}
|
| 49 |
+
{% if c.title %}<p class="home__card-title">{{ c.title }}</p>{% endif %}
|
| 50 |
+
{% if c.subtitle and c.subtitle != c.title %}<p class="home__card-sub">{{ c.subtitle }}</p>{% endif %}
|
| 51 |
+
</a>
|
| 52 |
+
</div>
|
| 53 |
+
{% endfor %}
|
| 54 |
+
</div>
|
| 55 |
+
</section>
|
| 56 |
+
|
| 57 |
+
{% elif s.kind == 'shelf' %}
|
| 58 |
+
{# Source renders this as one horizontal row of product tiles, not a grid. #}
|
| 59 |
+
<section class="shelf" data-id="cmsCuratedCollection">
|
| 60 |
+
<div class="home__carousel-head">
|
| 61 |
+
{% if s.heading %}<h2>{{ s.heading }}</h2>{% endif %}
|
| 62 |
+
<div class="home__arrows">
|
| 63 |
+
<button type="button" class="home__arrow" data-id="left-arrow" aria-label="Arrow left"
|
| 64 |
+
data-carousel-prev disabled>
|
| 65 |
+
<svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true">
|
| 66 |
+
<path d="M15 4 L7 12 L15 20" fill="none" stroke="currentColor" stroke-width="2"/>
|
| 67 |
+
</svg>
|
| 68 |
+
</button>
|
| 69 |
+
<button type="button" class="home__arrow" data-id="right-arrow" aria-label="Arrow right"
|
| 70 |
+
data-carousel-next>
|
| 71 |
+
<svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true">
|
| 72 |
+
<path d="M9 4 L17 12 L9 20" fill="none" stroke="currentColor" stroke-width="2"/>
|
| 73 |
+
</svg>
|
| 74 |
+
</button>
|
| 75 |
+
</div>
|
| 76 |
+
</div>
|
| 77 |
+
<div class="shelf__track" data-id="carousel">
|
| 78 |
+
{% for p in shelf_products %}
|
| 79 |
+
<div class="shelf__item" data-id="cmsCarouselItem">{{ tile(p) }}</div>
|
| 80 |
+
{% endfor %}
|
| 81 |
+
</div>
|
| 82 |
+
</section>
|
| 83 |
+
|
| 84 |
+
{% elif s.kind == 'grid' %}
|
| 85 |
+
<section class="home__grid" data-id="cmsGrid">
|
| 86 |
+
{% for c in s.cards %}
|
| 87 |
+
<a class="home__grid-card" data-id="cmsCard" href="{{ c.href }}">
|
| 88 |
+
{% if c.file %}
|
| 89 |
+
<img src="{{ c.file }}" alt="{{ c.alt }}" loading="lazy"
|
| 90 |
+
width="{{ c.imageWidth or 380 }}" height="{{ c.imageHeight or 190 }}">
|
| 91 |
+
{% endif %}
|
| 92 |
+
{% if c.title %}<p class="home__card-title">{{ c.title }}</p>{% endif %}
|
| 93 |
+
{% if c.subtitle and c.subtitle != c.title %}<p class="home__card-sub">{{ c.subtitle }}</p>{% endif %}
|
| 94 |
+
</a>
|
| 95 |
+
{% endfor %}
|
| 96 |
+
</section>
|
| 97 |
+
{% endif %}
|
| 98 |
+
|
| 99 |
+
{% endfor %}
|
| 100 |
+
</div>
|
| 101 |
+
{% endblock %}
|
tasks/backcountry/environment/reference/clone/frontend/templates/informational.html
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
{% block title %}{{ page_title }} | Backcountry.com{% endblock %}
|
| 3 |
+
{% block content %}
|
| 4 |
+
<div class="page">
|
| 5 |
+
<nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span>{{ page_title }}</nav>
|
| 6 |
+
<h1 class="plp__head">{{ page_title }}</h1>
|
| 7 |
+
<div class="card" style="max-width:760px" data-id="out-of-capture-scope">
|
| 8 |
+
<h2>Outside the captured scope</h2>
|
| 9 |
+
<p class="cart__line-variant">
|
| 10 |
+
This offline clone reproduces the Travel shopping experience. The source page at
|
| 11 |
+
<code>{{ page_path }}</code> is a real first-party route and its link is reproduced here, but its
|
| 12 |
+
content was never captured, so nothing is shown in its place rather than inventing copy.
|
| 13 |
+
</p>
|
| 14 |
+
<p class="cart__line-variant">
|
| 15 |
+
<a class="btn btn--secondary btn--sm" href="/cat/travel">Shop Travel</a>
|
| 16 |
+
</p>
|
| 17 |
+
</div>
|
| 18 |
+
</div>
|
| 19 |
+
{% endblock %}
|
tasks/backcountry/environment/reference/clone/frontend/templates/order_detail.html
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
{% from "_account_nav.html" import account_nav %}
|
| 3 |
+
{% block title %}Order {{ order.order_number }} | Backcountry.com{% endblock %}
|
| 4 |
+
{% block content %}
|
| 5 |
+
<div class="page">
|
| 6 |
+
<nav class="breadcrumbs"><a href="/account/order-history">Order History</a><span>/</span>{{ order.order_number }}</nav>
|
| 7 |
+
<h1 class="plp__head">Order {{ order.order_number }}</h1>
|
| 8 |
+
<div class="account">
|
| 9 |
+
{{ account_nav(account_section) }}
|
| 10 |
+
<div>
|
| 11 |
+
<div class="card">
|
| 12 |
+
<div class="order__head">
|
| 13 |
+
<div><span>Order Placed</span>{{ order.placed_on }}</div>
|
| 14 |
+
<div><span>Status</span>{{ order.status }}</div>
|
| 15 |
+
<div><span>Ship To</span>{{ order.ship_to }}</div>
|
| 16 |
+
</div>
|
| 17 |
+
{% if address %}
|
| 18 |
+
<p class="cart__line-variant">{{ address.recipient }}, {{ address.line1 }}{% if address.line2 %}, {{ address.line2 }}{% endif %},
|
| 19 |
+
{{ address.city }}, {{ address.region }} {{ address.postal_code }}</p>
|
| 20 |
+
{% endif %}
|
| 21 |
+
</div>
|
| 22 |
+
<div class="card">
|
| 23 |
+
{% for line in order.lines %}
|
| 24 |
+
<div class="cart__line">
|
| 25 |
+
<a href="{{ line.product_slug }}"><img src="{{ line.product.mainImage if line.product }}" alt="" width="120" height="120"></a>
|
| 26 |
+
<div>
|
| 27 |
+
<p class="cart__line-brand">{{ line.product.brand if line.product }}</p>
|
| 28 |
+
<p class="cart__line-title"><a href="{{ line.product_slug }}">{{ line.product.title if line.product else line.product_slug }}</a></p>
|
| 29 |
+
<p class="cart__line-variant">Color: {{ line.color }}{% if line.size %} | Size: {{ line.size }}{% endif %} | Qty {{ line.quantity }}</p>
|
| 30 |
+
</div>
|
| 31 |
+
<div class="cart__line-price">{{ (line.unit_price * line.quantity) | money }}</div>
|
| 32 |
+
</div>
|
| 33 |
+
{% endfor %}
|
| 34 |
+
<div class="summary__row" style="margin-top:16px"><span>Subtotal</span><span>{{ order.subtotal | money }}</span></div>
|
| 35 |
+
<div class="summary__row"><span>Shipping</span><span>{{ 'Free' if order.shipping == 0 else order.shipping | money }}</span></div>
|
| 36 |
+
<div class="summary__row"><span>Tax</span><span>{{ order.tax | money }}</span></div>
|
| 37 |
+
<div class="summary__total"><span>Total</span><span>{{ order.total | money }}</span></div>
|
| 38 |
+
</div>
|
| 39 |
+
</div>
|
| 40 |
+
</div>
|
| 41 |
+
</div>
|
| 42 |
+
{% endblock %}
|
tasks/backcountry/environment/reference/clone/frontend/templates/orders.html
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
{% from "_account_nav.html" import account_nav %}
|
| 3 |
+
{% block title %}Order History | Backcountry.com{% endblock %}
|
| 4 |
+
{% block content %}
|
| 5 |
+
<div class="page">
|
| 6 |
+
<h1 class="plp__head">Order History</h1>
|
| 7 |
+
<div class="account">
|
| 8 |
+
{{ account_nav(account_section) }}
|
| 9 |
+
<div>
|
| 10 |
+
{% if orders %}
|
| 11 |
+
{% for o in orders %}
|
| 12 |
+
<div class="card">
|
| 13 |
+
<div class="order__head">
|
| 14 |
+
<div><span>Order Placed</span>{{ o.placed_on }}</div>
|
| 15 |
+
<div><span>Total</span>{{ o.total | money }}</div>
|
| 16 |
+
<div><span>Ship To</span>{{ o.ship_to }}</div>
|
| 17 |
+
<div><span>Order #</span><a href="/account/orders/{{ o.order_number }}">{{ o.order_number }}</a></div>
|
| 18 |
+
<div><span>Status</span>{{ o.status }}</div>
|
| 19 |
+
</div>
|
| 20 |
+
{% for line in o.lines %}
|
| 21 |
+
<div class="cart__line">
|
| 22 |
+
<a href="{{ line.product_slug }}">
|
| 23 |
+
<img src="{{ line.product.mainImage if line.product }}" alt="" width="120" height="120"></a>
|
| 24 |
+
<div>
|
| 25 |
+
<p class="cart__line-brand">{{ line.product.brand if line.product }}</p>
|
| 26 |
+
<p class="cart__line-title"><a href="{{ line.product_slug }}">{{ line.product.title if line.product else line.product_slug }}</a></p>
|
| 27 |
+
<p class="cart__line-variant">Color: {{ line.color }}{% if line.size %} | Size: {{ line.size }}{% endif %} | Qty {{ line.quantity }}</p>
|
| 28 |
+
</div>
|
| 29 |
+
<div class="cart__line-price">{{ (line.unit_price * line.quantity) | money }}</div>
|
| 30 |
+
</div>
|
| 31 |
+
{% endfor %}
|
| 32 |
+
</div>
|
| 33 |
+
{% endfor %}
|
| 34 |
+
{% else %}
|
| 35 |
+
<div class="emptystate"><h2>You have no orders yet.</h2>
|
| 36 |
+
<p><a class="btn btn--secondary btn--sm" href="/cat/travel">Start Shopping</a></p></div>
|
| 37 |
+
{% endif %}
|
| 38 |
+
</div>
|
| 39 |
+
</div>
|
| 40 |
+
</div>
|
| 41 |
+
{% endblock %}
|
tasks/backcountry/environment/reference/clone/frontend/templates/pdp.html
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
{% block title %}{{ product.brand }} {{ product.title }} - {{ product.breadcrumbs[0].name if product.breadcrumbs else 'Travel' }}{% endblock %}
|
| 3 |
+
{% block content %}
|
| 4 |
+
<div class="page" data-id="pdp">
|
| 5 |
+
<nav class="breadcrumbs" data-id="categoryBreadcrumbs" aria-label="Breadcrumb">
|
| 6 |
+
{% for b in product.breadcrumbs %}{% if not loop.first %}<span>/</span>{% endif %}<a href="{{ b.url }}">{{ b.name }}</a>{% endfor %}
|
| 7 |
+
</nav>
|
| 8 |
+
|
| 9 |
+
{% if error == 'unavailable' %}
|
| 10 |
+
<p class="alert alert--error" role="alert">That colour and size combination is not available. Choose another option.</p>
|
| 11 |
+
{% endif %}
|
| 12 |
+
|
| 13 |
+
<div class="pdp">
|
| 14 |
+
<div class="pdp__media" data-id="mediaGallery">
|
| 15 |
+
<div class="pdp__thumbs" data-id="thumbnailStrip">
|
| 16 |
+
{% for img in gallery[:8] %}
|
| 17 |
+
<button class="pdp__thumb{% if loop.first %} is-selected{% endif %}" type="button"
|
| 18 |
+
data-id="thumbnailImage" data-image="{{ img }}" aria-label="View image {{ loop.index }}">
|
| 19 |
+
<img src="{{ img }}" alt="" loading="lazy" width="88" height="88">
|
| 20 |
+
</button>
|
| 21 |
+
{% endfor %}
|
| 22 |
+
</div>
|
| 23 |
+
|
| 24 |
+
<div class="pdp__main" data-id="mainImage">
|
| 25 |
+
{% if product.badge %}
|
| 26 |
+
<div class="pdp__badge" data-id="productBadge">
|
| 27 |
+
<img src="/static/assets/brand/gearhead-top-pick.svg" alt="{{ product.badge }}" height="52">
|
| 28 |
+
</div>
|
| 29 |
+
{% endif %}
|
| 30 |
+
<img id="pdp-main-image" src="{{ gallery[0] if gallery else product.mainImage }}"
|
| 31 |
+
alt="{{ product.title }}" width="600" height="600">
|
| 32 |
+
</div>
|
| 33 |
+
</div>
|
| 34 |
+
|
| 35 |
+
<div class="buybox" data-id="buyBox">
|
| 36 |
+
<div data-id="product-heading">
|
| 37 |
+
<div class="buybox__toprow">
|
| 38 |
+
<p class="buybox__brand" data-id="product-brand"><a href="{{ product.brandUrl }}">{{ product.brand }}</a></p>
|
| 39 |
+
{% if product.reviews.count %}
|
| 40 |
+
<div class="buybox__rating" data-id="buyboxRating">
|
| 41 |
+
<span class="stars" aria-hidden="true">{{ stars(product.reviews.average) }}</span>
|
| 42 |
+
<a href="#reviews" data-id="review-summary-link">{{ '%.1f' | format(product.reviews.average) }} ({{ product.reviews.count }})</a>
|
| 43 |
+
</div>
|
| 44 |
+
{% endif %}
|
| 45 |
+
</div>
|
| 46 |
+
<h1 data-id="productTitle">{{ product.title }}</h1>
|
| 47 |
+
</div>
|
| 48 |
+
|
| 49 |
+
<div data-id="price-block">
|
| 50 |
+
<span class="buybox__price" data-id="price">{{ price_label(product) }}</span>
|
| 51 |
+
{% if list_price_label(product) %}<span class="was">{{ list_price_label(product) }}</span>{% endif %}
|
| 52 |
+
</div>
|
| 53 |
+
{% if discount_label(product) %}
|
| 54 |
+
<p class="buybox__promo" data-id="salePrice">{{ discount_label(product) }}</p>
|
| 55 |
+
{% endif %}
|
| 56 |
+
|
| 57 |
+
<form class="buybox__variant" id="buybox-variant-selector" method="post" action="/cart/add">
|
| 58 |
+
<input type="hidden" name="product" value="{{ product.slug }}">
|
| 59 |
+
<span class="buybox__label" data-id="select-color-label">{{ 'Color:' }}
|
| 60 |
+
<span class="value">{{ selected_color.name if selected_color else '' }}</span></span>
|
| 61 |
+
<div class="swatches" data-id="colorTile" role="radiogroup" aria-label="Color">
|
| 62 |
+
{% for c in product.colors %}
|
| 63 |
+
<a class="swatch{% if selected_color and c.name == selected_color.name %} is-selected{% endif %}"
|
| 64 |
+
href="{{ product.slug }}?color={{ c.name | urlencode }}"
|
| 65 |
+
role="radio" aria-checked="{{ 'true' if selected_color and c.name == selected_color.name else 'false' }}"
|
| 66 |
+
title="{{ c.name }}" data-id="color-available">
|
| 67 |
+
<img src="{{ c.swatch or c.thumb or c.image }}" alt="{{ c.name }}" width="44" height="44">
|
| 68 |
+
</a>
|
| 69 |
+
{% endfor %}
|
| 70 |
+
</div>
|
| 71 |
+
<input type="hidden" name="color" value="{{ selected_color.name if selected_color else '' }}">
|
| 72 |
+
|
| 73 |
+
{% if selected_color and selected_color.sizes %}
|
| 74 |
+
<span class="buybox__label" data-id="select-size-label">Size:
|
| 75 |
+
<span class="value">{{ selected_size or '' }}</span></span>
|
| 76 |
+
<div class="sizes" data-id="sizeTile" role="radiogroup" aria-label="Size">
|
| 77 |
+
{% for s in selected_color.sizes %}
|
| 78 |
+
<a class="size{% if s == selected_size %} is-selected{% endif %}"
|
| 79 |
+
href="{{ product.slug }}?color={{ selected_color.name | urlencode }}&size={{ s | urlencode }}"
|
| 80 |
+
role="radio" aria-checked="{{ 'true' if s == selected_size else 'false' }}"
|
| 81 |
+
data-id="size-available">{{ s }}</a>
|
| 82 |
+
{% endfor %}
|
| 83 |
+
</div>
|
| 84 |
+
{% endif %}
|
| 85 |
+
<input type="hidden" name="size" value="{{ selected_size or '' }}">
|
| 86 |
+
|
| 87 |
+
<span class="buybox__label">Quantity</span>
|
| 88 |
+
<div class="qty">
|
| 89 |
+
<button type="button" data-id="decrease-quantity" aria-label="Decrease quantity"
|
| 90 |
+
onclick="const q=document.getElementById('qty'); q.value=Math.max(1, +q.value-1)">−</button>
|
| 91 |
+
<input id="qty" data-id="quantity" name="quantity" type="number" min="1" max="10" value="1"
|
| 92 |
+
aria-label="Quantity">
|
| 93 |
+
<button type="button" data-id="increase-quantity" aria-label="Increase quantity"
|
| 94 |
+
onclick="const q=document.getElementById('qty'); q.value=Math.min(10, +q.value+1)">+</button>
|
| 95 |
+
</div>
|
| 96 |
+
|
| 97 |
+
<div class="buybox__actions" data-id="product-actions">
|
| 98 |
+
<button class="btn btn--block" type="submit" data-id="addToCartButton"
|
| 99 |
+
{% if not sku or sku.status != 'InStock' %}disabled{% endif %}>
|
| 100 |
+
{% if sku and sku.status == 'InStock' %}Add To Cart{% else %}Out Of Stock{% endif %}
|
| 101 |
+
</button>
|
| 102 |
+
<button class="buybox__wish{% if in_wishlist %} is-active{% endif %}" type="submit"
|
| 103 |
+
form="wishlist-form" data-id="addToWishListButton"
|
| 104 |
+
aria-label="{{ 'Remove from wish list' if in_wishlist else 'Add to wish list' }}">
|
| 105 |
+
{{ '♥' if in_wishlist else '♡' }}
|
| 106 |
+
</button>
|
| 107 |
+
</div>
|
| 108 |
+
</form>
|
| 109 |
+
<form id="wishlist-form" method="post" action="/wishlist/toggle">
|
| 110 |
+
<input type="hidden" name="product" value="{{ product.slug }}">
|
| 111 |
+
<input type="hidden" name="color" value="{{ selected_color.name if selected_color else '' }}">
|
| 112 |
+
<input type="hidden" name="back" value="{{ product.slug }}">
|
| 113 |
+
</form>
|
| 114 |
+
|
| 115 |
+
{% if sku and sku.stockLevel is not none and sku.stockLevel <= 5 and sku.status == 'InStock' %}
|
| 116 |
+
<p class="buybox__promo">Only {{ sku.stockLevel }} left in this colour and size.</p>
|
| 117 |
+
{% endif %}
|
| 118 |
+
|
| 119 |
+
<ul class="valueprops" data-id="pdp-value-props">
|
| 120 |
+
<li data-id="free-shipping">Free Shipping On Orders Over $69*</li>
|
| 121 |
+
<li data-id="return-policy">90 Day Risk-Free Returns</li>
|
| 122 |
+
<li data-id="badge">Lowest Price Guarantee</li>
|
| 123 |
+
</ul>
|
| 124 |
+
{% if product.id %}<p class="tile__brand" data-id="productId">Item #{{ product.id }}</p>{% endif %}
|
| 125 |
+
</div>
|
| 126 |
+
</div>
|
| 127 |
+
|
| 128 |
+
<div class="pdp__sections" data-id="productDetailsSelector">
|
| 129 |
+
<details class="accordion" open data-id="productDetailsSection">
|
| 130 |
+
<summary>Details</summary>
|
| 131 |
+
<div class="accordion__body" data-id="product-description">
|
| 132 |
+
{% if product.bulletPoints %}
|
| 133 |
+
<ul class="bullets">{% for b in product.bulletPoints %}<li>{{ b }}</li>{% endfor %}</ul>
|
| 134 |
+
{% endif %}
|
| 135 |
+
{% if product.description %}<div class="richtext">{{ product.description | clean_html | safe }}</div>{% endif %}
|
| 136 |
+
</div>
|
| 137 |
+
</details>
|
| 138 |
+
<details class="accordion" data-id="techSpecsSection">
|
| 139 |
+
<summary>Tech Specs</summary>
|
| 140 |
+
<div class="accordion__body">
|
| 141 |
+
<table class="specs">
|
| 142 |
+
<tbody>
|
| 143 |
+
{% if product.techSpecs %}
|
| 144 |
+
{% for k, v in product.techSpecs.items() %}
|
| 145 |
+
<tr data-id="tech-spec-{{ k | slugify }}"><th scope="row">{{ k }}</th><td>{{ v }}</td></tr>
|
| 146 |
+
{% endfor %}
|
| 147 |
+
{% else %}
|
| 148 |
+
{% for k, values in product.attributes.items() %}
|
| 149 |
+
{% if k != 'bottomline' %}
|
| 150 |
+
<tr data-id="tech-spec-{{ k | slugify }}"><th scope="row">{{ k }}</th><td>{{ values | join(', ') }}</td></tr>
|
| 151 |
+
{% endif %}
|
| 152 |
+
{% endfor %}
|
| 153 |
+
{% endif %}
|
| 154 |
+
</tbody>
|
| 155 |
+
</table>
|
| 156 |
+
</div>
|
| 157 |
+
</details>
|
| 158 |
+
</div>
|
| 159 |
+
|
| 160 |
+
<section class="reviews" id="reviews" data-id="reviewSection">
|
| 161 |
+
<h2>Reviews</h2>
|
| 162 |
+
{% if product.reviews.count %}
|
| 163 |
+
<div class="reviews__summary">
|
| 164 |
+
<div>
|
| 165 |
+
<p class="reviews__avg">{{ '%.1f' | format(product.reviews.average) }}</p>
|
| 166 |
+
<p class="stars" aria-hidden="true">{{ stars(product.reviews.average) }}</p>
|
| 167 |
+
<p class="tile__brand">{{ product.reviews.average }} based on {{ product.reviews.count }} ratings</p>
|
| 168 |
+
</div>
|
| 169 |
+
<div>
|
| 170 |
+
<p class="footer__col-heading">Review Summary</p>
|
| 171 |
+
<ul class="histogram">
|
| 172 |
+
{% for n in [5, 4, 3, 2, 1] %}
|
| 173 |
+
{% set bucket = product.reviews.entries | selectattr('stars', 'equalto', n) | list | length %}
|
| 174 |
+
<li>
|
| 175 |
+
<span>{{ n }} stars</span>
|
| 176 |
+
<span class="bar"><span style="width: {{ (100 * bucket / (product.reviews.entries | length)) if product.reviews.entries else 0 }}%"></span></span>
|
| 177 |
+
<span>{{ bucket }}</span>
|
| 178 |
+
</li>
|
| 179 |
+
{% endfor %}
|
| 180 |
+
</ul>
|
| 181 |
+
</div>
|
| 182 |
+
</div>
|
| 183 |
+
{% for r in product.reviews.entries %}
|
| 184 |
+
<article class="review" data-id="review">
|
| 185 |
+
<div class="review__head">
|
| 186 |
+
<span class="stars" aria-hidden="true">{{ stars(r.stars) }}</span>
|
| 187 |
+
<span>{{ r.stars }} out of 5 stars</span>
|
| 188 |
+
{% if r.date %}<span>{{ r.date }}</span>{% endif %}
|
| 189 |
+
</div>
|
| 190 |
+
{% if r.title %}<h3 class="review__title">{{ r.title }}</h3>{% endif %}
|
| 191 |
+
{% if r.body %}<p class="review__body">{{ r.body }}</p>{% endif %}
|
| 192 |
+
{% if r.author %}<p class="review__author">{{ r.author }}</p>{% endif %}
|
| 193 |
+
</article>
|
| 194 |
+
{% endfor %}
|
| 195 |
+
{% if not product.reviews.entries %}
|
| 196 |
+
<p class="tile__brand">Individual review text was not captured for this product.</p>
|
| 197 |
+
{% endif %}
|
| 198 |
+
{% else %}
|
| 199 |
+
<p>What do you think about this product?</p>
|
| 200 |
+
{% endif %}
|
| 201 |
+
</section>
|
| 202 |
+
</div>
|
| 203 |
+
|
| 204 |
+
<div class="stickybar" data-id="stickyFooter">
|
| 205 |
+
<div class="stickybar__inner">
|
| 206 |
+
<img class="stickybar__img" data-id="sticky-footer-image"
|
| 207 |
+
src="{{ gallery[0] if gallery else product.mainImage }}" alt="" width="48" height="48">
|
| 208 |
+
<div class="stickybar__meta">
|
| 209 |
+
<strong data-id="sticky-footer-title">{{ product.title }}</strong>
|
| 210 |
+
<span data-id="sticky-footer-color-label">Color:</span>
|
| 211 |
+
<span data-id="sticky-footer-color-value">{{ selected_color.name if selected_color else '' }}</span>
|
| 212 |
+
{% if selected_size %}
|
| 213 |
+
<span data-id="sticky-footer-size-label">Size:</span>
|
| 214 |
+
<span data-id="sticky-footer-size-value">{{ selected_size }}</span>
|
| 215 |
+
{% endif %}
|
| 216 |
+
</div>
|
| 217 |
+
<div class="stickybar__spacer"></div>
|
| 218 |
+
<span class="buybox__price">{{ price_label(product) }}</span>
|
| 219 |
+
<button class="btn" type="submit" form="buybox-variant-selector" data-id="sticky-footer-atc-button"
|
| 220 |
+
{% if not sku or sku.status != 'InStock' %}disabled{% endif %}>Add to Cart</button>
|
| 221 |
+
</div>
|
| 222 |
+
</div>
|
| 223 |
+
{% endblock %}
|
tasks/backcountry/environment/reference/clone/frontend/templates/plp.html
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
{% from "_tile.html" import tile %}
|
| 3 |
+
{% block title %}{{ category.name }} | Backcountry.com{% endblock %}
|
| 4 |
+
{% block content %}
|
| 5 |
+
<div class="page">
|
| 6 |
+
<div class="plp__head">
|
| 7 |
+
<h1>{{ category.name }}</h1>
|
| 8 |
+
{% if anchor_nav %}
|
| 9 |
+
{# Source: a horizontally scrollable anchor nav with edge scroll buttons. #}
|
| 10 |
+
<div class="plp__anchornav" data-id="cmsAnchorNav">
|
| 11 |
+
<button type="button" class="plp__anchor-scroll" data-id="cms-anchor-nav-scroll-left"
|
| 12 |
+
aria-label="Scroll left" data-anchor-prev>‹</button>
|
| 13 |
+
<div class="plp__anchor-items" data-id="cms-anchor-nav-items">
|
| 14 |
+
{% for a in anchor_nav %}<a href="{{ a.href }}">{{ a.label }}</a>{% endfor %}
|
| 15 |
+
</div>
|
| 16 |
+
<button type="button" class="plp__anchor-scroll" data-id="cms-anchor-nav-scroll-right"
|
| 17 |
+
aria-label="Scroll right" data-anchor-next>›</button>
|
| 18 |
+
</div>
|
| 19 |
+
{% elif subcategories %}
|
| 20 |
+
<div class="plp__subnav">
|
| 21 |
+
{% for c in subcategories %}<a href="/cat/{{ c.slug }}">{{ c.name }}</a>{% endfor %}
|
| 22 |
+
</div>
|
| 23 |
+
{% endif %}
|
| 24 |
+
</div>
|
| 25 |
+
|
| 26 |
+
<div class="plp">
|
| 27 |
+
<aside class="facets" data-id="facets" aria-label="Filters">
|
| 28 |
+
<p class="plp__count">{{ listing.total }} result{{ '' if listing.total == 1 else 's' }}</p>
|
| 29 |
+
{% if listing.selected %}
|
| 30 |
+
<div class="facets__applied">
|
| 31 |
+
{% for group, values in listing.selected.items() %}
|
| 32 |
+
{% for v in values %}
|
| 33 |
+
<span class="chip">{{ price_band_labels.get(v, v) }}
|
| 34 |
+
<a href="{{ facet_url(group, v, false) }}" aria-label="Remove filter">×</a></span>
|
| 35 |
+
{% endfor %}
|
| 36 |
+
{% endfor %}
|
| 37 |
+
<a class="chip" href="{{ clear_url }}">Clear All</a>
|
| 38 |
+
</div>
|
| 39 |
+
{% endif %}
|
| 40 |
+
{% for facet in listing.facets %}
|
| 41 |
+
<details class="facets__group" {% if loop.index <= 3 or facet.options | selectattr('selected') | list %}open{% endif %}>
|
| 42 |
+
<summary>{{ facet.label }}</summary>
|
| 43 |
+
<ul class="facets__values">
|
| 44 |
+
{% for v in facet.options %}
|
| 45 |
+
<li>
|
| 46 |
+
<label>
|
| 47 |
+
<input type="checkbox" {% if v.selected %}checked{% endif %}
|
| 48 |
+
onclick="location.href='{{ facet_url(facet.group, v.value, not v.selected) }}'">
|
| 49 |
+
<span>{{ v.label }}</span> <span class="count">({{ v.count }})</span>
|
| 50 |
+
</label>
|
| 51 |
+
</li>
|
| 52 |
+
{% endfor %}
|
| 53 |
+
</ul>
|
| 54 |
+
</details>
|
| 55 |
+
{% endfor %}
|
| 56 |
+
</aside>
|
| 57 |
+
|
| 58 |
+
<div>
|
| 59 |
+
<div class="plp__toolbar">
|
| 60 |
+
<div class="plp__sort">
|
| 61 |
+
<label for="sort">Sort By:</label>
|
| 62 |
+
<select id="sort" onchange="location.href=this.value">
|
| 63 |
+
{% for key, label in sort_options %}
|
| 64 |
+
<option value="{{ sort_url(key) }}" {% if key == listing.sort %}selected{% endif %}>{{ label }}</option>
|
| 65 |
+
{% endfor %}
|
| 66 |
+
</select>
|
| 67 |
+
</div>
|
| 68 |
+
</div>
|
| 69 |
+
|
| 70 |
+
{% if listing.items %}
|
| 71 |
+
<div class="grid" data-id="productGrid">
|
| 72 |
+
{% for p in listing.items %}{{ tile(p) }}{% endfor %}
|
| 73 |
+
</div>
|
| 74 |
+
{% if listing.pages > 1 %}
|
| 75 |
+
<nav class="pagination" aria-label="Pagination">
|
| 76 |
+
{% if listing.page > 1 %}<a href="{{ page_url(listing.page - 1) }}" rel="prev">Previous</a>{% endif %}
|
| 77 |
+
{% for n in range(1, listing.pages + 1) %}
|
| 78 |
+
{% if n == listing.page %}<span class="is-current" aria-current="page">{{ n }}</span>
|
| 79 |
+
{% else %}<a href="{{ page_url(n) }}">{{ n }}</a>{% endif %}
|
| 80 |
+
{% endfor %}
|
| 81 |
+
{% if listing.page < listing.pages %}<a href="{{ page_url(listing.page + 1) }}" rel="next">Next</a>{% endif %}
|
| 82 |
+
</nav>
|
| 83 |
+
{% endif %}
|
| 84 |
+
{% else %}
|
| 85 |
+
{% if outside_capture and not listing.selected %}
|
| 86 |
+
<div class="emptystate" data-id="out-of-capture-scope">
|
| 87 |
+
<h2>Outside the captured scope</h2>
|
| 88 |
+
<p>
|
| 89 |
+
This offline clone reproduces the Travel category. <strong>{{ category.name }}</strong> is a
|
| 90 |
+
real first-party listing on the source and its link is reproduced here, but its products were
|
| 91 |
+
not captured, so none are shown rather than standing in with something else.
|
| 92 |
+
</p>
|
| 93 |
+
<p><a class="btn btn--secondary btn--sm" href="/cat/travel">Shop Travel</a></p>
|
| 94 |
+
</div>
|
| 95 |
+
{% else %}
|
| 96 |
+
<div class="emptystate" data-id="zeroResults">
|
| 97 |
+
<h2>{% if is_search %}We couldn't find a match for "{{ search_query }}"{% else %}No results{% endif %}</h2>
|
| 98 |
+
<p>Try removing a filter or searching for something else.</p>
|
| 99 |
+
{% if listing.selected %}<p><a class="btn btn--secondary btn--sm" href="{{ clear_url }}">Clear All Filters</a></p>{% endif %}
|
| 100 |
+
</div>
|
| 101 |
+
{% endif %}
|
| 102 |
+
{% endif %}
|
| 103 |
+
</div>
|
| 104 |
+
</div>
|
| 105 |
+
</div>
|
| 106 |
+
{% endblock %}
|
tasks/backcountry/environment/reference/clone/frontend/templates/register.html
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
{% block title %}Create Account | Backcountry.com{% endblock %}
|
| 3 |
+
{% block content %}
|
| 4 |
+
<div class="page">
|
| 5 |
+
<h1 class="plp__head">Create Account</h1>
|
| 6 |
+
{% if stage == 'challenge' %}
|
| 7 |
+
<form class="form" method="post" action="/account/register/verify">
|
| 8 |
+
<p>Enter the six-digit code we sent to your email address to finish creating your account.</p>
|
| 9 |
+
{% if errors.code %}<p class="alert alert--error" role="alert" data-id="register-error">{{ errors.code }}</p>{% endif %}
|
| 10 |
+
<div class="form__field">
|
| 11 |
+
<label for="code">Verification Code</label>
|
| 12 |
+
<input id="code" name="code" inputmode="numeric" autocomplete="one-time-code" required
|
| 13 |
+
aria-invalid="{{ 'true' if errors.code else 'false' }}">
|
| 14 |
+
</div>
|
| 15 |
+
<button class="btn btn--block" type="submit">Verify And Create Account</button>
|
| 16 |
+
</form>
|
| 17 |
+
{% else %}
|
| 18 |
+
<form class="form" method="post" action="/account/register">
|
| 19 |
+
<div class="form__field">
|
| 20 |
+
<label for="display_name">Name</label>
|
| 21 |
+
<input id="display_name" name="display_name" value="{{ values.display_name or '' }}" required
|
| 22 |
+
aria-invalid="{{ 'true' if errors.display_name else 'false' }}">
|
| 23 |
+
{% if errors.display_name %}<p class="form__error">{{ errors.display_name }}</p>{% endif %}
|
| 24 |
+
</div>
|
| 25 |
+
<div class="form__field">
|
| 26 |
+
<label for="email">Email Address</label>
|
| 27 |
+
<input id="email" name="email" type="email" value="{{ values.email or '' }}" autocomplete="username" required
|
| 28 |
+
aria-invalid="{{ 'true' if errors.email else 'false' }}">
|
| 29 |
+
{% if errors.email %}<p class="form__error">{{ errors.email }}</p>{% endif %}
|
| 30 |
+
</div>
|
| 31 |
+
<div class="form__field">
|
| 32 |
+
<label for="password">Password</label>
|
| 33 |
+
<input id="password" name="password" type="password" autocomplete="new-password" required
|
| 34 |
+
aria-invalid="{{ 'true' if errors.password else 'false' }}">
|
| 35 |
+
{% if errors.password %}<p class="form__error">{{ errors.password }}</p>{% endif %}
|
| 36 |
+
</div>
|
| 37 |
+
<button class="btn btn--block" type="submit">Create Account</button>
|
| 38 |
+
</form>
|
| 39 |
+
<p style="margin-top:16px"><a href="/account/signin">Already have an account? Sign in</a></p>
|
| 40 |
+
{% endif %}
|
| 41 |
+
</div>
|
| 42 |
+
{% endblock %}
|
tasks/backcountry/environment/reference/clone/frontend/templates/signin.html
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
{% block title %}Sign In | Backcountry.com{% endblock %}
|
| 3 |
+
{% block content %}
|
| 4 |
+
<div class="page">
|
| 5 |
+
<h1 class="plp__head">Sign In</h1>
|
| 6 |
+
{% if request.query_params.get('reset') %}
|
| 7 |
+
<p class="alert alert--success" role="status">Your password was reset. Sign in with your new password.</p>
|
| 8 |
+
{% endif %}
|
| 9 |
+
{% if error %}<p class="alert alert--error" role="alert" data-id="signin-error">{{ error }}</p>{% endif %}
|
| 10 |
+
<form class="form" method="post" action="/account/signin">
|
| 11 |
+
<input type="hidden" name="next" value="{{ next }}">
|
| 12 |
+
<div class="form__field">
|
| 13 |
+
<label for="email">Email Address</label>
|
| 14 |
+
<input id="email" name="email" type="email" value="{{ email }}" autocomplete="username"
|
| 15 |
+
aria-invalid="{{ 'true' if error else 'false' }}" required>
|
| 16 |
+
</div>
|
| 17 |
+
<div class="form__field">
|
| 18 |
+
<label for="password">Password</label>
|
| 19 |
+
<input id="password" name="password" type="password" autocomplete="current-password"
|
| 20 |
+
aria-invalid="{{ 'true' if error else 'false' }}" required>
|
| 21 |
+
</div>
|
| 22 |
+
<button class="btn btn--block" type="submit">Sign In</button>
|
| 23 |
+
</form>
|
| 24 |
+
<p style="margin-top:16px">
|
| 25 |
+
<a href="/account/forgot-password">Forgot your password?</a>
|
| 26 |
+
·
|
| 27 |
+
<a href="/account/register">Create an account</a>
|
| 28 |
+
</p>
|
| 29 |
+
<div class="card" style="max-width:420px;margin-top:24px">
|
| 30 |
+
<h2>Local demo account</h2>
|
| 31 |
+
<p class="cart__line-variant">This clone ships one synthetic account. No source-site credential is used or stored.</p>
|
| 32 |
+
<p class="cart__line-variant"><strong>{{ demo_email or 'gearhead.demo@backcountry.offline.invalid' }}</strong></p>
|
| 33 |
+
<p class="cart__line-variant"><strong>GearheadDemo!2026</strong></p>
|
| 34 |
+
</div>
|
| 35 |
+
</div>
|
| 36 |
+
{% endblock %}
|
tasks/backcountry/environment/reference/clone/frontend/templates/wishlist.html
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
{% from "_account_nav.html" import account_nav %}
|
| 3 |
+
{% from "_tile.html" import tile %}
|
| 4 |
+
{% block title %}Wish List | Backcountry.com{% endblock %}
|
| 5 |
+
{% block content %}
|
| 6 |
+
<div class="page">
|
| 7 |
+
<h1 class="plp__head">Wish List</h1>
|
| 8 |
+
<div class="account">
|
| 9 |
+
{{ account_nav(account_section) }}
|
| 10 |
+
<div>
|
| 11 |
+
{% if items %}
|
| 12 |
+
<div class="grid" data-id="productGrid">{% for i in items %}{{ tile(i.product) }}{% endfor %}</div>
|
| 13 |
+
{% else %}
|
| 14 |
+
<div class="emptystate"><h2>Your wish list is empty.</h2>
|
| 15 |
+
<p><a class="btn btn--secondary btn--sm" href="/cat/travel">Continue Shopping</a></p></div>
|
| 16 |
+
{% endif %}
|
| 17 |
+
</div>
|
| 18 |
+
</div>
|
| 19 |
+
</div>
|
| 20 |
+
{% endblock %}
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/BEA/BEA1WYK/PIN.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/BRK/BRK006S/BKOILLEA.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/BRK/BRK006S/HABOILLEA.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/BRK/BRK006S/TOBOILLEA.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/BRK/BRKX0B3/BLASUE.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/BRK/BRKX0B3/PURSAGSUE.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/BRK/BRKX0B3/TAUSUE.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/BRK/BRKX0CT/TAU.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/CCN/CCN000K/HAVBLU.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/CCN/CCN000K/JUGRTALI.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/CCN/CCN000K/SAN.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/CCN/CCN000K/SEDRED.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/CCN/CCN000K/WHIMAR.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/CON/CONF03O/BLA.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/CON/CONF03O/BLABLACHI.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/CON/CONF03O/TAN.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/DAK/DAKZ75O/WHI.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/DAK/DAKZ75P/WHI.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/DAK/DAKZ7X2/ROBGRECAM.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/DAK/DAKZ838/CAR.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/DAK/DAKZ838/MIDBLO.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/DAK/DAKZ839/MIDBLO.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/DAK/DAKZ83T/BLA.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/DEU/DEU000K/BK.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/DEU/DEU000K/BLUSPR.jpg
ADDED
|
Git LFS Details
|
tasks/backcountry/environment/reference/clone/static/assets/items/small/DEU/DEU000K/CAM.jpg
ADDED
|
Git LFS Details
|