diff options
author | April King <april@mozilla.com> | 2020-01-17 23:43:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-17 23:43:03 +0300 |
commit | 78e1aad4b9b19c141359d4aab1e733eb50ef43ea (patch) | |
tree | 6d9c5f5e32b6f4b9d0f58db0db1c7b95162d9b41 | |
parent | 591abb722d59fddaa27315ac142fc7199c339bd6 (diff) | |
parent | e135a307a4ada9b04faeac3f63c9222c2d69d87a (diff) |
Merge pull request #72 from simonkrenger/traefik-v2
Support for Traefik v2
-rwxr-xr-x | src/js/configs.js | 2 | ||||
-rw-r--r-- | src/templates/partials/traefik.hbs | 50 |
2 files changed, 50 insertions, 2 deletions
diff --git a/src/js/configs.js b/src/js/configs.js index 5dedc64..48d5dea 100755 --- a/src/js/configs.js +++ b/src/js/configs.js @@ -140,7 +140,7 @@ module.exports = { traefik: { cipherFormat: 'go', highlighter: 'ini', - latestVersion: '1.7.12', + latestVersion: '2.1.1', name: 'Traefik', supportsHsts: true, supportsOcspStapling: false, // https://github.com/containous/traefik/issues/212 diff --git a/src/templates/partials/traefik.hbs b/src/templates/partials/traefik.hbs index 7e671a8..489569e 100644 --- a/src/templates/partials/traefik.hbs +++ b/src/templates/partials/traefik.hbs @@ -1,4 +1,51 @@ # generated {{output.date}}, {{{output.link}}} +{{#if (minver "2.0.0" form.serverVersion)}} +{{! traefik 2.0 has a very different configuration style }} +[http.routers] + [http.routers.router-secure] + rule = "Host(`foo.com`)" + service = "service-id" + {{#if form.hsts}} + middlewares = ["hsts-header"] + {{/if}} + + [http.routers.router-secure.tls] + options = "{{form.config}}" +{{#if form.hsts}} + + [http.routers.router-insecure] + rule = "Host(`foo.com`)" + service = "service-id" + {{#if form.hsts}} + middlewares = ["redirect-to-https", "hsts-header"] + {{/if}} + +[http.middlewares] + [http.middlewares.redirect-to-https.redirectScheme] + scheme = "https" + [http.middlewares.hsts-header.headers] + [http.middlewares.hsts-header.headers.customResponseHeaders] + Strict-Transport-Security = "max-age={{output.hstsMaxAge}}" +{{/if}} + +# due to Go limitations, it is highly recommended that you use an ECDSA +# certificate, or you may experience compatibility issues +[[tls.certificates]] + certFile = "/path/to/signed_cert_plus_intermediates" + keyFile = "/path/to/private_key" + +[tls.options] + [tls.options.{{form.config}}] + minVersion = "{{{replace output.protocols.[0] "TLSv1." "VersionTLS1"}}}" + {{#if output.ciphers.length}} + cipherSuites = [ + {{#each output.ciphers}} + "{{this}}"{{#unless @last}},{{/unless}} + {{/each}} + ] + {{/if}} +{{else}} +{{! traefik 1.x configuration style }} defaultEntryPoints = ["http", "https"] [entryPoints] @@ -29,4 +76,5 @@ defaultEntryPoints = ["http", "https"] # certificate, or you may experience compatibility issues [[entryPoints.https.tls.certificates]] certFile = "/path/to/signed_cert_plus_intermediates" - keyFile = "/path/to/private_key"
\ No newline at end of file + keyFile = "/path/to/private_key" +{{/if}}
\ No newline at end of file |