3 Parses Tinc VPN configuration files
5 Author: Thomas Weißschuh <thomas.weissschuh@amadeus.com>
8 This file is licensed under the LGPL v2+, like the rest of Augeas.
15 let no_spaces_no_equals = /[^ \t\r\n=]+/
16 let assign = del (/[ \t]*[= ][ \t]*/) " = "
17 let del_str = Util.del_str
19 let entry = Build.key_value_line /[A-Za-z]+/ assign (store no_spaces_no_equals)
21 let key_section_start = "-----BEGIN RSA PUBLIC KEY-----\n"
22 let key_section_end = "\n-----END RSA PUBLIC KEY-----"
23 (* the last line does not include a newline *)
24 let base_64 = /[A-Za-z0-9+\/=\n]+[A-Za-z0-9+\/=]/
25 let key_section = del_str key_section_start .
26 (label "#key" . store base_64) .
27 del_str key_section_end
29 (* we only support a single key section *)
30 let lns = (Util.comment | Util.empty | entry) * . [(key_section . Util.empty *)]?
32 let filter = incl "/etc/tinc.conf"
33 . incl "/etc/tinc/*/tinc.conf"
34 . incl "/etc/tinc/hosts/*"
35 . incl "/etc/tinc/*/hosts/*"
37 let xfm = transform lns filter