summaryrefslogtreecommitdiff
path: root/data/templates/conserver/conserver.conf.tmpl
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-06-18 18:55:22 +0200
committerChristian Poessinger <christian@poessinger.com>2020-06-18 21:46:13 +0200
commitb242e24af4d870e936155bdbd965858bdd39aa98 (patch)
tree1f71fcc56ba12fe3bc3ad9633bf5e611607bf9d6 /data/templates/conserver/conserver.conf.tmpl
parenta1ba7bae02673aca63a7006cf683ad5d541a5054 (diff)
downloadvyos-1x-b242e24af4d870e936155bdbd965858bdd39aa98.tar.gz
vyos-1x-b242e24af4d870e936155bdbd965858bdd39aa98.zip
console-server: T2490: move CLI parsing to get_config_dict()
For more examples on the new get_config_dict() approach migrate this implementation as it is not yet in production use. Also this serves as proof of concept code for further migrations.
Diffstat (limited to 'data/templates/conserver/conserver.conf.tmpl')
-rw-r--r--data/templates/conserver/conserver.conf.tmpl38
1 files changed, 38 insertions, 0 deletions
diff --git a/data/templates/conserver/conserver.conf.tmpl b/data/templates/conserver/conserver.conf.tmpl
new file mode 100644
index 000000000..ec0eca5f0
--- /dev/null
+++ b/data/templates/conserver/conserver.conf.tmpl
@@ -0,0 +1,38 @@
+### Autogenerated by service_serial-proxy.py ###
+
+# See https://www.conserver.com/docs/conserver.cf.man.html for additional options
+
+config * {
+}
+
+default * {
+ motd "VyOS Console Server"
+ # The character '&' in logfile names are substituted with the console name.
+ logfile /var/log/conserver/&.log;
+ timestamp "30m";
+ rw *;
+}
+
+##
+## list of consoles we serve
+##
+{% for key, value in device.items() %}
+{# Depending on our USB serial console we could require a path adjustment #}
+{% set path = '/dev' if key.startswith('ttyS') else '/dev/serial/by-bus' %}
+console {{ key }} {
+ master localhost;
+ type device;
+ device {{ path }}/{{ key }};
+ baud {{ value.speed }};
+ parity {{ value.parity }};
+ options {{ "!" if value.stop_bits == "1" }}cstopb;
+}
+{% endfor %}
+
+##
+## list of clients we allow
+##
+access * {
+ trusted 127.0.0.1;
+ allowed 127.0.0.1;
+}