From 723453ae5dced317e70f6597efe17b4872ea35a2 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Mon, 19 Nov 2007 14:43:46 +0000 Subject: Building up ideas on different functions git-svn-id: svn://svn.alpinelinux.org/acf/openvpn/trunk@335 ab2d0c66-481e-0410-8bed-d214d4d58bed --- openvpn-client_config-html.lsp | 66 +++++++++++++++++++++++++++++++++++++++++ openvpn-controller.lua | 19 +++++++++++- openvpn-logfile-html.lsp | 12 ++++++++ openvpn-model.lua | 15 ++++++++++ openvpn-pem_info-html.lsp | 40 +++++++++++++++++++++++++ openvpn-read-html.lsp | 4 +-- openvpn-server_config-html.lsp | 34 +++++++++++++-------- openvpn-status_info-html.lsp | 40 +++++++++++++++++++++++++ openvpn-unknown_config-html.lsp | 12 ++++++++ 9 files changed, 226 insertions(+), 16 deletions(-) create mode 100644 openvpn-client_config-html.lsp create mode 100644 openvpn-logfile-html.lsp create mode 100644 openvpn-pem_info-html.lsp create mode 100644 openvpn-status_info-html.lsp create mode 100644 openvpn-unknown_config-html.lsp diff --git a/openvpn-client_config-html.lsp b/openvpn-client_config-html.lsp new file mode 100644 index 0000000..cd0c754 --- /dev/null +++ b/openvpn-client_config-html.lsp @@ -0,0 +1,66 @@ + + + +

Client config 'xxx.conf'

+

Client settings

+ +
Mode
+
client
+ +
User device
+
xxx
+ +
Remote server
+
xxx.xxx.xxx.xxx:xxxx (xxx)
+ +
Logfile
+
(Verbosity level: x)
+ +
Configfile
+
+ +

Client properties

+ +
Common name
+
xxx
+ +
Virtual address
+
xxx.xxx.xxx.xxx
+ +
Real address
+
xxx.xxx.xxx.xxx:xxxx
+ +

Startup options

+ +
Process running
+
xxx
+ +
Init.d script exists
+
xxx
+ +
Autostarts at boot
+
xxx
+ +

Certificate files

+ +
DH
+
+ +
CA Certificate
+
+ +
Client Certificate
+
+ +
Client Private Key
+
+ +
TLS Authentication
+
+ +
CRL Verify File
+
(client side)
+ + + + diff --git a/openvpn-controller.lua b/openvpn-controller.lua index b088758..a0c973b 100644 --- a/openvpn-controller.lua +++ b/openvpn-controller.lua @@ -115,7 +115,7 @@ end read = function (self) local me = {} me = cfe{name=conflistfilesaf, value="hej"} - return ( {conflistfiles = self.model:list_conffiles()} ) + return ( {conflistfiles = self.model:list_conffiles(), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller} ) -- return ({conflistfiles = me}) -- return self.model:get() -- return build_form(self) @@ -123,6 +123,23 @@ end server_config = function (self) + return ( {url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller} ) +end + +client_config = function (self) + return ( {url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller} ) +end + +pem_info = function (self) +end + +status_info = function (self) +end + +unknown_config = function (self) +end + +logfile = function (self) end create = update diff --git a/openvpn-logfile-html.lsp b/openvpn-logfile-html.lsp new file mode 100644 index 0000000..c1db75e --- /dev/null +++ b/openvpn-logfile-html.lsp @@ -0,0 +1,12 @@ + + + +

Logfile 'xxx.log'

+ +

Details

+ + + + + + diff --git a/openvpn-model.lua b/openvpn-model.lua index c5210b3..4e60764 100644 --- a/openvpn-model.lua +++ b/openvpn-model.lua @@ -21,6 +21,21 @@ local function read_file_as_array ( path ) return f end + +local is_running = function( process ) + local retval = false + local file = io.popen("pidof " .. process) + if file ~= nil then + local line = file:read( "*l" ) + file:close() + if #line > 0 then + retval = true + end + end + + return retval +end + local function has_init_script ( f ) local initprefix = "/etc/init.d/openvpn" local file = initprefix .. "." .. f diff --git a/openvpn-pem_info-html.lsp b/openvpn-pem_info-html.lsp new file mode 100644 index 0000000..028ba03 --- /dev/null +++ b/openvpn-pem_info-html.lsp @@ -0,0 +1,40 @@ + + + +

Certificate Info 'xxx.conf'

+

General

+ +
Serial
+
xxx
+ +
Common name
+
xxx
+ +
Country
+
xxx
+ +
State or Province
+
xxx
+ +
City
+
xxx
+ +
Company
+
xxx
+ +
Departement II
+
xxx
+ +
e-mail
+
xxx
+ +
Status
+
xxx
+ +

Certificate Details

+ + + + + + diff --git a/openvpn-read-html.lsp b/openvpn-read-html.lsp index 521e6b3..6854054 100644 --- a/openvpn-read-html.lsp +++ b/openvpn-read-html.lsp @@ -5,7 +5,7 @@ ]]-- ?> -

General

+

Welcome

Available configs

@@ -17,7 +17,7 @@ - + diff --git a/openvpn-server_config-html.lsp b/openvpn-server_config-html.lsp index 41b28c5..6c26398 100644 --- a/openvpn-server_config-html.lsp +++ b/openvpn-server_config-html.lsp @@ -7,9 +7,6 @@
Mode
server
-
Process running
-
xxx
-
User device
xxx
@@ -17,42 +14,53 @@
xxx.xxx.xxx.xxx:xxxx (xxx)
Logfile
-
xxx.log (Verbosity level: x)
+
(Verbosity level: x)
Configfile
-
xxx.conf
+

Connected clients status

Last status was recorded
-
YYYY-MM-DD HH:MM:SS (xx minutes ago)
+
YYYY-MM-DD HH:MM:SS (xx minutes ago)
Maximum clients
xxx
Connected clients
-
xxx
+
+ +

Startup options

+ +
Process running
+
xxx
+ +
Init.d script exists
+
xxx
+ +
Autostarts at boot
+
xxx

Certificate files

DH
-
xxx.pem
+
CA Certificate
-
xxx.pem
+
Server Certificate
-
xxx.pem
+
Server Private Key
-
xxx.pem
+
TLS Authentication
-
xxx.pem
+
CRL Verify File
-
xxx.pem (server side)
+
(server side)
diff --git a/openvpn-status_info-html.lsp b/openvpn-status_info-html.lsp new file mode 100644 index 0000000..e538cd1 --- /dev/null +++ b/openvpn-status_info-html.lsp @@ -0,0 +1,40 @@ + + + +

Status

+

Connected clients

+ +
xxx
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Common Name
Connected at
Virtual AddressReal AddressBytes ReceivedBytes Sent
XXXXXX.XXX.XXX.XXXXXX.XXX.XXX.XXX:XXXXXXXXXXXX
YYYY-MM-DD HH:MM:SS (Which is xx minutes ago)
XXXXXX.XXX.XXX.XXXXXX.XXX.XXX.XXX:XXXXXXXXXXXX
YYYY-MM-DD HH:MM:SS (Which is xx minutes ago)
+ + diff --git a/openvpn-unknown_config-html.lsp b/openvpn-unknown_config-html.lsp new file mode 100644 index 0000000..26787c5 --- /dev/null +++ b/openvpn-unknown_config-html.lsp @@ -0,0 +1,12 @@ + + + +

Configuration file 'xxx.conf'

+ +

Details

+ + + + + + -- cgit v1.2.3