changeset 2094:3c40cb15d468 ssltesting tip

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 13 Dec 2025 20:54:14 -0700
parents c0847b30833f
children
files src/luan/host/Https.luan
diffstat 1 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
diff -r c0847b30833f -r 3c40cb15d468 src/luan/host/Https.luan
--- a/src/luan/host/Https.luan	Sat Dec 13 20:25:56 2025 -0700
+++ b/src/luan/host/Https.luan	Sat Dec 13 20:54:14 2025 -0700
@@ -12,7 +12,7 @@
 local try_synchronized = Thread.try_synchronized or error()
 local Http = require "luan:http/Http.luan"
 local Logging = require "luan:logging/Logging.luan"
-local logger = Logging.logger "https"
+local logger = Logging.logger "Https"
 
 
 local Https = {}
@@ -48,13 +48,13 @@
 			-- no external cert authority involved
 			if is_local then
 				local ssl_files_dir_str = ssl_files_dir.canonical().to_string().."/";
-				local cmd = [[
+				local cmd = `%>
 					openssl req -x509 -newkey rsa:2048 -nodes \
-						-keyout ]]..ssl_files_dir_str..domain..[[.key \
-						-out ]]..ssl_files_dir_str..[[fullchain.cer -days 365 \
-						-subj "/CN=]]..domain..[[" \
-						-addext "subjectAltName=DNS:]]..domain..[[,IP:127.0.0.1"
-				]]
+						-keyout <%=ssl_files_dir_str..domain%>.key \
+						-out <%=ssl_files_dir_str%>fullchain.cer -days 365 \
+						-subj "/CN=<%=domain%>" \
+						-addext "subjectAltName=DNS:<%=domain%>,IP:127.0.0.1"
+				<%`
 				logger.info("local ssl commandline:\n"..cmd)
 				local s = uri("bash:"..cmd).read_text()
 				logger.info("issue local certificate")
@@ -153,10 +153,10 @@
 		end
 	end
 	if changed then
-		local cmd = [[
-sudo $(which nginx) -t -c "]]..luanhost_dir_str..[[/local/nginx.conf" && \
-sudo $(which nginx) -s reload -c "]]..luanhost_dir_str..[[/local/nginx.conf";
-]]
+		local cmd = `%>
+sudo $(which nginx) -t -c "<%=luanhost_dir_str%>/local/nginx.conf" && \
+sudo $(which nginx) -s reload -c "<%=luanhost_dir_str%>/local/nginx.conf";
+<%`
 		local s = uri("bash:"..cmd).read_text()
 		logger.info("reload_nginx "..s)
 	end