|
| 1 | +; Autogenerated by service_stunnel.py |
| 2 | + |
| 3 | +; Example https://www.stunnel.org/config_unix.html# |
| 4 | +; ************************************************************************** |
| 5 | +; * Global options * |
| 6 | +; ************************************************************************** |
| 7 | + |
| 8 | +; PID file is created inside the chroot jail (if enabled) |
| 9 | +pid = {{ config_file | replace('.conf', '.pid') }} |
| 10 | + |
| 11 | +; Debugging stuff (may be useful for troubleshooting) |
| 12 | +;foreground = yes |
| 13 | + |
| 14 | +{% if log is vyos_defined %} |
| 15 | +debug = {{ log.level }} |
| 16 | +{% endif %} |
| 17 | + |
| 18 | +;output = /usr/local/var/log/stunnel.log |
| 19 | + |
| 20 | + |
| 21 | +; ************************************************************************** |
| 22 | +; * Service definitions * |
| 23 | +; ************************************************************************** |
| 24 | + |
| 25 | +; ***************************************** Client mode services *********** |
| 26 | + |
| 27 | +{% if client is vyos_defined %} |
| 28 | +{% for name, config in client.items() %} |
| 29 | +[{{ name }}] |
| 30 | +client = yes |
| 31 | +{% if config.listen.address is vyos_defined %} |
| 32 | +accept = {{ config.listen.address }}:{{ config.listen.port }} |
| 33 | +{% else %} |
| 34 | +accept = {{ config.listen.port }} |
| 35 | +{% endif %} |
| 36 | +{% if config.connect is vyos_defined %} |
| 37 | +{% if config.connect.address is vyos_defined %} |
| 38 | +connect = {{ config.connect.address }}:{{ config.connect.port }} |
| 39 | +{% else %} |
| 40 | +connect = {{ config.connect.port }} |
| 41 | +{% endif %} |
| 42 | +{% endif %} |
| 43 | +{% if config.protocol is vyos_defined %} |
| 44 | +protocol = {{ config.protocol }} |
| 45 | +{% endif %} |
| 46 | +{% if config.options is vyos_defined %} |
| 47 | +{% if config.options.authentication is vyos_defined %} |
| 48 | +protocolAuthentication = {{ config.options.authentication }} |
| 49 | +{% endif %} |
| 50 | +{% if config.options.domain is vyos_defined %} |
| 51 | +protocolDomain = {{ config.options.domain }} |
| 52 | +{% endif %} |
| 53 | +{% if config.options.host is vyos_defined %} |
| 54 | +protocolHost = {{ config.options.host.address }}:{{ config.options.host.port }} |
| 55 | +{% endif %} |
| 56 | +{% if config.options.password is vyos_defined %} |
| 57 | +protocolPassword = {{ config.options.password }} |
| 58 | +{% endif %} |
| 59 | +{% if config.options.username is vyos_defined %} |
| 60 | +protocolUsername = {{ config.options.username }} |
| 61 | +{% endif %} |
| 62 | +{% endif %} |
| 63 | +{% if config.ssl.ca_path is vyos_defined %} |
| 64 | +CApath = {{ config.ssl.ca_path }} |
| 65 | +{% endif %} |
| 66 | +{% if config.ssl.ca_file is vyos_defined %} |
| 67 | +CAfile = {{ config.ssl.ca_file }} |
| 68 | +{% endif %} |
| 69 | +{% if config.ssl.cert is vyos_defined %} |
| 70 | +cert = {{ config.ssl.cert }} |
| 71 | +{% endif %} |
| 72 | +{% if config.ssl.cert_key is vyos_defined %} |
| 73 | +key = {{ config.ssl.cert_key }} |
| 74 | +{% endif %} |
| 75 | +{% if config.psk.file is vyos_defined %} |
| 76 | +PSKsecrets = {{ config.psk.file }} |
| 77 | +{% endif %} |
| 78 | +{% endfor %} |
| 79 | +{% endif %} |
| 80 | + |
| 81 | + |
| 82 | +; ***************************************** Server mode services *********** |
| 83 | + |
| 84 | +{% if server is vyos_defined %} |
| 85 | +{% for name, config in server.items() %} |
| 86 | +[{{ name }}] |
| 87 | +{% if config.listen.address is vyos_defined %} |
| 88 | +accept = {{ config.listen.address }}:{{ config.listen.port }} |
| 89 | +{% else %} |
| 90 | +accept = {{ config.listen.port }} |
| 91 | +{% endif %} |
| 92 | +{% if config.connect is vyos_defined %} |
| 93 | +{% if config.connect.address is vyos_defined %} |
| 94 | +connect = {{ config.connect.address }}:{{ config.connect.port }} |
| 95 | +{% else %} |
| 96 | +connect = {{ config.connect.port }} |
| 97 | +{% endif %} |
| 98 | +{% endif %} |
| 99 | +{% if config.protocol is vyos_defined %} |
| 100 | +protocol = {{ config.protocol }} |
| 101 | +{% endif %} |
| 102 | +{% if config.ssl.ca_path is vyos_defined %} |
| 103 | +CApath = {{ config.ssl.ca_path }} |
| 104 | +{% endif %} |
| 105 | +{% if config.ssl.ca_file is vyos_defined %} |
| 106 | +CAfile = {{ config.ssl.ca_file }} |
| 107 | +{% endif %} |
| 108 | +{% if config.ssl.cert is vyos_defined %} |
| 109 | +cert = {{ config.ssl.cert }} |
| 110 | +{% endif %} |
| 111 | +{% if config.ssl.cert_key is vyos_defined %} |
| 112 | +key = {{ config.ssl.cert_key }} |
| 113 | +{% endif %} |
| 114 | +{% if config.psk.file is vyos_defined %} |
| 115 | +PSKsecrets = {{ config.psk.file }} |
| 116 | +{% endif %} |
| 117 | +{% endfor %} |
| 118 | +{% endif %} |
0 commit comments