feat(core-loop): implement dual-monitoring, fast gateway dispatch, dedicated pip tasks sidechat, and 2m cadence
This commit is contained in:
@@ -266,6 +266,19 @@ class CredClient:
|
||||
"email_notified": email_result.get("sent") if email_result else False
|
||||
}
|
||||
|
||||
def audit_meta(self, node):
|
||||
"""Query Meta Accounts Center for linked profiles and security status."""
|
||||
meta_script = os.path.join(NETVM_DIR, "bin", "meta-acct.py")
|
||||
cmd = ["sudo", "-n", "ip", "netns", "exec", f"warp-{node}", sys.executable, meta_script, "list-linked", node]
|
||||
try:
|
||||
res = subprocess.run(cmd, capture_output=True, text=True, timeout=15)
|
||||
lines = res.stdout.strip().splitlines()
|
||||
if lines:
|
||||
return json.loads(lines[-1])
|
||||
return {"error": res.stderr.strip() or "No output from meta-acct.py"}
|
||||
except Exception as e:
|
||||
return {"error": str(e)}
|
||||
|
||||
|
||||
def main():
|
||||
common = argparse.ArgumentParser(add_help=False)
|
||||
@@ -296,12 +309,32 @@ def main():
|
||||
p_link.add_argument("--node", required=True, help="Node label")
|
||||
p_link.add_argument("--notify", action="store_true", help="Send email alert to operator via local MTA")
|
||||
|
||||
# meta-audit
|
||||
p_meta = sub.add_parser("meta-audit", parents=[common], help="Query Meta Accounts Center for linked profiles and security status")
|
||||
p_meta.add_argument("--node", required=True, help="Node label")
|
||||
|
||||
# list
|
||||
sub.add_parser("list", parents=[common], help="List all registered nodes and vitality statuses")
|
||||
|
||||
args = p.parse_args()
|
||||
client = CredClient()
|
||||
|
||||
if args.command == "meta-audit":
|
||||
res = client.audit_meta(args.node)
|
||||
if args.json:
|
||||
print(json.dumps(res, indent=2))
|
||||
else:
|
||||
print(f"\n=== META ACCOUNTS CENTER AUDIT: {args.node} ===")
|
||||
if res.get("error"):
|
||||
print(f"Error: {res['error']}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
print(f"Meta Account Email: {res.get('email') or '(none / phone-only)'}")
|
||||
profiles = res.get("profiles", [])
|
||||
print(f"Linked Profiles ({len(profiles)}):")
|
||||
for p_info in profiles:
|
||||
print(f" - [{p_info.get('type')}] {p_info.get('name')}")
|
||||
sys.exit(0)
|
||||
|
||||
if args.command == "link-instagram":
|
||||
res = client.link_instagram(args.node, notify=args.notify)
|
||||
if args.json:
|
||||
|
||||
Reference in New Issue
Block a user