🗝
summary refs log tree commit diff
path: root/misc/certs.py
blob: 889ef33fabd1cc4d78b58ca35e12a1232001cd81 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import io
from tarfile import TarFile

from commia.bearer import get_key, keys
from commia.prelude import *
from commia.ssh import scp
from commia.util import with_written

buffer = get_key(keys.certificates.certs, decode=False)
tar = TarFile(fileobj=io.BytesIO(buffer))
for name in tar.getnames():
    with_written(
        tar.extractfile(name).read(),
        lambda path: scp(path, f"callosum:/etc/tls/{name}"),
    )