feature
This commit is contained in:
+19
-22
@@ -8,13 +8,15 @@ from pathlib import Path
|
||||
|
||||
LAB_ROOT = Path(__file__).resolve().parents[1]
|
||||
SOURCE_ROOT = LAB_ROOT / "source"
|
||||
ONLINE_ROOT = LAB_ROOT.parent / "coruna-online"
|
||||
MODULE_HUNT = ONLINE_ROOT / "module_hunt"
|
||||
if str(MODULE_HUNT) not in sys.path:
|
||||
sys.path.insert(0, str(MODULE_HUNT))
|
||||
TOOLS_ROOT = Path(__file__).resolve().parent
|
||||
VENDOR_ROOT = TOOLS_ROOT / "vendor"
|
||||
if str(VENDOR_ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(VENDOR_ROOT))
|
||||
|
||||
# Campaign / channel id embedded in type-0x01 (also source/web/<id>/ dirname).
|
||||
ORIGINAL_CHANNEL_ID = "34f5121f572d6742703eb84ec2f866a6"
|
||||
# Plain C-string channel in core + most sync business dylibs (FAT, 2 hits each).
|
||||
ORIGINAL_CORE_CHANNEL_ID = "e57f5207c9f2bacf7907c09ccf25b107"
|
||||
CAMPAIGN_HASH = ORIGINAL_CHANNEL_ID # active campaign id (may be overridden)
|
||||
|
||||
# Campaign originals (current seeds embedded in type-0x01 + core)
|
||||
@@ -31,24 +33,18 @@ CAMPAIGN_DIR = _TREE_ROOT / "web" / CAMPAIGN_HASH
|
||||
SYNC_DIR = _TREE_ROOT / "sync"
|
||||
SOURCE_CAMPAIGN_DIR = SOURCE_ROOT / "web" / ORIGINAL_CHANNEL_ID
|
||||
|
||||
C2_FETCH = ONLINE_ROOT / "c2_fetch"
|
||||
CORE_DYLIB = (
|
||||
ONLINE_ROOT
|
||||
/ "evidence/cases/2026-08-02-coruna-all-26/downloads/extracted"
|
||||
/ "80fa600e2486e588bb7991766c6b6bada5a5de0a3351a83b46b6920ee4b55ac1"
|
||||
/ "tmp.dylib"
|
||||
)
|
||||
DAILY_BODY = (
|
||||
ONLINE_ROOT
|
||||
/ "evidence/cases/2026-08-02-coruna-har/responses"
|
||||
/ "har-36_6b5f8ad2b8e41bf097b4811c9fb082523a32f72dd83eed49ed09c5a7f9b04027.body"
|
||||
)
|
||||
SECONDARY_KEYS = Path(__file__).resolve().parent / "secondary_keys.json"
|
||||
# Vendored plaintext inputs (all under source/; no coruna-online runtime dependency).
|
||||
TYPE0X01_DYLIBS_DIR = SOURCE_ROOT / "type0x01_dylibs"
|
||||
SYNC_DYLIBS_DIR = SOURCE_ROOT / "sync_dylibs"
|
||||
CORE_DYLIB = SYNC_DYLIBS_DIR / "tmp.dylib"
|
||||
DAILY_BODY = SOURCE_ROOT / "sync_config" / "daily.body"
|
||||
SECONDARY_KEYS = TOOLS_ROOT / "secondary_keys.json"
|
||||
SYNC_MODULES = TOOLS_ROOT / "sync_modules.json"
|
||||
|
||||
# Representative dylib per group (same bytes as the other stems in that group)
|
||||
GROUP_DYLIBS = {
|
||||
"A": C2_FETCH / "65704c0722165a7bdedad3f3f61258b2f95470f6_type0x01.dylib",
|
||||
"B": C2_FETCH / "7f208248c748f97956fe4a7cf246c91235852e67_type0x01.dylib",
|
||||
"A": TYPE0X01_DYLIBS_DIR / "65704c0722165a7bdedad3f3f61258b2f95470f6_type0x01.dylib",
|
||||
"B": TYPE0X01_DYLIBS_DIR / "7f208248c748f97956fe4a7cf246c91235852e67_type0x01.dylib",
|
||||
}
|
||||
|
||||
|
||||
@@ -88,6 +84,7 @@ def ensure_tree_layout(
|
||||
*,
|
||||
channel: str | None = None,
|
||||
require_campaign: bool = True,
|
||||
require_sync: bool = True,
|
||||
) -> None:
|
||||
cid = channel or CAMPAIGN_HASH
|
||||
camp = root / "web" / cid
|
||||
@@ -95,13 +92,13 @@ def ensure_tree_layout(
|
||||
missing = []
|
||||
if require_campaign and not camp.is_dir():
|
||||
missing.append(f"web/{cid}/")
|
||||
if not sync.is_dir():
|
||||
if require_sync and not sync.is_dir():
|
||||
missing.append("sync/")
|
||||
if missing:
|
||||
raise SystemExit(
|
||||
f"missing working tree under {root} (need {', '.join(missing)}).\n"
|
||||
f"Run first:\n"
|
||||
f" python3 tools/new_project.py --deployment-domains '...' --reporting-domains '...'"
|
||||
f"Bootstrap sync once, then:\n"
|
||||
f" python3 tools/new_project.py --channel-id <id>"
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user