feature: users sign in to the web service, and only members of admins manage the router.
Release / release (push) Failing after 16m57s
Release / release (push) Failing after 16m57s
This commit is contained in:
1 parent
791fc7fddd
commit
caf0e334f0
17 files changed
+792
-177
No files matched your search
@@ -23,6 +23,7 @@ sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
|
||||
import ldap
|
||||
|
||||
import vpnrouter
|
||||
import vpnrouter_auth
|
||||
import vpnrouter_ldap
|
||||
from vpnrouter import fail
|
||||
|
||||
@@ -39,7 +40,7 @@ MANAGER_PORT = 7080
|
||||
FILTER_ANCHOR = '# End required lines'
|
||||
|
||||
#: Configuration options left out wherever the configuration is shown.
|
||||
SECRET_OPTION = re.compile(r'(^psk$)|secret|password|token|_key$')
|
||||
SECRET_OPTION = re.compile(r'(^psk$)|secret|password|token|_key$|^database$')
|
||||
|
||||
BLOCKS = (
|
||||
('# IPSEC RULES START', '# IPSEC RULES END'),
|
||||
@@ -357,6 +358,15 @@ def manage_directory():
|
||||
fail(f'the user directory cannot be provisioned: {exc}')
|
||||
|
||||
|
||||
def manage_tokens(cfg):
|
||||
"""Make the web service's signing key, and the database of its refresh tokens unless web.database names one."""
|
||||
vpnrouter_auth.ensure_key()
|
||||
try:
|
||||
vpnrouter_auth.provision(cfg)
|
||||
except OSError as exc:
|
||||
fail(f'the token database cannot be provisioned: {exc}')
|
||||
|
||||
|
||||
def manage_openvpn(ctx, changed):
|
||||
"""Run the OpenVPN server when it is configured, and stop it when it is not."""
|
||||
unit = 'openvpn-server@vpn-router'
|
||||
@@ -464,6 +474,7 @@ def main():
|
||||
run(['ufw', 'reload'], check=False)
|
||||
|
||||
manage_directory()
|
||||
manage_tokens(cfg)
|
||||
manage_strongswan(ctx, changed)
|
||||
manage_wireguard(ctx, changed)
|
||||
manage_openvpn(ctx, changed)
|
||||
|
||||
Reference in new issue
Block a user