summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-18 12:38:47 +0200
committerChristian Poessinger <christian@poessinger.com>2020-04-18 14:31:51 +0200
commit267b3213ef0e6ac4501470bef797796276879421 (patch)
tree7d2ede2263d72ea3c3ac03f735ba8932da8181b7
parent901d5e89ec6e3fb0f3d13f90f0495a4dda592454 (diff)
downloadvyos-1x-267b3213ef0e6ac4501470bef797796276879421.tar.gz
vyos-1x-267b3213ef0e6ac4501470bef797796276879421.zip
accel-ppp: T2314: use common tempplate for chap-secrets
-rw-r--r--data/templates/accel-ppp/chap-secrets.tmpl (renamed from data/templates/l2tp/chap-secrets.tmpl)0
-rw-r--r--data/templates/accel-ppp/l2tp.config.tmpl (renamed from data/templates/l2tp/l2tp.config.tmpl)1
-rw-r--r--data/templates/accel-ppp/pppoe.config.tmpl (renamed from data/templates/pppoe-server/pppoe.config.tmpl)0
-rw-r--r--data/templates/accel-ppp/sstp.config.tmpl (renamed from data/templates/sstp/sstp.config.tmpl)1
-rw-r--r--data/templates/pppoe-server/chap-secrets.tmpl10
-rw-r--r--data/templates/sstp/chap-secrets.tmpl10
-rwxr-xr-xsrc/conf_mode/service_pppoe-server.py4
-rwxr-xr-xsrc/conf_mode/vpn_l2tp.py4
-rwxr-xr-xsrc/conf_mode/vpn_sstp.py4
9 files changed, 6 insertions, 28 deletions
diff --git a/data/templates/l2tp/chap-secrets.tmpl b/data/templates/accel-ppp/chap-secrets.tmpl
index dd00d7bd0..dd00d7bd0 100644
--- a/data/templates/l2tp/chap-secrets.tmpl
+++ b/data/templates/accel-ppp/chap-secrets.tmpl
diff --git a/data/templates/l2tp/l2tp.config.tmpl b/data/templates/accel-ppp/l2tp.config.tmpl
index 84f544203..ebe3aca29 100644
--- a/data/templates/l2tp/l2tp.config.tmpl
+++ b/data/templates/accel-ppp/l2tp.config.tmpl
@@ -143,4 +143,3 @@ vendor={{ radius_shaper_vendor }}
[cli]
tcp=127.0.0.1:2004
sessions-columns=ifname,username,calling-sid,ip,{{ ip6_column | join(',') }}{{ ',' if ip6_column }}rate-limit,type,comp,state,rx-bytes,tx-bytes,uptime
-
diff --git a/data/templates/pppoe-server/pppoe.config.tmpl b/data/templates/accel-ppp/pppoe.config.tmpl
index 325b75adc..325b75adc 100644
--- a/data/templates/pppoe-server/pppoe.config.tmpl
+++ b/data/templates/accel-ppp/pppoe.config.tmpl
diff --git a/data/templates/sstp/sstp.config.tmpl b/data/templates/accel-ppp/sstp.config.tmpl
index acdb6c76b..c3dc83429 100644
--- a/data/templates/sstp/sstp.config.tmpl
+++ b/data/templates/accel-ppp/sstp.config.tmpl
@@ -112,4 +112,3 @@ vendor={{ radius_shaper_vendor }}
[cli]
tcp=127.0.0.1:2005
-
diff --git a/data/templates/pppoe-server/chap-secrets.tmpl b/data/templates/pppoe-server/chap-secrets.tmpl
deleted file mode 100644
index dd00d7bd0..000000000
--- a/data/templates/pppoe-server/chap-secrets.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-# username server password acceptable local IP addresses shaper
-{% for user in local_users %}
-{% if user.state == 'enabled' %}
-{% if user.upload and user.download %}
-{{ "%-12s" | format(user.name) }} * {{ "%-16s" | format(user.password) }} {{ "%-16s" | format(user.ip) }} {{ user.download }} / {{ user.upload }}
-{% else %}
-{{ "%-12s" | format(user.name) }} * {{ "%-16s" | format(user.password) }} {{ "%-16s" | format(user.ip) }}
-{% endif %}
-{% endif %}
-{% endfor %}
diff --git a/data/templates/sstp/chap-secrets.tmpl b/data/templates/sstp/chap-secrets.tmpl
deleted file mode 100644
index dd00d7bd0..000000000
--- a/data/templates/sstp/chap-secrets.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-# username server password acceptable local IP addresses shaper
-{% for user in local_users %}
-{% if user.state == 'enabled' %}
-{% if user.upload and user.download %}
-{{ "%-12s" | format(user.name) }} * {{ "%-16s" | format(user.password) }} {{ "%-16s" | format(user.ip) }} {{ user.download }} / {{ user.upload }}
-{% else %}
-{{ "%-12s" | format(user.name) }} * {{ "%-16s" | format(user.password) }} {{ "%-16s" | format(user.ip) }}
-{% endif %}
-{% endif %}
-{% endfor %}
diff --git a/src/conf_mode/service_pppoe-server.py b/src/conf_mode/service_pppoe-server.py
index aa8b9d141..13d0b1920 100755
--- a/src/conf_mode/service_pppoe-server.py
+++ b/src/conf_mode/service_pppoe-server.py
@@ -422,10 +422,10 @@ def generate(pppoe):
if not os.path.exists(dirname):
os.mkdir(dirname)
- render(pppoe_conf, 'pppoe-server/pppoe.config.tmpl', c, trim_blocks=True)
+ render(pppoe_conf, 'accel-ppp/pppoe.config.tmpl', c, trim_blocks=True)
if pppoe['local_users']:
- render(pppoe_chap_secrets, 'pppoe-server/chap-secrets.tmpl', c, trim_blocks=True)
+ render(pppoe_chap_secrets, 'accel-ppp/chap-secrets.tmpl', c, trim_blocks=True)
os.chmod(pppoe_chap_secrets, S_IRUSR | S_IWUSR | S_IRGRP)
else:
if os.path.exists(pppoe_chap_secrets):
diff --git a/src/conf_mode/vpn_l2tp.py b/src/conf_mode/vpn_l2tp.py
index 331f22465..417520e09 100755
--- a/src/conf_mode/vpn_l2tp.py
+++ b/src/conf_mode/vpn_l2tp.py
@@ -348,10 +348,10 @@ def generate(l2tp):
if not os.path.exists(dirname):
os.mkdir(dirname)
- render(l2tp_conf, 'l2tp/l2tp.config.tmpl', c, trim_blocks=True)
+ render(l2tp_conf, 'accel-ppp/l2tp.config.tmpl', c, trim_blocks=True)
if l2tp['auth_mode'] == 'local':
- render(l2tp_chap_secrets, 'l2tp/chap-secrets.tmpl', l2tp)
+ render(l2tp_chap_secrets, 'accel-ppp/chap-secrets.tmpl', l2tp)
os.chmod(l2tp_chap_secrets, S_IRUSR | S_IWUSR | S_IRGRP)
else:
diff --git a/src/conf_mode/vpn_sstp.py b/src/conf_mode/vpn_sstp.py
index 7c96241b1..9ec352290 100755
--- a/src/conf_mode/vpn_sstp.py
+++ b/src/conf_mode/vpn_sstp.py
@@ -312,10 +312,10 @@ def generate(sstp):
os.mkdir(dirname)
# accel-cmd reload doesn't work so any change results in a restart of the daemon
- render(sstp_conf, 'sstp/sstp.config.tmpl', sstp, trim_blocks=True)
+ render(sstp_conf, 'accel-ppp/sstp.config.tmpl', sstp, trim_blocks=True)
if sstp['local_users']:
- render(sstp_chap_secrets, 'sstp/chap-secrets.tmpl', sstp, trim_blocks=True)
+ render(sstp_chap_secrets, 'accel-ppp/chap-secrets.tmpl', sstp, trim_blocks=True)
os.chmod(sstp_chap_secrets, S_IRUSR | S_IWUSR | S_IRGRP)
else:
if os.path.exists(sstp_chap_secrets):