From c1bf1823f2eb60f741e0c9312b20f080874fb315 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 1 Mar 2017 01:24:12 +0000 Subject: Add logfile action --- openssh-controller.lua | 4 ++++ openssh-logfile-html.lsp | 1 + openssh-model.lua | 14 ++++++++++++++ openssh.menu | 2 +- 4 files changed, 20 insertions(+), 1 deletion(-) create mode 120000 openssh-logfile-html.lsp diff --git a/openssh-controller.lua b/openssh-controller.lua index 134a628..c37ddfa 100644 --- a/openssh-controller.lua +++ b/openssh-controller.lua @@ -38,4 +38,8 @@ function mymodule.addauth(self) return self.handle_form(self, function() return self.model.get_auth(self.clientdata.user) end, self.model.create_auth, self.clientdata, "Add", "Add New Authorized Key", "Key Added") end +function mymodule.logfile(self) + return self.model.get_logfile(self, self.clientdata) +end + return mymodule diff --git a/openssh-logfile-html.lsp b/openssh-logfile-html.lsp new file mode 120000 index 0000000..ac8854f --- /dev/null +++ b/openssh-logfile-html.lsp @@ -0,0 +1 @@ +../logfile-html.lsp \ No newline at end of file diff --git a/openssh-model.lua b/openssh-model.lua index acd89fd..f460c0e 100644 --- a/openssh-model.lua +++ b/openssh-model.lua @@ -334,4 +334,18 @@ function mymodule.create_auth(self, authstr) return authstr end +function mymodule.get_logfile(self, clientdata) + local retval = cfe({ type="group", value={}, label="Log File Configuration" }) + retval.value.facility = cfe({value="auth", label="Syslog Facility"}) + retval.value.grep = cfe({ value="sshd", label="Grep" }) + + local config = format.parse_configfile(fs.read_file(configfile) or "") + if config then + if config.SyslogFacility then + retval.value.facility.value = config.SyslogFacility:lower() + end + end + return retval +end + return mymodule diff --git a/openssh.menu b/openssh.menu index c5656cc..d72c8a3 100644 --- a/openssh.menu +++ b/openssh.menu @@ -3,4 +3,4 @@ Applications 10SSH Status welcome Applications 10SSH Config config Applications 10SSH Authorized_Users listusers Applications 10SSH Expert expert -#Applications 10SSH Logfile logfile +Applications 10SSH Logfile logfile -- cgit v1.2.3