mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
apache: Create snake oil certificate if not exists
When FreedomBox package is installed on a fresh Debian machine where a snakeoil certificate doesn't exist, generate a new one. Fixes #1923 Fixes #1999 Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net> [Veiko: Made added code comment more precise] Signed-off-by: Veiko Aasa <veiko17@disroot.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
parent
327e76220b
commit
5f3643cc24
@ -7,6 +7,7 @@ Configuration helper for Apache web server.
|
||||
|
||||
import argparse
|
||||
import glob
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
@ -97,6 +98,11 @@ def subcommand_setup(arguments):
|
||||
subprocess.run([
|
||||
'make-ssl-cert', 'generate-default-snakeoil', '--force-overwrite'
|
||||
], check=True)
|
||||
# In case the certificate has been removed after ssl-cert is installed
|
||||
# on a fresh Debian machine.
|
||||
elif not os.path.exists('/etc/ssl/certs/ssl-cert-snakeoil.pem'):
|
||||
subprocess.run(['make-ssl-cert', 'generate-default-snakeoil'],
|
||||
check=True)
|
||||
|
||||
with action_utils.WebserverChange() as webserver:
|
||||
# Disable mod_php as we have switched to mod_fcgi + php-fpm. Disable
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user