summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--README1
-rw-r--r--bin/Makefile36
-rwxr-xr-xbin/acf_cli (renamed from www/cgi-bin/cli)16
-rw-r--r--config.mk2
-rw-r--r--lua/Makefile35
-rwxr-xr-xlua/mvc.lua (renamed from www/cgi-bin/mvc.lua)0
-rw-r--r--www/Makefile4
-rwxr-xr-xwww/cgi-bin/acf2
-rw-r--r--www/sample.html117
10 files changed, 83 insertions, 132 deletions
diff --git a/Makefile b/Makefile
index 7b94882..8f40067 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ P=$(PACKAGE)-$(VERSION)
DISTDIR:=$(shell pwd)/$(P)
DISTPKG=$(P).tar.bz2
-SUBDIRS=app lib www
+SUBDIRS=app bin lib lua www
EXTRA_DIST=config.mk Makefile README
CONF_FILES=acf.conf
diff --git a/README b/README
index adbc1a2..f7eccd7 100644
--- a/README
+++ b/README
@@ -1,5 +1,4 @@
Alpine Configuration Framework
-(A work in progress.)
To install the package run:
diff --git a/bin/Makefile b/bin/Makefile
new file mode 100644
index 0000000..77158af
--- /dev/null
+++ b/bin/Makefile
@@ -0,0 +1,36 @@
+include ../config.mk
+
+BIN_DIST=acf_cli\
+
+EXTRA_DIST=Makefile
+DISTFILES=$(BIN_DIST) $(EXTRA_DIST)
+
+install_dir=$(DESTDIR)/$(bindir)
+dist_dir=$(DISTDIR)/$(notdir $(PWD))
+
+phony+=all
+all:
+
+phony+=clean
+clean:
+
+phony+=distdir
+distdir: $(DISTFILES)
+ mkdir -p "$(dist_dir)"
+ for i in $(DISTFILES); do\
+ dest=`dirname "$(dist_dir)/$$i"`;\
+ mkdir -p "$$dest";\
+ cp "$$i" "$$dest";\
+ done
+
+phony+=install
+install:
+ mkdir -p $(install_dir)
+ for i in $(BIN_DIST); do\
+ dest=`dirname "$(install_dir)/$$i"`;\
+ mkdir -p "$$dest";\
+ cp "$$i" "$$dest";\
+ done
+ chmod 700 $(install_dir)/acf_cli
+
+.PHONY: $(phony)
diff --git a/www/cgi-bin/cli b/bin/acf_cli
index 437a211..4ef512e 100755
--- a/www/cgi-bin/cli
+++ b/bin/acf_cli
@@ -2,7 +2,7 @@
if #arg == 0 then
print([[ACF Client interface
-Usage: cli [action] [parameter]...
+Usage: acf_cli [action] [parameter]...
Actions are of the form "prefix/controller/action"
Parameters are of the form "parameter=value"
@@ -10,7 +10,7 @@ Parameters are of the form "parameter=value"
boolean parameters are true if defined, false is undefined
Example:
-cli acf-util/password/newuser password="test123" password_confirm="test123" roles[1]="ADMIN" userid="root" Create
+acf_cli acf-util/password/newuser password="test123" password_confirm="test123" roles[1]="ADMIN" userid="root" Create
For forms, remember to pass in the "option" value as a parameter (see Create in example above).
Output will be a serialized Lua table.
@@ -19,12 +19,12 @@ Output will be a serialized Lua table.
end
require("posix")
-local PATH = package.path
-local p = posix.dirname(arg[0])
-if p:sub(1,1) ~= "/" then p = posix.getcwd().."/"..p end
-package.path = p.."/?.lua;" .. package.path
-require("mvc")
-package.path = PATH
+--local PATH = package.path
+--local p = posix.dirname(arg[0])
+--if p:sub(1,1) ~= "/" then p = posix.getcwd().."/"..p end
+--package.path = p.."/?.lua;" .. package.path
+mvc = require("acf.mvc")
+--package.path = PATH
-- this is to get around having to store
-- the config file in /etc/helloworld/helloworld.conf
diff --git a/config.mk b/config.mk
index 40c9722..00e2773 100644
--- a/config.mk
+++ b/config.mk
@@ -8,3 +8,5 @@ cgibindir=${wwwdir}/cgi-bin
appdir=${acfdir}/app
acflibdir=${acfdir}/lib
sessionsdir=${localstatedir}/lib/acf/sessions
+bindir=${prefix}/bin
+luadir=${prefix}/share/lua/5.1/acf
diff --git a/lua/Makefile b/lua/Makefile
new file mode 100644
index 0000000..c9e7b43
--- /dev/null
+++ b/lua/Makefile
@@ -0,0 +1,35 @@
+include ../config.mk
+
+LUA_DIST=mvc.lua\
+
+EXTRA_DIST=Makefile
+DISTFILES=$(LUA_DIST) $(EXTRA_DIST)
+
+install_dir=$(DESTDIR)/$(luadir)
+dist_dir=$(DISTDIR)/$(notdir $(PWD))
+
+phony+=all
+all:
+
+phony+=clean
+clean:
+
+phony+=distdir
+distdir: $(DISTFILES)
+ mkdir -p "$(dist_dir)"
+ for i in $(DISTFILES); do\
+ dest=`dirname "$(dist_dir)/$$i"`;\
+ mkdir -p "$$dest";\
+ cp "$$i" "$$dest";\
+ done
+
+phony+=install
+install:
+ mkdir -p $(install_dir)
+ for i in $(LUA_DIST); do\
+ dest=`dirname "$(install_dir)/$$i"`;\
+ mkdir -p "$$dest";\
+ cp "$$i" "$$dest";\
+ done
+
+.PHONY: $(phony)
diff --git a/www/cgi-bin/mvc.lua b/lua/mvc.lua
index 41aa9db..41aa9db 100755
--- a/www/cgi-bin/mvc.lua
+++ b/lua/mvc.lua
diff --git a/www/Makefile b/www/Makefile
index 5bc108c..71e6c62 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -1,10 +1,7 @@
include ../config.mk
WWW_DIST=cgi-bin/acf\
- cgi-bin/cli\
- cgi-bin/mvc.lua\
index.html\
- sample.html\
EXTRA_DIST=Makefile
DISTFILES=$(WWW_DIST) $(EXTRA_DIST)
@@ -36,6 +33,5 @@ install:
cp "$$i" "$$dest";\
done
chmod 755 $(install_dir)/cgi-bin/acf
- chmod 700 $(install_dir)/cgi-bin/cli
.PHONY: $(phony)
diff --git a/www/cgi-bin/acf b/www/cgi-bin/acf
index d866de9..7f6592d 100755
--- a/www/cgi-bin/acf
+++ b/www/cgi-bin/acf
@@ -1,6 +1,6 @@
#!/usr/bin/haserl --shell=lua --upload-limit=256
<%
-require("mvc")
+mvc = require("acf.mvc")
-- create a new container
FRAMEWORK=mvc:new()
diff --git a/www/sample.html b/www/sample.html
deleted file mode 100644
index e4c9e14..0000000
--- a/www/sample.html
+++ /dev/null
@@ -1,117 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//ddD HTML 4.01 Transitional//EN">
-<html lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Alpine</title>
-<link rel="stylesheet" type="text/css" href="snow/snow.css">
-</head>
-
-
-<body>
-<div id=header>
- <a href="#Content" class="hide">[Skip to main content]</a>
- <h1 class="logo">AlpineLinux</h1>
- <div class="leader">[ this is h-leader div text <a href="#Content">Goto content</a>]</div>
- <p>This is plain old Head div text</p>
-</div>
-
-<div id="main">
- <div id="nav">
- <ul><li>Networking
- <ul><a href=""><li>Interfaces</li></a>
- <a href=""><li>Firewall</li></a>
- <a href=""><li>BGP</li></a>
- <a href=""><li>DHCP Server</li></a>
- <a href=""><li>Ipsec VPN</li></a>
- </ul></li>
- <li>Applications
- <ul><li><a href="">Web Proxy</a></li>
- <li><a href="">Content Filter</a></li>
- <li><a href="">Fetchmail</a></li>
- <li><a href="">Certificate Authority</a></li>
- </ul></li>
- <li>System
- <ul><li><a href="">Backup</a></li>
- <li><a href="">Package Management</a></li>
- <li><a href="">General Health</a></li>
- <li><a href="">System Logs</a></li>
- <li><a href="">SNMP</a></li>
- </ul></li>
- </ul>
- </div>
-
- <div class="postnav">
- <h2>Networking : Interfaces</h2>
- <p>[ welcome ] > [ login ] > [ bgp ] > [ firewall ] > [ content filter ] > [ interfaces ]</p>
- </div>
- <a name="Content"></a>
- <div id="subnav">
- <a href="">Nav 1</a>
- <strong class=selected>Nav 2</strong>
- <a href="">Nav 3</a>
- </div>
-
- <div id="content">
-
-
-
- <p>
-This is plain old content
-</p>
-
-
-<h1>Errors</h1>
-<p class="error">This is error text. As if you didn't know that. Just check the errors below.</p>
-<p class="hide">This is some plain content level hide text</p>
-<p>This is a page with a <a href="foo">link</a> in it.</p>
-
-<h1>Networking - Status</h1>
-<p>This is the networking page. This is a very long paragraph in that page, talking about
-all the good things on this page. This is not the real page, its just a standin page for
-the page you want. Evenutally, you'll see the page you want. But not quite yet.</p>
-
-<h2>Status</h2>
-<p>The service is running</p>
-<form>
-<dl>
-<dt>bozo</dt>
-<dd><input class=error type=text value="Baz" name=bozo size=3>This is error text</dd>
-
-<dt>foo</dt><dd>
-<input type=text value="foo" name=foo size=40>
-</dd>
-
-<dt>Command</dt>
-<dd>
-<input type=submit value="Start" name="cmd">
-<input type=submit value="Stop" name="cmd">
-<input type=submit value="Restart" name="cmd">
-</dd>
-
-<dt>Textbox</dt>
-<dd><textarea cols=80 rows=10 name="textbox">fooo</textarea>
-</dd>
-
-
-<dt>A Tag with no form element</dt>
-<dd>This is just some text</dd>
-
-</dl>
-</form>
-
-<h2>Configure</h2>
-<p>Bring Service Down</p>
-<p>Bring Service Up</p>
-</div>
-</div>
-
-<div id=c-trailer>This is c-trailer</div>
-
-<div id="footer">
- <div id="f-leader">F leader</div>
- <p>Made with care by webconf</p>
- <div id="f-nav">F nav</div>
- <div id="f-trailer">F trailer</div>
-</div>
-</body>
-</html>