fix: link files between directories instead of copying

This commit is contained in:
ptrcnull 2024-03-16 19:54:11 +01:00
parent 5561b8f7a2
commit 5e665eb9fb
Signed by: ptrcnull
GPG key ID: 411F7B30801DD9CA

View file

@ -66,7 +66,7 @@ def main() -> None:
domain_key = os.path.join(args.output, f'{domain}/cert.pem.key')
domain_pem = os.path.join(args.output, f'{domain}/cert.pem')
shutil.copy2(private_key, domain_key)
os.link(private_key, domain_key)
# TODO: add user/group to config
shutil.chown(domain_key, 'acme', 'acme')
os.chmod(domain_key, 0o440)
@ -74,8 +74,8 @@ def main() -> None:
all_pem = os.path.join(args.output, f'all/{domain}.pem')
all_key = os.path.join(args.output, f'all/{domain}.pem.key')
shutil.copy2(domain_pem, all_pem)
shutil.copy2(domain_key, all_key)
os.link(domain_pem, all_pem)
os.link(domain_key, all_key)
if acquired:
for cmd in config.post_acquire: