Initial curated ITWorx_MCP_Hub source from 368fba691ea8d23403b4d56b53b5ec670d7c5020
This commit is contained in:
commit
cb5be898ea
663 files changed
+82674
No files matched your search
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Create and verify an allowlisted Hub state archive without secrets."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
if str(ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from packages.hub_operations.backup import BackupManager, BackupPolicy # noqa: E402
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--source-root", type=Path, required=True)
|
||||
parser.add_argument("--backup-root", type=Path, required=True)
|
||||
parser.add_argument("--name", required=True)
|
||||
parser.add_argument("--include", action="append", required=True)
|
||||
args = parser.parse_args()
|
||||
manager = BackupManager(args.backup_root, policy=BackupPolicy())
|
||||
artifact = manager.create_archive(
|
||||
args.source_root, name=args.name, include=(Path(item) for item in args.include)
|
||||
)
|
||||
verified = manager.verify(artifact)
|
||||
print(
|
||||
json.dumps(
|
||||
{
|
||||
"archive": str(verified.archive),
|
||||
"sha256": verified.sha256,
|
||||
"bytes": verified.bytes,
|
||||
"entries": verified.entries,
|
||||
},
|
||||
sort_keys=True,
|
||||
)
|
||||
)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in new issue
Block a user