2024-06-29 16:05:58 +00:00
|
|
|
from src.args import args
|
|
|
|
import src.api as api
|
|
|
|
import os
|
|
|
|
|
|
|
|
print("Check storage")
|
|
|
|
if not os.path.isdir(args.storage):
|
|
|
|
print("Create storage")
|
|
|
|
os.makedirs(args.storage, exist_ok=True)
|
|
|
|
|
|
|
|
|
|
|
|
print("Check secure origin...")
|
|
|
|
if not os.path.isfile(args.secure_origin_path):
|
|
|
|
origin = api.get_secure_origin()
|
|
|
|
with open(args.secure_origin_path, "w") as f:
|
|
|
|
f.write(origin)
|
|
|
|
|
|
|
|
with open(args.secure_origin_path, "r") as f:
|
|
|
|
args.secure_origin = f.read()
|
2024-06-29 16:08:57 +00:00
|
|
|
print(f"Secure origin = {args.secure_origin}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print("Check system root CA")
|
|
|
|
if not os.path.isfile(args.root_ca_path):
|
|
|
|
origin = api.get_root_ca()
|
|
|
|
with open(args.root_ca_path, "w") as f:
|
|
|
|
f.write(origin)
|
|
|
|
|
|
|
|
with open(args.root_ca_path, "r") as f:
|
|
|
|
args.root_ca = f.read()
|
|
|
|
print(f"Root CA = {args.root_ca}")
|