From b242e24af4d870e936155bdbd965858bdd39aa98 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 18 Jun 2020 18:55:22 +0200 Subject: 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. --- data/templates/conserver/conserver.conf.tmpl | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 data/templates/conserver/conserver.conf.tmpl (limited to 'data/templates/conserver') 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; +} -- cgit v1.2.3