diff src/luan/host/main.luan @ 1396:a5f61890ad84

add check_postgres_password
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 10 Sep 2019 13:41:22 -0600
parents 8fe777ba5045
children 5b8f76e26ab7
line wrap: on
line diff
--- a/src/luan/host/main.luan	Mon Sep 09 01:22:23 2019 -0600
+++ b/src/luan/host/main.luan	Tue Sep 10 13:41:22 2019 -0600
@@ -18,6 +18,8 @@
 local Util = require "classpath:luan/host/Util.luan"
 local read_password = Util.read_password or error()
 local set_password = Util.set_password or error()
+local set_postgres_password = Util.set_postgres_password or error()
+local check_postgres_password = Util.check_postgres_password or error()
 
 
 local sites_dir = Io.schemes.file(Hosting.sites_dir)
@@ -103,6 +105,7 @@
 	domain = lower(domain)
 	local dir = sites_dir.child(domain)
 	dir.exists() and error "already exists"
+	check_postgres_password(domain,password)
 	dir.mkdir()
 	set_password(domain,password)
 	dir = dir.child("site")
@@ -180,6 +183,7 @@
 	local site_dir = get_dir(domain,old_password)
 	site_dir or error "domain not found"
 	set_password(domain,new_password)
+	set_postgres_password(domain,new_password)
 	WebHandler.removeHandler(domain)
 	WebHandler.loadHandler(domain)
 end