summaryrefslogtreecommitdiffstats
path: root/openvpn-viewconfig-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-11-25 19:27:55 +0000
committerTed Trask <ttrask01@yahoo.com>2008-11-25 19:27:55 +0000
commit3459e6bf19a13f35e419b0adabf8c3456a0a5025 (patch)
tree9330301f44a88ee2f3cb8b5d0271204294aa99c6 /openvpn-viewconfig-html.lsp
parent99b9d1c5e938d818ca3e78a1f37d6a80da4b88f1 (diff)
downloadacf-openvpn-3459e6bf19a13f35e419b0adabf8c3456a0a5025.tar.bz2
acf-openvpn-3459e6bf19a13f35e419b0adabf8c3456a0a5025.tar.xz
Rewrite of openvpn to use cfes and new style. Added ability to edit/create/delete configs. Combined three view functions into one. Added a new status and moved old status to listconfigs. Still needs work, including ability to start/stop/restart.v0.3.0
git-svn-id: svn://svn.alpinelinux.org/acf/openvpn/trunk@1611 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'openvpn-viewconfig-html.lsp')
-rw-r--r--openvpn-viewconfig-html.lsp82
1 files changed, 82 insertions, 0 deletions
diff --git a/openvpn-viewconfig-html.lsp b/openvpn-viewconfig-html.lsp
new file mode 100644
index 0000000..1cdfa8d
--- /dev/null
+++ b/openvpn-viewconfig-html.lsp
@@ -0,0 +1,82 @@
+<% local view, viewlibrary, page_info, session = ... %>
+<% require("format") %>
+<% local shortname = string.gsub(view.value.name, "^.*/", "") %>
+
+<h1><%= format.cap_begin_word(view.value.type) %> config '<%= shortname %>'</h1>
+
+<h2><%= format.cap_begin_word(view.value.type) %> settings</h2>
+<dl>
+<dt>Mode</dt>
+<dd><%= view.value.type %></dd>
+
+<dt>User device</dt>
+<dd><%= view.value.dev %></dd>
+
+<% if view.value.type == "server" then %>
+<dt>Listens on</dt>
+<dd><%= view.value["local"] %>:<%= view.value.port %> (<%= view.value.proto %>)</dd>
+<% end %>
+
+<% if view.value.type == "client" then %>
+<dt>Remote server</dt>
+<dd><% if string.find(view.value.remote, "%s") then io.write((string.gsub(view.value.remote, "%s+", ":"))) else io.write(view.value.remote .. (view.value.rport or view.value.port or "1194")) end %> (<%= view.value.proto %>)</dd>
+<% end %>
+
+<dt>Logfile</dt>
+<dd><% if ( view.value.log ) then %><%= html.link{value = page_info.script .. page_info.prefix .. page_info.controller .. "/logfile?name=" .. view.value.name, label=view.value.log } %><% else %>Syslog<% end %> (Verbosity level: <%= view.value.verb %>)</dd>
+</dl>
+
+<% if view.value.type == "server" then %>
+<h3>Connected clients status</h3>
+<dl>
+<dt>Last status was recorded</dt>
+<dd><%= view.value.client_lastupdate %> (This was <b><%= view.value.client_lastdatechangediff %></b> ago)</dd>
+
+<dt>Maximum clients</dt>
+<dd><%= view.value["max-clients"] %></dd>
+
+<dt>Connected clients</dt>
+<dd><% if ( view.value.client_count > 0 ) then %><%= html.link{value = page_info.script .. page_info.prefix .. page_info.controller .. "/status_info?name=" .. view.value.name , label=view.value.client_count } %><% else %><%= view.value.client_count %><% end %></dd>
+</dl>
+<% end %>
+
+<h2>Startup options</h2>
+<dl>
+<dt>Process status</dt>
+<dd><%= view.value.status_isrunning %></dd>
+</dl>
+
+<% if view.value.dh or view.value.ca or view.value.cert or view.value.key or view.value.tls or view.value.crl then %>
+<h2>Certificate files</h2>
+<dl>
+<% if (view.value.dh) then %>
+<dt>DH</dt>
+<dd><%= view.value.dh %><% -- html.link{value = page_info.script .. page_info.prefix .. page_info.controller .. "/pem_info?name=" .. view.value.dh , label=view.value.dh } %></dd>
+<% end %>
+
+<% if (view.value.ca) then %>
+<dt>CA Certificate</dt>
+<dd><%= view.value.ca %><% -- html.link{value = page_info.script .. page_info.prefix .. page_info.controller .. "/pem_info?name=" .. view.value.ca , label=view.value.ca } %></dd>
+<% end %>
+
+<% if (view.value.cert) then %>
+<dt>Certificate</dt>
+<dd><%= view.value.cert %><% -- html.link{value = page_info.script .. page_info.prefix .. page_info.controller .. "/pem_info?name=" .. view.value.cert , label=view.value.cert } %></dd>
+<% end %>
+
+<% if (view.value.key) then %>
+<dt>Private Key</dt>
+<dd><%= view.value.key %><% -- html.link{value = page_info.script .. page_info.prefix .. page_info.controller .. "/pem_info?name=" .. view.value.key , label=view.value.key } %></dd>
+<% end %>
+
+<% if (view.value.tls) then %>
+<dt>TLS Authentication</dt>
+<dd><%= view.value.tls %><% -- html.link{value = page_info.script .. page_info.prefix .. page_info.controller .. "/pem_info?name=" .. view.value.tls , label=view.value.tls } %></dd>
+<% end %>
+
+<% if (view.value.crl) then %>
+<dt>CRL Verify File</dt>
+<dd><%= view.value.crl %><% -- html.link{value = page_info.script .. page_info.prefix .. page_info.controller .. "/pem_info?name=" .. view.value.crl , label=view.value.crl } %></dd>
+<% end %>
+</dl>
+<% end %>