WIP: cli/node.py
Showing
... | @@ -130,6 +130,8 @@ def getConfig(): | ... | @@ -130,6 +130,8 @@ def getConfig(): |
def main(): | def main(): | ||
# Get arguments | # Get arguments | ||
config = getConfig() | config = getConfig() | ||
# ca: certifcate authority certificate, key: node private key, cert: node public certificate | |||
# verifies cert has been signed by ca | |||
cert = x509.Cert(config.ca, config.key, config.cert) | cert = x509.Cert(config.ca, config.key, config.cert) | ||
config.openvpn_args += cert.openvpn_args | config.openvpn_args += cert.openvpn_args | ||
... | @@ -146,7 +148,9 @@ def main(): | ... | @@ -146,7 +148,9 @@ def main(): |
if config.ovpnlog: | if config.ovpnlog: | ||
plib.ovpn_log = config.log | plib.ovpn_log = config.log | ||
# If program receives SIGINT or SIGTERM, exit with status 0 | |||
|
|||
exit.signal(0, signal.SIGINT, signal.SIGTERM) | exit.signal(0, signal.SIGINT, signal.SIGTERM) | ||
# If program receives SIGHUP or SIGUSR2, exit with status -1 | |||
exit.signal(-1, signal.SIGHUP, signal.SIGUSR2) | exit.signal(-1, signal.SIGHUP, signal.SIGUSR2) | ||
cache = Cache(db_path, config.registry, cert) | cache = Cache(db_path, config.registry, cert) | ||
... | ... |