diff options
author | April King <april@mozilla.com> | 2019-07-17 00:20:54 +0300 |
---|---|---|
committer | April King <april@mozilla.com> | 2019-07-17 00:20:54 +0300 |
commit | 89edf121761ba4507382dbec4f00b1b31da55e99 (patch) | |
tree | 8079527f580e1f4f1ce519f0cd461f94f8914419 | |
parent | 8e726dbbad1aec5c95e76d1f90c1b0836b9058f7 (diff) |
Add beta support for Traefik
-rw-r--r-- | README.md | 3 | ||||
-rwxr-xr-x | src/js/configs.js | 4 | ||||
-rw-r--r-- | src/js/helpers/eq.js | 3 | ||||
-rw-r--r-- | src/templates/partials/traefik.hbs | 30 |
4 files changed, 38 insertions, 2 deletions
@@ -29,7 +29,8 @@ There are two places that need to be updated in order to add support for a new p All of the templates are written in [Handlebars.js](https://handlebarsjs.com/), and so therefore support all of its standard features. This includes `if`/`else`/`unless` conditionals and `each` loops, for example. In addition, the configuration generator supports the following helpers: -- `includes(item, stringOrArray`) - `true` if `stringOrArray` contains `item` +- `eq(item, value)` - `true` if `item` equals `value` +- `includes(item, stringOrArray)` - `true` if `stringOrArray` contains `item` - `join(array, joiner)` - split a array into a string based on `joiner` - `{{{join output.ciphers ":"}}}` - `last(array)` - returns the last item in the array diff --git a/src/js/configs.js b/src/js/configs.js index e5aafb9..7c03356 100755 --- a/src/js/configs.js +++ b/src/js/configs.js @@ -89,11 +89,13 @@ module.exports = { tls13: '12.0', }, traefik: { + cipherFormat: 'iana', highlighter: 'toml', latestVersion: '1.7.12', - name: 'Traefik', + name: 'Traefik (beta)', supportsHsts: true, supportsOcspStapling: false, // https://github.com/containous/traefik/issues/212 tls13: '2.0.0', + usesOpenssl: false, }, }; diff --git a/src/js/helpers/eq.js b/src/js/helpers/eq.js new file mode 100644 index 0000000..7fe29aa --- /dev/null +++ b/src/js/helpers/eq.js @@ -0,0 +1,3 @@ +export default (item, value) => { + return item === value; +}; diff --git a/src/templates/partials/traefik.hbs b/src/templates/partials/traefik.hbs new file mode 100644 index 0000000..f22b870 --- /dev/null +++ b/src/templates/partials/traefik.hbs @@ -0,0 +1,30 @@ +# generated {{output.date}}, {{{output.link}}} +defaultEntryPoints = ["http", "https"] + +[entryPoints] +{{#if form.hsts}} + [entryPoints.http] + address = ":80" + [entryPoints.http.redirect] + entryPoint = "https" + +{{/if}} + [entryPoints.https] + address = ":443" + [entryPoints.https.tls] + {{#if (eq output.protocols.[0] "TLSv1")}} + minVersion = "VersionTLS10" + {{else}} + minVersion = "{{{replace output.protocols.[0] "TLSv1." "VersionTLS1"}}}" + {{/if}} + {{#if output.ciphers.length}} + cipherSuites = [ + {{#each output.ciphers}} + "{{this}}"{{#unless @last}},{{/unless}} + {{/each}} + ] + {{/if}} + + [[entryPoints.https.tls.certificates]] + certFile = "/path/to/signed_cert_plus_intermediates" + keyFile = "/path/to/private_key"
\ No newline at end of file |