# HG changeset patch # User Franklin Schmidt # Date 1654219092 21600 # Node ID a6be8817c05b5b59d8bcce58452e4fdf4631f674 # Parent a09d8bcdc0f9786d1a01b7bdf0d40a51a47c3f04 move mail_info to config diff -r a09d8bcdc0f9 -r a6be8817c05b doc/update.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/update.txt Thu Jun 02 19:18:12 2022 -0600 @@ -0,0 +1,3 @@ +ussh administrator@hg.luan.software +cd hghosting +./update.sh diff -r a09d8bcdc0f9 -r a6be8817c05b src/get_password.html.luan --- a/src/get_password.html.luan Wed May 18 00:21:44 2022 -0600 +++ b/src/get_password.html.luan Thu Jun 02 19:18:12 2022 -0600 @@ -13,12 +13,8 @@ local save_raw_config = Shared.save_raw_config or error() -local send_mail = Mail.sender{ - host = "smtpcorp.com" - username = "smtp@luan.software" - password = "luanhost" - port = 2525 -}.send +local mail_info = config.mail_info or error "missing config.mail_info" +local send_mail = Mail.sender(mail_info).send local function handle(email) local change = Http.request.parameters.change ~= nil diff -r a09d8bcdc0f9 -r a6be8817c05b src/private/tools/configure_mail.html.luan --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/private/tools/configure_mail.html.luan Thu Jun 02 19:18:12 2022 -0600 @@ -0,0 +1,74 @@ +local Luan = require "luan:Luan.luan" +local error = Luan.error +local stringify = Luan.stringify or error() +local parse = Luan.parse or error() +local Io = require "luan:Io.luan" +local Http = require "luan:http/Http.luan" +local Shared = require "site:/lib/Shared.luan" +local head = Shared.head or error() +local header = Shared.private_header or error() +local config = Shared.config or error() +local get_raw_config = Shared.get_raw_config or error() +local save_raw_config = Shared.save_raw_config or error() + + +local function posted() + local mail_info = Http.request.parameters.mail_info or error() + mail_info = parse(mail_info) + local raw_config = get_raw_config() + raw_config.mail_info = mail_info + save_raw_config(raw_config) +%> + + + +<% head() %> + Mercurial Configure Email + + +<% header() %> +
+

Configure Email

+

Updated

+
+ + +<% +end + +return function() + local mail_info = stringify(config.mail_info or { + host = "smtpcorp.com" + username = "xxx" + password = "xxx" + port = 2525 + }) + Io.stdout = Http.response.text_writer() + if Http.request.method == "POST" then + posted() + return + end +%> + + + +<% head() %> + Mercurial Configure Email + + +<% header() %> +
+

Configure Email

+
+

+ +

+

+ +

+
+
+ + +<% +end diff -r a09d8bcdc0f9 -r a6be8817c05b src/private/tools/index.html.luan --- a/src/private/tools/index.html.luan Wed May 18 00:21:44 2022 -0600 +++ b/src/private/tools/index.html.luan Thu Jun 02 19:18:12 2022 -0600 @@ -23,6 +23,7 @@

edit private users

edit backup

all users

+

configure mail

links.txt