Mercurial Hosting > luan
changeset 2121:8311ddedf344 ssltesting tip
add delete_junk test
| author | Violet7 |
|---|---|
| date | Wed, 07 Jan 2026 04:54:35 -0800 |
| parents | 2deeafc76ff0 |
| children | |
| files | host/doc/install.txt host/test/test_delete_junk.luan src/luan/host/Https.luan |
| diffstat | 3 files changed, 22 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/host/doc/install.txt Tue Jan 06 20:49:33 2026 -0700 +++ b/host/doc/install.txt Wed Jan 07 04:54:35 2026 -0800 @@ -25,6 +25,7 @@ 6) Make sudo nginx without password add string to /etc/sudoers %admin ALL=(ALL) NOPASSWD: /usr/local/bin/nginx + (requires user to be part of group "admin") 7) compile ./update.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/host/test/test_delete_junk.luan Wed Jan 07 04:54:35 2026 -0800 @@ -0,0 +1,16 @@ +local Luan = require("luan:Luan.luan") +local error = Luan.error +local Io = require("luan:Io.luan") +local uri = Io.uri or error() +local Logging = require("luan:logging/Logging.luan") +local logger = Logging.logger("test_delete_junk") + +local Https = require("classpath:luan/host/Https.luan") + +local domain = "https.me.luan.software" +local site_dir = uri("file:../sites/" .. domain) + +local junk = site_dir.child("this_is_a_junk_dir/") +junk.mkdir() + +Https.delete_junk(domain, site_dir)
--- a/src/luan/host/Https.luan Tue Jan 06 20:49:33 2026 -0700 +++ b/src/luan/host/Https.luan Wed Jan 07 04:54:35 2026 -0800 @@ -68,6 +68,9 @@ end end +-- for testing +Https.delete_junk = delete_junk + local function nginx_ssl_conf(domain,files,luanhost_dir) %> server { @@ -244,8 +247,8 @@ end -- We now have our certificate! -- Now we just need to generate the nginx config - -- that uses it, place it in luan/host/sites/*/nginx.ssl.conf - -- and tell luan-host to reload nginx. + -- that uses it, place it in luan/host/sites/DOMAIN/ssl/nginx.ssl.conf + -- and tell luanhost to reload nginx. if files.key_file.exists() and files.local_cer_file.exists() and files.local_cer_file.length() > 0 then -- the nginx config only requires 2 files:
