Create a self signed cert for the local domain
This commit is contained in:
parent
22436fbf55
commit
b45b94cd5e
|
@ -1149,7 +1149,7 @@ function install_web_local_user_interface {
|
||||||
|
|
||||||
{ echo '<html>';
|
{ echo '<html>';
|
||||||
echo ' <body>';
|
echo ' <body>';
|
||||||
echo " This is a test on $local_hostname";
|
echo " This is a test on ${local_hostname}";
|
||||||
echo ' </body>';
|
echo ' </body>';
|
||||||
echo '</html>'; } > "/var/www/${local_hostname}/htdocs/index.html"
|
echo '</html>'; } > "/var/www/${local_hostname}/htdocs/index.html"
|
||||||
|
|
||||||
|
@ -1160,8 +1160,33 @@ function install_web_local_user_interface {
|
||||||
echo " server_name ${local_hostname};";
|
echo " server_name ${local_hostname};";
|
||||||
echo " root /var/www/${local_hostname}/htdocs;";
|
echo " root /var/www/${local_hostname}/htdocs;";
|
||||||
echo ' index index.html;';
|
echo ' index index.html;';
|
||||||
echo '}'; } > "$nginx_file"
|
echo '';
|
||||||
nginx_ensite "$local_hostname"
|
echo ' access_log /dev/null;';
|
||||||
|
echo ' error_log /dev/null;';
|
||||||
|
echo '}';
|
||||||
|
echo '';
|
||||||
|
echo 'server {';
|
||||||
|
echo ' listen 443 ssl;';
|
||||||
|
echo ' #listen [::]:443 ssl;';
|
||||||
|
echo " server_name ${local_hostname};";
|
||||||
|
echo " root /var/www/${local_hostname}/htdocs;";
|
||||||
|
echo ' index index.html;';
|
||||||
|
echo '';
|
||||||
|
echo ' access_log /dev/null;';
|
||||||
|
echo ' error_log /dev/null;';
|
||||||
|
echo ''; } >> "$nginx_file"
|
||||||
|
|
||||||
|
nginx_ssl "${local_hostname}"
|
||||||
|
nginx_security_options "${local_hostname}"
|
||||||
|
|
||||||
|
{ echo ' add_header Strict-Transport-Security max-age=0;';
|
||||||
|
echo '}'; } >> "$nginx_file"
|
||||||
|
|
||||||
|
if [ ! -f "/etc/ssl/certs/${local_hostname}.crt" ]; then
|
||||||
|
"${PROJECT_NAME}-addcert" -h "${local_hostname}" --dhkey "${DH_KEYLENGTH}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
nginx_ensite "${local_hostname}"
|
||||||
|
|
||||||
# Compatibility with FreedomBox android app
|
# Compatibility with FreedomBox android app
|
||||||
# The installed apps get published to a json file called "1"
|
# The installed apps get published to a json file called "1"
|
||||||
|
|
Loading…
Reference in New Issue