mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[mod] merge double with
This commit is contained in:
parent
2f4f254612
commit
4a9b89d12e
1 changed files with 6 additions and 8 deletions
|
@ -185,10 +185,9 @@ def _certificate_install_selfsigned(domain_list, force=False):
|
||||||
|
|
||||||
# Create our conf file, based on template, replacing the occurences of
|
# Create our conf file, based on template, replacing the occurences of
|
||||||
# "yunohost.org" with the given domain
|
# "yunohost.org" with the given domain
|
||||||
with open(conf_file, "w") as f:
|
with open(conf_file, "w") as f, open(conf_template, "r") as template:
|
||||||
with open(conf_template, "r") as template:
|
for line in template:
|
||||||
for line in template:
|
f.write(line.replace("yunohost.org", domain))
|
||||||
f.write(line.replace("yunohost.org", domain))
|
|
||||||
|
|
||||||
# Use OpenSSL command line to create a certificate signing request,
|
# Use OpenSSL command line to create a certificate signing request,
|
||||||
# and self-sign the cert
|
# and self-sign the cert
|
||||||
|
@ -216,10 +215,9 @@ def _certificate_install_selfsigned(domain_list, force=False):
|
||||||
os.symlink(original_ca_file, ca_file)
|
os.symlink(original_ca_file, ca_file)
|
||||||
|
|
||||||
# Append ca.pem at the end of crt.pem
|
# Append ca.pem at the end of crt.pem
|
||||||
with open(ca_file, "r") as ca_pem:
|
with open(ca_file, "r") as ca_pem, open(crt_file, "a") as crt_pem:
|
||||||
with open(crt_file, "a") as crt_pem:
|
crt_pem.write("\n")
|
||||||
crt_pem.write("\n")
|
crt_pem.write(ca_pem.read())
|
||||||
crt_pem.write(ca_pem.read())
|
|
||||||
|
|
||||||
# Set appropriate permissions
|
# Set appropriate permissions
|
||||||
_set_permissions(new_cert_folder, "root", "root", 0755)
|
_set_permissions(new_cert_folder, "root", "root", 0755)
|
||||||
|
|
Loading…
Add table
Reference in a new issue