diff options
author | Ted Trask <ttrask01@yahoo.com> | 2009-01-01 21:59:26 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2009-01-01 21:59:26 +0000 |
commit | 9f88eb0bf2faa4bd6bf3b3f35c357efb11618000 (patch) | |
tree | c2d3de59d85de0fb00f27834b1318dddd5edc25c | |
download | acf-clamav-9f88eb0bf2faa4bd6bf3b3f35c357efb11618000.tar.bz2 acf-clamav-9f88eb0bf2faa4bd6bf3b3f35c357efb11618000.tar.xz |
Added clamav and clamsmtp controllers with basic functionality.
git-svn-id: svn://svn.alpinelinux.org/acf/clamav/trunk@1661 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r-- | Makefile | 44 | ||||
-rw-r--r-- | README | 1 | ||||
-rw-r--r-- | clamav-controller.lua | 22 | ||||
-rw-r--r-- | clamav-details-html.lsp | 17 | ||||
l--------- | clamav-expert-html.lsp | 1 | ||||
-rw-r--r-- | clamav-logfile-html.lsp | 7 | ||||
-rw-r--r-- | clamav-model.lua | 39 | ||||
l--------- | clamav-startstop-html.lsp | 1 | ||||
l--------- | clamav-status-html.lsp | 1 | ||||
-rw-r--r-- | clamav.menu | 4 | ||||
-rw-r--r-- | clamav.roles | 3 | ||||
-rw-r--r-- | config.mk | 10 |
12 files changed, 150 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5d28c73 --- /dev/null +++ b/Makefile @@ -0,0 +1,44 @@ +APP_NAME=clamav +PACKAGE=acf-$(APP_NAME) +VERSION=0.1.0 + +APP_DIST=\ + clamav* \ + + +EXTRA_DIST=README Makefile config.mk + +DISTFILES=$(APP_DIST) $(EXTRA_DIST) + +TAR=tar + +P=$(PACKAGE)-$(VERSION) +tarball=$(P).tar.bz2 +install_dir=$(DESTDIR)/$(appdir)/$(APP_NAME) + +all: +clean: + rm -rf $(tarball) $(P) + +dist: $(tarball) + +install: + mkdir -p "$(install_dir)" + cp -a $(APP_DIST) "$(install_dir)" + +$(tarball): $(DISTFILES) + rm -rf $(P) + mkdir -p $(P) + cp -a $(DISTFILES) $(P) + $(TAR) -jcf $@ $(P) + rm -rf $(P) + +# target that creates a tar package, unpacks is and install from package +dist-install: $(tarball) + $(TAR) -jxf $(tarball) + $(MAKE) -C $(P) install DESTDIR=$(DESTDIR) + rm -rf $(P) + +include config.mk + +.PHONY: all clean dist install dist-install @@ -0,0 +1 @@ +ACF for clamav diff --git a/clamav-controller.lua b/clamav-controller.lua new file mode 100644 index 0000000..20baa25 --- /dev/null +++ b/clamav-controller.lua @@ -0,0 +1,22 @@ +module(..., package.seeall) + +-- Load libraries +require("controllerfunctions") + +default_action = "status" + +function status(self) + return self.model.getstatus() +end + +function startstop(self) + return controllerfunctions.handle_startstop(self, self.model.startstop_service, self.model.getstatus, self.clientdata) +end + +function details(self) + return self.model.getstatusdetails() +end + +function expert(self) + return controllerfunctions.handle_form(self, self.model.get_filedetails, self.model.update_filedetails, self.clientdata, "Save", "Edit ClamAV Config", "Configuration Set") +end diff --git a/clamav-details-html.lsp b/clamav-details-html.lsp new file mode 100644 index 0000000..f60bb13 --- /dev/null +++ b/clamav-details-html.lsp @@ -0,0 +1,17 @@ +<% local data, viewlibrary = ... +require("viewfunctions") +--[[ DEBUG INFORMATION +io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>") +io.write(html.cfe_unpack(data)) +io.write("</span>") +--]] +%> + +<% viewlibrary.dispatch_component("status") %> + +<H2><%= data.label %></H2> +<DL> +<% +displayitem(data) +%> +</DL> diff --git a/clamav-expert-html.lsp b/clamav-expert-html.lsp new file mode 120000 index 0000000..207f324 --- /dev/null +++ b/clamav-expert-html.lsp @@ -0,0 +1 @@ +../expert-html.lsp
\ No newline at end of file diff --git a/clamav-logfile-html.lsp b/clamav-logfile-html.lsp new file mode 100644 index 0000000..a2ef389 --- /dev/null +++ b/clamav-logfile-html.lsp @@ -0,0 +1,7 @@ +<% local data, viewlibrary = ... +require("viewfunctions") +%> + +<% if viewlibrary and viewlibrary.dispatch_component then + viewlibrary.dispatch_component("alpine-baselayout/logfiles/view", {name="/var/log/messages", grep="clamav"}) +end %> diff --git a/clamav-model.lua b/clamav-model.lua new file mode 100644 index 0000000..90e2fa5 --- /dev/null +++ b/clamav-model.lua @@ -0,0 +1,39 @@ +module(..., package.seeall) + +-- Load libraries +require("modelfunctions") +require("fs") +require("format") + +-- Set variables +local configfile = "/etc/clamd.conf" +local processname = "clamd" +local packagename = "clamav" + +local path = "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin " + +-- ################################################################################ +-- LOCAL FUNCTIONS + +-- ################################################################################ +-- PUBLIC FUNCTIONS + +function startstop_service(action) + return modelfunctions.startstop_service(processname, action) +end + +function getstatus() + return modelfunctions.getstatus(processname, packagename, "ClamAV Status") +end + +function getstatusdetails() + return cfe({ type="longtext", value="", label="ClamAV Status Details" }) +end + +function get_filedetails() + return modelfunctions.getfiledetails(configfile) +end + +function update_filedetails(filedetails) + return modelfunctions.setfiledetails(filedetails, {configfile}) +end diff --git a/clamav-startstop-html.lsp b/clamav-startstop-html.lsp new file mode 120000 index 0000000..0ea2627 --- /dev/null +++ b/clamav-startstop-html.lsp @@ -0,0 +1 @@ +../startstop-html.lsp
\ No newline at end of file diff --git a/clamav-status-html.lsp b/clamav-status-html.lsp new file mode 120000 index 0000000..b2f8480 --- /dev/null +++ b/clamav-status-html.lsp @@ -0,0 +1 @@ +../status-html.lsp
\ No newline at end of file diff --git a/clamav.menu b/clamav.menu new file mode 100644 index 0000000..58b1e4b --- /dev/null +++ b/clamav.menu @@ -0,0 +1,4 @@ +#CAT GROUP/DESC TAB ACTION +Applications 45ClamAV Status details +Applications 45ClamAV Expert expert +Applications 45ClamAV Logfile logfile diff --git a/clamav.roles b/clamav.roles new file mode 100644 index 0000000..e6f20f6 --- /dev/null +++ b/clamav.roles @@ -0,0 +1,3 @@ +USER=clamav:status,clamav:logfile,clamav:details,clamav:startstop +EXPERT=clamav:expert +ADMIN=clamav:status,clamav:logfile,clamav:details,clamav:startstop,clamav:expert diff --git a/config.mk b/config.mk new file mode 100644 index 0000000..45f4d21 --- /dev/null +++ b/config.mk @@ -0,0 +1,10 @@ +prefix=/usr +datadir=${prefix}/share +sysconfdir=${prefix}/etc +localstatedir=${prefix}/var +acfdir=${datadir}/acf +wwwdir=${acfdir}/www +cgibindir=${acfdir}/cgi-bin +appdir=${acfdir}/app +acflibdir=${acfdir}/lib +sessionsdir=${localstatedir}/lib/acf/sessions |