Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mozilla/ssl-config-generator.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorApril King <april@mozilla.com>2020-01-17 23:43:03 +0300
committerGitHub <noreply@github.com>2020-01-17 23:43:03 +0300
commit78e1aad4b9b19c141359d4aab1e733eb50ef43ea (patch)
tree6d9c5f5e32b6f4b9d0f58db0db1c7b95162d9b41
parent591abb722d59fddaa27315ac142fc7199c339bd6 (diff)
parente135a307a4ada9b04faeac3f63c9222c2d69d87a (diff)
Merge pull request #72 from simonkrenger/traefik-v2
Support for Traefik v2
-rwxr-xr-xsrc/js/configs.js2
-rw-r--r--src/templates/partials/traefik.hbs50
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