summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2007-12-03 15:35:31 +0000
committerMika Havela <mika.havela@gmail.com>2007-12-03 15:35:31 +0000
commit4348cbb93645b06a8d3f0ad658239301bdd7afb9 (patch)
tree6db8854ff50382e690615a8d0909b9cd28c2a5a7
parenta2b138ecbe9a23a6864ef5d443041ea731048d41 (diff)
downloadacf-shorewall-4348cbb93645b06a8d3f0ad658239301bdd7afb9.tar.bz2
acf-shorewall-4348cbb93645b06a8d3f0ad658239301bdd7afb9.tar.xz
Cleaning up GuidedSetupCode and only focusing on AdvancedUsers Interface
git-svn-id: svn://svn.alpinelinux.org/acf/shorewall/trunk@400 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--shorewall-advanced-html.lsp28
-rw-r--r--shorewall-check-html.lsp14
-rw-r--r--shorewall-controller.lua2
-rw-r--r--shorewall-edit-html.lsp10
-rw-r--r--shorewall-list-html.lsp10
-rw-r--r--shorewall-model.lua6
-rw-r--r--shorewall-read-html.lsp72
7 files changed, 53 insertions, 89 deletions
diff --git a/shorewall-advanced-html.lsp b/shorewall-advanced-html.lsp
new file mode 100644
index 0000000..043b58b
--- /dev/null
+++ b/shorewall-advanced-html.lsp
@@ -0,0 +1,28 @@
+<? local view = ... ?>
+
+<h1>Firewall configuration</h1>
+
+
+<h2>MENU</h2>
+
+<dt><?= html.link{value = view.url .. "/", label="Home" } ?></dt>
+<dd>Go back to start page</dd>
+
+
+<h2>ADVANCED</h2>
+
+<TABLE border=0>
+ <TR style="background:#eee;font-weight:bold;">
+ <TD "width=200px" align="left">File</TD>
+ <TD "width=100px" align="left">Size</TD>
+ <TD "width=200px" align="left">Last Modified</TD>
+ </TR>
+
+
+<? for i = 1, table.maxn(view.filelist) do ?>
+ <TR>
+ <TD><?= html.link{value = view.url .. "/edit?name=" .. view.filelist[i].name , label=view.filelist[i].name } ?></TD>
+ <TD><?= view.filelist[i].filedetails.size ?></TD>
+ <TD><?= view.filelist[i].filedetails.mtimelong ?></TD>
+ </TR>
+<? end ?>
diff --git a/shorewall-check-html.lsp b/shorewall-check-html.lsp
index 0378928..a31b947 100644
--- a/shorewall-check-html.lsp
+++ b/shorewall-check-html.lsp
@@ -2,20 +2,24 @@
<h1>Firewall configuration</h1>
-<h2>SHOREWALL CHECK RESULT</h2>
-<textarea name="checkresult" style="width:100%;height:400px;"><?= view.check.result ?></textarea>
+<h2>MENU</h2>
-<h2>SHOW CONFIG FILES</h2>
+<dt><?= html.link{value = view.url .. "/", label="Home" } ?></dt>
+<dd>Go back to start page</dd>
-<dt><?= html.link{value = view.url .. "/list", label="View all files/configs" } ?></dt>
+<dt><?= html.link{value = view.url .. "/advanced", label="Advanced" } ?></dt>
<dd>Provide a autogenerated list of files in '/etc/shorewall'.</dd>
+
+<h2>SHOREWALL CHECK RESULT</h2>
+<textarea name="checkresult" style="width:100%;height:400px;"><?= view.check.result ?></textarea>
+
<h2>MANAGEMENT</h2>
<dt>Preform check of configs</dt>
<dd><form name="check" action="" method="POST"><input type=submit name="cmd" value="check" style="width:100px"></form></dd>
-<dt>Preform restart of firewall</dt>
+<dt>Preform fw restart</dt>
<dd><form name="check" action="<? io.write(view.url .. "/read") ?>" method="POST"><input type=submit name="cmd" value="restart" style="width:100px"></form><? if (view.check.restart) then io.write(view.programstats.restart) end ?></dd>
<?
diff --git a/shorewall-controller.lua b/shorewall-controller.lua
index 07ec0b7..febbf12 100644
--- a/shorewall-controller.lua
+++ b/shorewall-controller.lua
@@ -37,7 +37,7 @@ read = function(self)
return ( {programstats = self.model:get_status(), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } )
end
-list = function(self)
+advanced = function(self)
return ( {filelist = self.model:get_filelist(), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } )
end
diff --git a/shorewall-edit-html.lsp b/shorewall-edit-html.lsp
index f9ce486..afbe172 100644
--- a/shorewall-edit-html.lsp
+++ b/shorewall-edit-html.lsp
@@ -4,6 +4,14 @@
<h1>Edit configuration</h1>
+<h2>MENU</h2>
+
+<dt><?= html.link{value = view.url .. "/", label="Home" } ?></dt>
+<dd>Go back to start page</dd>
+
+<dt><?= html.link{value = view.url .. "/advanced", label="Advanced" } ?></dt>
+<dd>Provide a autogenerated list of files in '/etc/shorewall'.</dd>
+
<h2>Details</h2>
<dt>File name</dt>
@@ -19,7 +27,7 @@
<form name="myform" action="" method="POST">
<input name="name" type=hidden value="<?= view.filecontent.filedetails.name ?>" style="width:100%">
-<textarea name="modifications" style="width:100%;height:400px;"><?= view.filecontent.value ?></textarea>
+<textarea name="modifications" style="width:100%;height:360px;"><?= view.filecontent.value ?></textarea>
<input type="submit" name="cmd" value="update"><p class="error"><?= view.filecontent.errtxt ?></p></form>
diff --git a/shorewall-list-html.lsp b/shorewall-list-html.lsp
deleted file mode 100644
index dc18373..0000000
--- a/shorewall-list-html.lsp
+++ /dev/null
@@ -1,10 +0,0 @@
-<? local view = ... ?>
-
-<h1>Firewall configuration</h1>
-
-<h2>EXISTING FILES</h2>
-
-<? for i = 1, table.maxn(view.filelist) do ?>
- <dt><?= html.link{value = view.url .. "/edit?name=" .. view.filelist[i].name , label=view.filelist[i].name } ?></dt>
- <dd><i>Last modified:</i> <?= view.filelist[i].filedetails.mtimelong ?></dd>
-<? end ?>
diff --git a/shorewall-model.lua b/shorewall-model.lua
index 311ad86..b6f6c39 100644
--- a/shorewall-model.lua
+++ b/shorewall-model.lua
@@ -31,11 +31,11 @@ function check_config ()
end
function restart_service ()
- -- FIXME: Read getstatus AFTER restart so the new 'restart date' is shown.
- local status = get_status()
local f,err = io.popen("/etc/init.d/shorewall restart")
- status.restart = f:read("*a")
+ local restart = f:read("*a")
f:close()
+ local status = get_status()
+ status.restart = restart
return status
end
diff --git a/shorewall-read-html.lsp b/shorewall-read-html.lsp
index 5910c30..264c4a5 100644
--- a/shorewall-read-html.lsp
+++ b/shorewall-read-html.lsp
@@ -2,65 +2,9 @@
<h1>Firewall configuration</h1>
-<h2>GENERAL</h2>
+<h2>MENU</h2>
-<dt><?= html.link{value = view.url .. "/edit?name=shorewall.conf", label="shorewall.conf" } ?></dt>
-<dd>Modify global configuration settings.</dd>
-
-<dt><?= html.link{value = view.url .. "/edit?name=params", label="params" } ?></dt>
-<dd>Define variables used in the other configuratino files.</dd>
-
-<dt><?= html.link{value = view.url .. "/edit?name=zones", label="zones" } ?></dt>
-<dd>Name network partions. Firewal rules are applied to defined zones.</dd>
-
-<dt><?= html.link{value = view.url .. "/edit?name=interfaces", label="interfaces" } ?></dt>
-<dd>Map physical interfaces to named zones.</dd>
-
-<dt><?= html.link{value = view.url .. "/edit?name=hosts", label="hosts" } ?></dt>
-<dd>Map individual hosts or networks to named zones.</dd>
-
-<h2>FIREWALLING</h2>
-
-<dt><?= html.link{value = view.url .. "/edit?name=policy", label="policy" } ?></dt>
-<dd>Set default rules (policies) for zones.</dd>
-
-<dt><?= html.link{value = view.url .. "/edit?name=rules", label="rules" } ?></dt>
-<dd>Define exceptions to policies.</dd>
-
-<dt><?= html.link{value = view.url .. "/edit?name=routestopped", label="routestopped" } ?></dt>
-<dd>Define hosts that can access this host when the firewall is "stopped".</dd>
-
-<dt><?= html.link{value = view.url .. "/edit?name=tunnels", label="tunnels" } ?></dt>
-<dd>Specify ipsec tunel endpoints.</dd>
-
-<dt><?= html.link{value = view.url .. "/edit?name=blacklist", label="blacklist" } ?></dt>
-<dd>List ip addresses or names that should be denied all access to the firewall.</dd>
-
-<h2>NAT</h2>
-
-<dt><?= html.link{value = view.url .. "/edit?name=masq", label="masq" } ?></dt>
-<dd>Define dynamic Masquerading or DNAT tables.</dd>
-
-<dt><?= html.link{value = view.url .. "/edit?name=nat", label="nat" } ?></dt>
-<dd>Define static Network Address Translation tables.</dd>
-
-<h2>QOS</h2>
-
-<dt><?= html.link{value = view.url .. "/edit?name=tos", label="tos" } ?></dt>
-<dd>Specify type of service markers for packets traversing the firewall.</dd>
-
-<dt><?= html.link{value = view.url .. "/edit?name=tcdevices", label="tcdevices" } ?></dt>
-<dd>Define traffic control devices.</dd>
-
-<dt><?= html.link{value = view.url .. "/edit?name=tcclasses", label="tcclasses" } ?></dt>
-<dd>Define traffic control classes.</dd>
-
-<dt><?= html.link{value = view.url .. "/edit?name=tcrules", label="tcrules" } ?></dt>
-<dd>Define traffic control rules.</dd>
-
-<h2>SHOW CONFIG FILES</h2>
-
-<dt><?= html.link{value = view.url .. "/list", label="View all files/configs" } ?></dt>
+<dt><?= html.link{value = view.url .. "/advanced", label="Advanced" } ?></dt>
<dd>Provide a autogenerated list of files in '/etc/shorewall'.</dd>
<h2>SYSTEM INFO</h2>
@@ -74,24 +18,14 @@
<dt>Program state</dt>
<dd><?= view.programstats.programstate ?></dd>
-<? --[[
-<dt>Show shorewall details</dt>
-<dd>[connections] Displays the IP connections currently being tracked by the firewall</dd>
---]] ?>
-
<h2>MANAGEMENT</h2>
<dt>Preform check of configs</dt>
<dd><form name="check" action="" method="POST"><input type=submit name="cmd" value="check" style="width:100px"></form></dd>
-<dt>Preform restart of firewall</dt>
+<dt>Preform fw restart</dt>
<dd><form name="restart" action="" method="POST"><input type=submit name="cmd" value="restart" style="width:100px"></form><? if (view.programstats.restart) then io.write(view.programstats.restart) end ?></dd>
-<? --[[
-<dt>Preform refresh of configs</dt>
-<dd><form action="xxx" method="POST"><input type=submit name="cmd" value="refresh" style="width:100px"></form> Involves black list, ECN control rules, and traffic shaping...</dd>
---]] ?>
-
<?
--[[ DEBUG INFORMATION
require("debugs")