Module: Net::Openvpn
- Defined in:
- lib/net/openvpn.rb,
lib/net/openvpn/host.rb,
lib/net/openvpn/errors.rb,
lib/net/openvpn/server.rb,
lib/net/openvpn/version.rb,
lib/net/openvpn/client_config.rb,
lib/net/openvpn/generators/keys/base.rb,
lib/net/openvpn/parser/server_config.rb,
lib/net/openvpn/generators/keys/client.rb,
lib/net/openvpn/generators/keys/server.rb,
lib/net/openvpn/generators/keys/authority.rb,
lib/net/openvpn/generators/keys/directory.rb,
lib/net/openvpn/generators/keys/properties.rb
Defined Under Namespace
Modules: Errors, Generators, Parser
Classes: ClientConfig, Host, Server
Constant Summary
collapse
- Client =
Net::Openvpn::Host
- VERSION =
"0.8"
Class Method Summary
collapse
Class Method Details
.basepath(path = "") ⇒ Object
20
21
22
23
|
# File 'lib/net/openvpn.rb', line 20
def basepath(path="")
path = "/#{path}" unless path.empty?
"/etc/openvpn#{path}"
end
|
.ccdpath(path = "") ⇒ Object
25
26
27
28
|
# File 'lib/net/openvpn.rb', line 25
def ccdpath(path="")
path = "/#{path}" unless path.empty?
basepath "ccd#{path}"
end
|
.generator(type) ⇒ Object
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/net/openvpn.rb', line 38
def generator(type)
case type
when :client
Net::Openvpn::Generators::Keys::Client
when :server
Net::Openvpn::Generators::Keys::Server
when :directory
Net::Openvpn::Generators::Keys::Directory
when :authority
Net::Openvpn::Generators::Keys::Authority
end
end
|
.host(hostname) ⇒ Object
30
31
32
|
# File 'lib/net/openvpn.rb', line 30
def host(hostname)
Net::Openvpn::Host.new(hostname)
end
|
.props ⇒ Object
Returns the default key properties merged with the properties stored in /etc/openvpn/props.yml
53
54
55
56
57
|
# File 'lib/net/openvpn.rb', line 53
def props
props = Openvpn::Generators::Keys::Properties
props.default.merge props.yaml
end
|
.server(name) ⇒ Object
34
35
36
|
# File 'lib/net/openvpn.rb', line 34
def server(name)
Net::Openvpn::Server.new(name)
end
|