Mercurial Hosting > luan
changeset 2092:429827024f4e ssltesting tip
inline local_https.sh + minor
| author | Violet7 |
|---|---|
| date | Fri, 12 Dec 2025 18:53:15 -0800 |
| parents | ee7e711a91f2 |
| children | |
| files | host/startup/nginx/nginx.ssl.conf.luan src/luan/host/https.luan |
| diffstat | 2 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
diff -r ee7e711a91f2 -r 429827024f4e host/startup/nginx/nginx.ssl.conf.luan --- a/host/startup/nginx/nginx.ssl.conf.luan Thu Dec 11 20:33:51 2025 -0800 +++ b/host/startup/nginx/nginx.ssl.conf.luan Fri Dec 12 18:53:15 2025 -0800 @@ -27,7 +27,6 @@ ssl_certificate <%=rootDir%>/sites/<%=domain%>/fullchain.cer; ssl_certificate_key <%=rootDir%>/sites/<%=domain%>/<%=domain%>.key; - include <%=rootDir%>/sites/<%=domain%>/site/nginx.*.conf; include <%=rootDir%>/local/nginx.default.conf; } <%
diff -r ee7e711a91f2 -r 429827024f4e src/luan/host/https.luan --- a/src/luan/host/https.luan Thu Dec 11 20:33:51 2025 -0800 +++ b/src/luan/host/https.luan Fri Dec 12 18:53:15 2025 -0800 @@ -47,9 +47,15 @@ -- Use openssl directly to make a self-signed cert, -- no external cert authority involved if is_local then + local ssl_files_dir_str = ssl_files_dir.canonical().to_string().."/"; local cmd = [[ - ./local_https.sh "]]..domain..[[" + 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" ]] + logger.info("local ssl commandline:\n"..cmd) local s = uri("bash:"..cmd).read_text() logger.info("issue local certificate") else @@ -127,6 +133,7 @@ changed = true -- the nginx config only requires 2 files: -- fullchain.cer and DOMAIN.key + logger.info("writing nginx conf to "..nginx_file.canonical().to_string()) local conf = load_file(luanhost_file.."startup/nginx/nginx.ssl.conf.luan") local nginx = ` conf(luanhost_dir_str,domain) ` nginx_file.write(nginx)
