diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-03-20 16:39:50 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-03-20 17:04:37 +0100 |
commit | 77dde087219467ce8bfcf64a9f7452ca74d66c0c (patch) | |
tree | a89847911b043c263c99533ba7573e31d8993ada /src/conf_mode | |
parent | ee23ba04b9eb4003354c5426ab4c77d3103765b2 (diff) | |
download | vyos-1x-77dde087219467ce8bfcf64a9f7452ca74d66c0c.tar.gz vyos-1x-77dde087219467ce8bfcf64a9f7452ca74d66c0c.zip |
sstp: T2008: move to vpn node
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/vpn_sstp.py (renamed from src/conf_mode/accel_sstp.py) | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/conf_mode/accel_sstp.py b/src/conf_mode/vpn_sstp.py index 1317a32db..12d62ad70 100755 --- a/src/conf_mode/accel_sstp.py +++ b/src/conf_mode/vpn_sstp.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2018 VyOS maintainers and contributors +# Copyright (C) 2018-2020 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -13,8 +13,6 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -# -# import sys import os @@ -44,7 +42,7 @@ if not os.path.exists(ssl_cert_dir): sl.syslog(sl.LOG_NOTICE, ssl_cert_dir + " created") sstp_config = ''' -### generated by accel_sstp.py ### +### generated by vpn_sstp.py ### [modules] log_syslog sstp @@ -187,7 +185,7 @@ chap_secrets_conf = ''' ### # depending on hw and threads, daemon needs a little to start # if it takes longer than 100 * 0.5 secs, exception is being raised -# not sure if that's the best way to check it, but it worked so far quite well +# not sure if that's the best way to check it, but it worked so far quite well ### def chk_con(): cnt = 0 @@ -225,16 +223,17 @@ def accel_cmd(cmd=''): #### check ig local-ip is in client pool subnet -### +### # inline helper functions end ### def get_config(): + base_path = ['vpn', 'sstp'] c = Config() - if not c.exists('service sstp-server'): + if not c.exists(base_path): return None - c.set_level('service sstp-server') + c.set_level(base_path) config_data = { 'authentication' : { @@ -332,7 +331,7 @@ def get_config(): } } ) - if c.exists('authentication radius-settings rate-limit enable'): + if c.exists('authentication radius-settings rate-limit enable'): if not c.exists('authentication radius-settings rate-limit attribute'): config_data['authentication']['radiusopt']['shaper'] = { 'attr' : 'Filter-Id' } else: @@ -411,14 +410,14 @@ def verify(c): if c['authentication']['mode'] == 'local': if not c['ip_pool']: - print ("WARNING: service sstp-server network-settings client-ip-settings subnet requires a value") + print ("WARNING: service sstp-server network-settings client-ip-settings subnet requires a value") if not c['gw']: print ("WARNING: service sstp-server network-settings client-ip-settings gateway-address requires a value") - + def generate(c): if c == None: return None - + ### accel-cmd reload doesn't work so any change results in a restart of the daemon try: if os.cpu_count() == 1: |