Mercurial Hosting > luan
diff src/luan/host/Util.luan @ 1190:db7d31f4089a
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 23 Feb 2018 15:48:15 -0700 |
parents | 51d1342e25ad |
children | 3db95cc00d09 |
line wrap: on
line diff
--- a/src/luan/host/Util.luan Fri Feb 23 01:40:04 2018 -0700 +++ b/src/luan/host/Util.luan Fri Feb 23 15:48:15 2018 -0700 @@ -1,10 +1,10 @@ local Luan = require "luan:Luan.luan" local error = Luan.error local do_file = Luan.do_file or error() +local stringify = Luan.stringify or error() local Io = require "luan:Io.luan" local String = require "luan:String.luan" local lower = String.lower or error() -local encode = String.encode or error() local Hosting = require "luan:host/Hosting.luan" java() @@ -22,9 +22,7 @@ function Util.write_password(domain,password) local dir = Hosting.sites_dir..lower(domain) Io.schemes.file(dir.."/info.luan").write_text( %> -return { - password = "<%=encode(password)%>" -} +return <%= stringify{password=password} %> <% ) local sha1 = MessageDigest.getInstance("SHA1").digest(password.getBytes()) local encoded = Base64.getEncoder().encodeToString(sha1)