Commit 942439d5 authored by Julien Muchembled's avatar Julien Muchembled

Create sample configuration file when registering

parent b3c1bb18
...@@ -36,6 +36,7 @@ def main(): ...@@ -36,6 +36,7 @@ def main():
config = parser.parse_args() config = parser.parse_args()
if config.dir: if config.dir:
os.chdir(config.dir) os.chdir(config.dir)
conf_path = 're6stnet.conf'
ca_path = 'ca.crt' ca_path = 'ca.crt'
cert_path = 'cert.crt' cert_path = 'cert.crt'
key_path = 'cert.key' key_path = 'cert.key'
...@@ -125,6 +126,25 @@ def main(): ...@@ -125,6 +126,25 @@ def main():
print "Certificate setup complete." print "Certificate setup complete."
if not os.path.lexists(conf_path):
create(conf_path, """\
registry %s
ca %s
cert %s
key %s
dh %s
# for udp only:
#pp 1194 udp
# increase re6stnet verbosity:
#verbose 3
# enable OpenVPN logging:
#ovpnlog
# increase OpenVPN verbosity:
#O--verb
#O3
""" % (config.registry, ca_path, cert_path, key_path, dh_path))
print "Sample configuration file created."
cn = utils.subnetFromCert(cert_path) cn = utils.subnetFromCert(cert_path)
subnet = utils.networkFromCa(ca_path) + utils.binFromSubnet(cn) subnet = utils.networkFromCa(ca_path) + utils.binFromSubnet(cn)
print "Your subnet: %s/%u (CN=%s)" \ print "Your subnet: %s/%u (CN=%s)" \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment