Lab7: HTTPS, mTLS, OpenBao, трек 2 PKI на оценку 5
Skeleton contracts / contracts (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Track 2: перевыпуск leaf без пересборки образов. Приватные ключи не печатаются."""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT / "scripts"))
|
||||
from bootstrap_pki import _combined, issue_leaf # noqa: E402
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--identity", required=True)
|
||||
parser.add_argument("--days", type=int, default=7)
|
||||
args = parser.parse_args()
|
||||
issue_leaf(args.identity, days=args.days, force=True)
|
||||
if args.identity in {"public", "lb"}:
|
||||
_combined(args.identity)
|
||||
print(f"renewed {args.identity} for {args.days} days; recreate dependent containers to load new leaf")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in New Issue
Block a user